|
65 | 65 |
|
66 | 66 | <!-- Disable Paket restore under NCrunch build -->
|
67 | 67 | <PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>
|
| 68 | + |
| 69 | + <PaketIntermediateOutputPath Condition=" '$(PaketIntermediateOutputPath)' == '' ">$(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/'))</PaketIntermediateOutputPath> |
68 | 70 | </PropertyGroup>
|
69 | 71 |
|
70 | 72 | <Target Name="PaketBootstrapping" Condition="Exists('$(PaketToolsPath)paket.bootstrapper.proj')">
|
|
105 | 107 | <PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
|
106 | 108 | </PropertyGroup>
|
107 | 109 |
|
108 |
| - <!-- |
109 |
| - This value should match the version in the props generated by paket |
| 110 | + <!-- |
| 111 | + This value should match the version in the props generated by paket |
110 | 112 | If they differ, this means we need to do a restore in order to ensure correct dependencies
|
111 | 113 | -->
|
112 | 114 | <PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
|
|
115 | 117 |
|
116 | 118 | <!-- Do a global restore if required -->
|
117 | 119 | <Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
|
118 |
| - <Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' " ContinueOnError="false" /> |
119 |
| - |
| 120 | + <Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" /> |
| 121 | + |
120 | 122 | <!-- Step 2 Detect project specific changes -->
|
121 | 123 | <ItemGroup>
|
122 | 124 | <MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
|
123 | 125 | <!-- Don't include all frameworks when msbuild explicitly asks for a single one -->
|
124 | 126 | <MyTargetFrameworks Condition="'$(TargetFrameworks)' != '' AND '$(TargetFramework)' == '' " Include="$(TargetFrameworks)"></MyTargetFrameworks>
|
125 |
| - <PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths> |
| 127 | + <PaketResolvedFilePaths Include="@(MyTargetFrameworks -> '$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).%(Identity).paket.resolved')"></PaketResolvedFilePaths> |
126 | 128 | </ItemGroup>
|
127 | 129 | <Message Importance="low" Text="MyTargetFrameworks=@(MyTargetFrameworks) PaketResolvedFilePaths=@(PaketResolvedFilePaths)" />
|
128 | 130 | <PropertyGroup>
|
129 |
| - <PaketReferencesCachedFilePath>$(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath> |
| 131 | + <PaketReferencesCachedFilePath>$(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached</PaketReferencesCachedFilePath> |
130 | 132 | <!-- MyProject.fsproj.paket.references has the highest precedence -->
|
131 | 133 | <PaketOriginalReferencesFilePath>$(MSBuildProjectFullPath).paket.references</PaketOriginalReferencesFilePath>
|
132 | 134 | <!-- MyProject.paket.references -->
|
|
161 | 163 |
|
162 | 164 | <!-- Step 3 Restore project specific stuff if required -->
|
163 | 165 | <Message Condition=" '$(PaketRestoreRequired)' == 'true' " Importance="low" Text="Detected a change ('$(PaketRestoreRequiredReason)') in the project file '$(MSBuildProjectFullPath)', calling paket restore" />
|
164 |
| - <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" /> |
165 |
| - <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" /> |
| 166 | + <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFrameworks)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' == '' " ContinueOnError="false" /> |
| 167 | + <Exec Command='$(PaketCommand) restore --project "$(MSBuildProjectFullPath)" --output-path "$(PaketIntermediateOutputPath)" --target-framework "$(TargetFramework)"' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(TargetFramework)' != '' " ContinueOnError="false" /> |
166 | 168 |
|
167 | 169 | <!-- This shouldn't actually happen, but just to be sure. -->
|
168 | 170 | <PropertyGroup>
|
|
195 | 197 | </ItemGroup>
|
196 | 198 |
|
197 | 199 | <PropertyGroup>
|
198 |
| - <PaketCliToolFilePath>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath> |
| 200 | + <PaketCliToolFilePath>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools</PaketCliToolFilePath> |
199 | 201 | </PropertyGroup>
|
200 | 202 |
|
201 | 203 | <ReadLinesFromFile File="$(PaketCliToolFilePath)" >
|
|
214 | 216 |
|
215 | 217 | <!-- Disabled for now until we know what to do with runtime deps - https://github.com/fsprojects/Paket/issues/2964
|
216 | 218 | <PropertyGroup>
|
217 |
| - <RestoreConfigFile>$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile> |
| 219 | + <RestoreConfigFile>$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).NuGet.Config</RestoreConfigFile> |
218 | 220 | </PropertyGroup> -->
|
219 | 221 |
|
220 | 222 | </Target>
|
221 | 223 |
|
222 |
| - <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
| 224 | + <Target Name="PaketDisableDirectPack" AfterTargets="_IntermediatePack" BeforeTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" > |
223 | 225 | <PropertyGroup>
|
224 | 226 | <ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
|
225 | 227 | <DetectedMSBuildVersion>$(MSBuildVersion)</DetectedMSBuildVersion>
|
226 | 228 | <DetectedMSBuildVersion Condition="$(MSBuildVersion) == ''">15.8.0</DetectedMSBuildVersion>
|
227 | 229 | </PropertyGroup>
|
228 | 230 | </Target>
|
229 | 231 |
|
230 |
| - <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).references')" > |
| 232 | + <Target Name="PaketOverrideNuspec" AfterTargets="GenerateNuspec" Condition="('$(IsPackable)' == '' Or '$(IsPackable)' == 'true') And Exists('$(PaketIntermediateOutputPath)/$(MSBuildProjectFile).references')" > |
231 | 233 | <ItemGroup>
|
232 |
| - <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> |
| 234 | + <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/> |
233 | 235 | <MSBuildMajorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[0])" />
|
234 | 236 | <MSBuildMinorVersion Include="$(DetectedMSBuildVersion.Replace(`-`, `.`).Split(`.`)[1])" />
|
235 | 237 | </ItemGroup>
|
236 | 238 |
|
237 | 239 | <PropertyGroup>
|
238 | 240 | <PaketProjectFile>$(MSBuildProjectDirectory)/$(MSBuildProjectFile)</PaketProjectFile>
|
239 | 241 | <ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
|
| 242 | + <UseMSBuild16_0_Pack>false</UseMSBuild16_0_Pack> |
| 243 | + <UseMSBuild16_0_Pack Condition=" '@(MSBuildMajorVersion)' >= '16' ">true</UseMSBuild16_0_Pack> |
240 | 244 | <UseMSBuild15_9_Pack>false</UseMSBuild15_9_Pack>
|
241 |
| - <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' > '15' OR ('@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8') ">true</UseMSBuild15_9_Pack> |
| 245 | + <UseMSBuild15_9_Pack Condition=" '@(MSBuildMajorVersion)' == '15' AND '@(MSBuildMinorVersion)' > '8' ">true</UseMSBuild15_9_Pack> |
242 | 246 | <UseMSBuild15_8_Pack>false</UseMSBuild15_8_Pack>
|
243 |
| - <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) ">true</UseMSBuild15_8_Pack> |
| 247 | + <UseMSBuild15_8_Pack Condition=" '$(NuGetToolVersion)' != '4.0.0' AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseMSBuild15_8_Pack> |
244 | 248 | <UseNuGet4_Pack>false</UseNuGet4_Pack>
|
245 |
| - <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) ">true</UseNuGet4_Pack> |
246 |
| - <AdjustedNuspecOutputPath>$(BaseIntermediateOutputPath)$(Configuration)</AdjustedNuspecOutputPath> |
247 |
| - <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(BaseIntermediateOutputPath)</AdjustedNuspecOutputPath> |
| 249 | + <UseNuGet4_Pack Condition=" (! $(UseMSBuild15_8_Pack)) AND (! $(UseMSBuild15_9_Pack)) AND (! $(UseMSBuild16_0_Pack)) ">true</UseNuGet4_Pack> |
| 250 | + <AdjustedNuspecOutputPath>$(PaketIntermediateOutputPath)\$(Configuration)</AdjustedNuspecOutputPath> |
| 251 | + <AdjustedNuspecOutputPath Condition="@(_NuspecFilesNewLocation) == ''">$(PaketIntermediateOutputPath)</AdjustedNuspecOutputPath> |
248 | 252 | </PropertyGroup>
|
249 | 253 |
|
250 | 254 | <ItemGroup>
|
|
258 | 262 | </ConvertToAbsolutePath>
|
259 | 263 |
|
260 | 264 | <!-- Call Pack -->
|
| 265 | + <PackTask Condition="$(UseMSBuild16_0_Pack)" |
| 266 | + PackItem="$(PackProjectInputFile)" |
| 267 | + PackageFiles="@(_PackageFiles)" |
| 268 | + PackageFilesToExclude="@(_PackageFilesToExclude)" |
| 269 | + PackageVersion="$(PackageVersion)" |
| 270 | + PackageId="$(PackageId)" |
| 271 | + Title="$(Title)" |
| 272 | + Authors="$(Authors)" |
| 273 | + Description="$(Description)" |
| 274 | + Copyright="$(Copyright)" |
| 275 | + RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)" |
| 276 | + LicenseUrl="$(PackageLicenseUrl)" |
| 277 | + ProjectUrl="$(PackageProjectUrl)" |
| 278 | + IconUrl="$(PackageIconUrl)" |
| 279 | + ReleaseNotes="$(PackageReleaseNotes)" |
| 280 | + Tags="$(PackageTags)" |
| 281 | + DevelopmentDependency="$(DevelopmentDependency)" |
| 282 | + BuildOutputInPackage="@(_BuildOutputInPackage)" |
| 283 | + TargetPathsToSymbols="@(_TargetPathsToSymbols)" |
| 284 | + SymbolPackageFormat="symbols.nupkg" |
| 285 | + TargetFrameworks="@(_TargetFrameworks)" |
| 286 | + AssemblyName="$(AssemblyName)" |
| 287 | + PackageOutputPath="$(PackageOutputAbsolutePath)" |
| 288 | + IncludeSymbols="$(IncludeSymbols)" |
| 289 | + IncludeSource="$(IncludeSource)" |
| 290 | + PackageTypes="$(PackageType)" |
| 291 | + IsTool="$(IsTool)" |
| 292 | + RepositoryUrl="$(RepositoryUrl)" |
| 293 | + RepositoryType="$(RepositoryType)" |
| 294 | + SourceFiles="@(_SourceFiles->Distinct())" |
| 295 | + NoPackageAnalysis="$(NoPackageAnalysis)" |
| 296 | + MinClientVersion="$(MinClientVersion)" |
| 297 | + Serviceable="$(Serviceable)" |
| 298 | + FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)" |
| 299 | + ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)" |
| 300 | + NuspecOutputPath="$(AdjustedNuspecOutputPath)" |
| 301 | + IncludeBuildOutput="$(IncludeBuildOutput)" |
| 302 | + BuildOutputFolders="$(BuildOutputTargetFolder)" |
| 303 | + ContentTargetFolders="$(ContentTargetFolders)" |
| 304 | + RestoreOutputPath="$(RestoreOutputAbsolutePath)" |
| 305 | + NuspecFile="$(NuspecFileAbsolutePath)" |
| 306 | + NuspecBasePath="$(NuspecBasePath)" |
| 307 | + NuspecProperties="$(NuspecProperties)" |
| 308 | + PackageLicenseFile="$(PackageLicenseFile)" |
| 309 | + PackageLicenseExpression="$(PackageLicenseExpression)" |
| 310 | + PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)" /> |
| 311 | + |
261 | 312 | <PackTask Condition="$(UseMSBuild15_9_Pack)"
|
262 | 313 | PackItem="$(PackProjectInputFile)"
|
263 | 314 | PackageFiles="@(_PackageFiles)"
|
|
0 commit comments