2016-12-03 22:19:54 +00:00
|
|
|
<Project ToolsVersion="15.0" DefaultTargets="CopySdkToOutput">
|
|
|
|
<!-- workaround for https://github.com/Microsoft/msbuild/issues/885 -->
|
|
|
|
<!-- renaming the property because the original property is a global property and therefore
|
|
|
|
cannot be redefined at runtime. -->
|
|
|
|
<PropertyGroup>
|
|
|
|
<CLIBuildDllPath>$([MSBuild]::Unescape($(CLIBuildDll)))</CLIBuildDllPath>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<UsingTask TaskName="DotNetRestore" AssemblyFile="$(CLIBuildDllPath)" />
|
|
|
|
|
|
|
|
<Target Name="CopySdkToOutput"
|
|
|
|
DependsOnTargets="PrepareBundledSdksProps;
|
|
|
|
EnsureSdkRestored;
|
|
|
|
GetSdkItemsToCopy"
|
|
|
|
Inputs="@(SdkContent)"
|
|
|
|
Outputs="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')">
|
|
|
|
<Copy SourceFiles="@(SdkContent)"
|
|
|
|
DestinationFiles="@(SdkContent->'$(SdkLayoutDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" />
|
2016-12-05 06:31:58 +00:00
|
|
|
|
2016-12-09 08:30:02 +00:00
|
|
|
<!-- Remove unused directories for FSharp.NET.Sdk, just Sdk directory is needed -->
|
|
|
|
<RemoveDir Condition=" '$([System.IO.Path]::GetFileName($(SdkLayoutDirectory)))' == 'FSharp.NET.Sdk' " Directories="$(SdkLayoutDirectory)/build;$(SdkLayoutDirectory)/buildCrossTargeting" />
|
|
|
|
|
2016-12-05 06:31:58 +00:00
|
|
|
<Message Text="Copied Sdk $(SdkPackageName) from $(SdkNuPkgPath) to $(SdkLayoutDirectory)."
|
|
|
|
Importance="High" />
|
2016-12-03 22:19:54 +00:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="GetSdkItemsToCopy">
|
|
|
|
<ItemGroup>
|
|
|
|
<SdkContent Include="$(SdkNuPkgPath)/**/*"
|
|
|
|
Exclude="$(SdkNuPkgPath)/$(SdkPackageName).nuspec;
|
|
|
|
$(SdkNuPkgPath)/$(SdkPackageName).$(SdkPackageVersion).nupkg;
|
|
|
|
$(SdkNuPkgPath)/$(SdkPackageName).$(SdkPackageVersion).nupkg.sha512" />
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="EnsureSdkRestored"
|
|
|
|
Condition="!Exists('$(SdkNuPkgPath)/$(SdkPackageName.ToLower()).nuspec')">
|
|
|
|
<DotNetRestore ToolPath="$(Stage0Directory)"
|
|
|
|
ProjectPath="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
|
|
|
|
AdditionalParameters="/p:SdkPackageName=$(SdkPackageName) /p:SdkPackageVersion=$(SdkPackageVersion)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="PrepareBundledSdksProps">
|
|
|
|
<PropertyGroup>
|
|
|
|
<SdkNuPkgPath>$(NuGetPackagesDir)/$(SdkPackageName.ToLower())/$(SdkPackageVersion.ToLower())</SdkNuPkgPath>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Target>
|
|
|
|
</Project>
|