Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #396 from joperezr/RestoreNetCoreMSBuild
Browse files Browse the repository at this point in the history
Adding scripts that will bootstrap netcore msbuild and that can be called from repos. Also switching forward slashes to backslashes for OS X build.
  • Loading branch information
joperezr committed Jan 27, 2016
2 parents cdf8b14 + a8a063e commit ca64e7c
Show file tree
Hide file tree
Showing 16 changed files with 112 additions and 79 deletions.
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="CreateAzureFileShare" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="SendJsonToDocumentDb" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="SendToEventHub" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="UploadToAzure" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="WriteItemsToJson" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="WriteTestBuildStatsJson" AssemblyFile="$(ToolsDir)net45\Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="CreateAzureContainer" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="CreateAzureFileShare" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="SendJsonToDocumentDb" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="SendToEventHub" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="UploadToAzure" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="WriteItemsToJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="WriteTestBuildStatsJson" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
<UsingTask TaskName="ZipFileCreateFromDirectory" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll"/>

<PropertyGroup>
<ContainerName>$(TestProduct)-$(Branch)-$(BuildMoniker)</ContainerName>
<ContainerName>$(ContainerName.ToLower())</ContainerName>
<FuncTestListFilename>FuncTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</FuncTestListFilename>
<PerfTestListFilename>PerfTests.$(OSGroup).$(Platform)$(ConfigurationGroup).json</PerfTestListFilename>
<ArchivesRoot>$(TestWorkingDir)$(OSPlatformConfig)\archive\</ArchivesRoot>
<TestArchivesRoot>$(ArchivesRoot)Tests\</TestArchivesRoot>
<ArchivesRoot>$(TestWorkingDir)$(OSPlatformConfig)/archive/</ArchivesRoot>
<TestArchivesRoot>$(ArchivesRoot)Tests/</TestArchivesRoot>
<PackagesArchiveFilename>Packages.zip</PackagesArchiveFilename>
<PackagesArchiveFile>$(ArchivesRoot)$(PackagesArchiveFilename)</PackagesArchiveFile>
<FuncTestListFile>$(TestWorkingDir)$(OSPlatformConfig)\$(FuncTestListFilename)</FuncTestListFile>
<PerfTestListFile>$(TestWorkingDir)$(OSPlatformConfig)\$(PerfTestListFilename)</PerfTestListFile>
<BuildStatsJsonFile>$(TestWorkingDir)$(OSPlatformConfig)\BuildStats.json</BuildStatsJsonFile>
<FuncTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(FuncTestListFilename)</FuncTestListFile>
<PerfTestListFile>$(TestWorkingDir)$(OSPlatformConfig)/$(PerfTestListFilename)</PerfTestListFile>
<BuildStatsJsonFile>$(TestWorkingDir)$(OSPlatformConfig)/BuildStats.json</BuildStatsJsonFile>
</PropertyGroup>

<!-- main entrypoint -->
Expand Down Expand Up @@ -54,7 +54,7 @@
<!-- add relative blob path metadata -->
<ItemGroup>
<ForUpload>
<RelativeBlobPath>$(Platform)$(ConfigurationGroup)\Tests\%(Filename)%(Extension)</RelativeBlobPath>
<RelativeBlobPath>$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)</RelativeBlobPath>
</ForUpload>
</ItemGroup>
</Target>
Expand Down Expand Up @@ -98,7 +98,7 @@
</ItemGroup>
<ItemGroup>
<FunctionalTest>
<Command>%HELIX_PYTHONPATH% %HELIX_SCRIPT_ROOT%\xunitrunner.py --dll %(Filename).dll -- $(XunitArgs)</Command>
<Command>%HELIX_PYTHONPATH% %HELIX_SCRIPT_ROOT%/xunitrunner.py --dll %(Filename).dll -- $(XunitArgs)</Command>
<CorrelationPayloadUris>[$(DropUri)$(Platform)$(ConfigurationGroup)/Packages.zip$(DropUriReadOnlyToken)]</CorrelationPayloadUris>
<PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
<WorkItemId>FunctionalTest.%(Filename)</WorkItemId>
Expand All @@ -115,16 +115,16 @@
<ItemGroup>
<TestListFile Include="$(FuncTestListFile)">
<CorrelationId>$([System.Guid]::NewGuid())</CorrelationId>
<BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)\FuncBuildComplete.json</BuildCompleteJson>
<OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)\FuncOfficialBuild.json</OfficialBuildJson>
<BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncBuildComplete.json</BuildCompleteJson>
<OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)/FuncOfficialBuild.json</OfficialBuildJson>
</TestListFile>
</ItemGroup>
</Target>

<Target Name="CreatePerfTestListJson" DependsOnTargets="CreateAzureStorage" Condition="'$(Performance)' == 'true'">
<!-- now gather the perf tests -->
<ItemGroup>
<TestBinary Include="$(BinDir)$(OSPlatformConfig)\**\*Tests.dll" />
<TestBinary Include="$(BinDir)$(OSPlatformConfig)/**/*Tests.dll" />
</ItemGroup>
<GetPerfTestAssemblies TestBinaries="@(TestBinary)">
<Output TaskParameter="PerfTestAssemblies" ItemName="PerfTestAssembly" />
Expand All @@ -135,7 +135,7 @@
</ItemGroup>
<ItemGroup Condition="'@(PerfTestAssembly->Count())' != '0'">
<PerfTest>
<Command>%HELIX_PYTHONPATH% %HELIX_SCRIPT_ROOT%\xunitrunner.py --dll %(Filename).dll --perf-runner Microsoft.DotNet.xunit.performance.runner.Windows -- $(XunitArgs)</Command>
<Command>%HELIX_PYTHONPATH% %HELIX_SCRIPT_ROOT%/xunitrunner.py --dll %(Filename).dll --perf-runner Microsoft.DotNet.xunit.performance.runner.Windows -- $(XunitArgs)</Command>
<CorrelationPayloadUris>[$(DropUri)$(Platform)$(ConfigurationGroup)/Packages.zip$(DropUriReadOnlyToken)]</CorrelationPayloadUris>
<PayloadUri>$(DropUri)$(Platform)$(ConfigurationGroup)/Tests/%(Filename)%(Extension)$(DropUriReadOnlyToken)</PayloadUri>
<WorkItemId>PerfTest.%(Filename)</WorkItemId>
Expand All @@ -153,8 +153,8 @@
<ItemGroup>
<TestListFile Include="$(PerfTestListFile)">
<CorrelationId>$([System.Guid]::NewGuid())</CorrelationId>
<BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)\PerfBuildComplete.json</BuildCompleteJson>
<OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)\PerfOfficialBuild.json</OfficialBuildJson>
<BuildCompleteJson>$(TestWorkingDir)$(OSPlatformConfig)/PerfBuildComplete.json</BuildCompleteJson>
<OfficialBuildJson>$(TestWorkingDir)$(OSPlatformConfig)/PerfOfficialBuild.json</OfficialBuildJson>
</TestListFile>
</ItemGroup>
</Target>
Expand All @@ -174,7 +174,7 @@
<!-- add to the list of uploads -->
<ItemGroup>
<ForUpload Include="$(PackagesArchiveFile)">
<RelativeBlobPath>$(Platform)$(ConfigurationGroup)\$(PackagesArchiveFilename)</RelativeBlobPath>
<RelativeBlobPath>$(Platform)$(ConfigurationGroup)/$(PackagesArchiveFilename)</RelativeBlobPath>
</ForUpload>
</ItemGroup>
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,35 @@
There are special cases for en-US and zh-* so we manually list
the mapping.-->
<ItemGroup>
<XmlDocFile Include="$(XmlDocFileRoot)\1028\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1028/$(TargetName).xml">
<SubFolder>/zh-hant</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1031\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1031/$(TargetName).xml">
<SubFolder>/de</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1033\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1033/$(TargetName).xml">
<SubFolder />
<!-- en docs go in root as neutral fall back -->
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1036\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1036/$(TargetName).xml">
<SubFolder>/fr</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1040\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1040/$(TargetName).xml">
<SubFolder>/it</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1041\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1041/$(TargetName).xml">
<SubFolder>/ja</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1042\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1042/$(TargetName).xml">
<SubFolder>/ko</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\1049\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/1049/$(TargetName).xml">
<SubFolder>/ru</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\2052\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/2052/$(TargetName).xml">
<SubFolder>/zh-hans</SubFolder>
</XmlDocFile>
<XmlDocFile Include="$(XmlDocFileRoot)\3082\$(TargetName).xml">
<XmlDocFile Include="$(XmlDocFileRoot)/3082/$(TargetName).xml">
<SubFolder>/es</SubFolder>
</XmlDocFile>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@

<!-- Shared properties -->
<PropertyGroup>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(BaseOutputPath)pkg\</PackageOutputPath>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(BaseOutputPath)pkg/</PackageOutputPath>
<OutputPath>$(PackageOutputPath)</OutputPath>
<NuSpecOutputPath Condition="'$(NuSpecOutputPath)' == ''">$(PackageOutputPath)specs\</NuSpecOutputPath>
<NuSpecOutputPath Condition="'$(NuSpecOutputPath)' == ''">$(PackageOutputPath)specs/</NuSpecOutputPath>
<NuSpecPath>$(NuSpecOutputPath)$(Id)$(NuspecSuffix).nuspec</NuSpecPath>
<RuntimeFilePath Condition="'$(RuntimeFilePath)' == ''">$(NuSpecOutputPath)$(Id)$(NuspecSuffix)\runtime.json</RuntimeFilePath>
<RuntimeFilePath Condition="'$(RuntimeFilePath)' == ''">$(NuSpecOutputPath)$(Id)$(NuspecSuffix)/runtime.json</RuntimeFilePath>
<PlaceholderFile>$(MSBuildThisFileDirectory)_._</PlaceholderFile>
<PackageDescriptionFile Condition="'$(PackageDescriptionFile)' == ''">path to descriptions.json must be specified</PackageDescriptionFile>
<RuntimeIdGraphDefinitionFile Condition="'$(RuntimeIdGraphDefinitionFile)' == ''">$(MSBuildThisFileDirectory)runtime.json</RuntimeIdGraphDefinitionFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Check if the project has been localized by looking for the existence of the .de.xlf file. By convention, we assume that if
a project is localized in German, then it is localized in all languages.
-->
<ExcludeLocalizationImport Condition="'$(ExcludeLocalizationImport)'=='' And !Exists('$(MSBuildProjectDirectory)\MultilingualResources\$(MSBuildProjectName).de.xlf')">true</ExcludeLocalizationImport>
<ExcludeLocalizationImport Condition="'$(ExcludeLocalizationImport)'=='' And !Exists('$(MSBuildProjectDirectory)/MultilingualResources/$(MSBuildProjectName).de.xlf')">true</ExcludeLocalizationImport>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -198,7 +198,7 @@

<PropertyGroup Condition="'$(BlockReflectionAttribute)'=='true'">
<CoreCompileDependsOn>$(CoreCompileDependsOn);AddBlockReflectionAttribute</CoreCompileDependsOn>
<BlockReflectionAtributeFile>$(MSBuildThisFileDirectory)\BlockReflectionAttribute.cs</BlockReflectionAtributeFile>
<BlockReflectionAtributeFile>$(MSBuildThisFileDirectory)/BlockReflectionAttribute.cs</BlockReflectionAtributeFile>
</PropertyGroup>

<Target Name="AddBlockReflectionAttribute" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PerfRunners Include="$(XunitPerfRunnerPackageDir)/tools/*/*.*" />
</ItemGroup>
<Copy SourceFiles="@(PerfRunners)"
DestinationFiles="@(PerfRunners->'$(TestPath)$(DebugTestFrameworkFolder)\%(RecursiveDir)%(Filename)%(Extension)')"
DestinationFiles="@(PerfRunners->'$(TestPath)$(DebugTestFrameworkFolder)/%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<CompilerResponseFile Condition="'$(IsCoreAssembly)' == 'true' AND '$(_usingRoslyn)' == 'true'">$(MSBuildThisFileDirectory)coreAssembly.rsp</CompilerResponseFile>

<!-- Create a common root output directory for all reference assemblies -->
<ReferenceAssemblyOutputPath Condition="'$(ReferenceAssemblyOutputPath)' == ''">$(BaseOutputPath)ref\</ReferenceAssemblyOutputPath>
<ReferenceAssemblyOutputPath Condition="'$(ReferenceAssemblyOutputPath)' == ''">$(BaseOutputPath)ref/</ReferenceAssemblyOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(IsReferenceAssembly)'=='true'">
<AssemblyName Condition="'$(AssemblyName)' == ''">$(MSBuildProjectName)</AssemblyName>
<OutputPath>$(ReferenceAssemblyOutputPath)$(AssemblyName)\$(AssemblyVersion)</OutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)ref\$(AssemblyName)\$(AssemblyVersion)</IntermediateOutputPath>
<OutputPath>$(ReferenceAssemblyOutputPath)$(AssemblyName)/$(AssemblyVersion)</OutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)ref/$(AssemblyName)/$(AssemblyVersion)</IntermediateOutputPath>

<OmitTransitiveCompileReferences>true</OmitTransitiveCompileReferences>
<!-- if this is a reference assembly deployment project use compile assets
Expand Down
8 changes: 8 additions & 0 deletions src/Microsoft.DotNet.Build.Tasks/PackageFiles/init-tools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set DOTNET_CMD=%~2
set TOOLRUNTIME_DIR=%~3
IF [%BUILDTOOLS_TARGET_RUNTIME%]==[] set BUILDTOOLS_TARGET_RUNTIME=win7-x64
set BUILDTOOLS_PACKAGE_DIR=%~dp0
set MSBUILD_CONTENT_JSON={"dependencies": {"Microsoft.Portable.Targets": "0.1.1-dev"},"frameworks": {"dnxcore50": {},"net46": {}}}

if not exist "%PROJECT_DIR%" (
echo ERROR: Cannot find project root path at [%PROJECT_DIR%]. Please pass in the source directory as the 1st parameter.
Expand All @@ -23,4 +24,11 @@ cd "%BUILDTOOLS_PACKAGE_DIR%\tool-runtime\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-core/ --source https://www.myget.org/F/dotnet-buildtools/ --source https://www.nuget.org/api/v2/
call "%DOTNET_CMD%" publish -f dnxcore50 -r %BUILDTOOLS_TARGET_RUNTIME% -o "%TOOLRUNTIME_DIR%"

:: Copy Portable Targets Over to ToolRuntime
mkdir "%BUILDTOOLS_PACKAGE_DIR%\portableTargets"
echo %MSBUILD_CONTENT_JSON% > "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\project.json"
cd "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\"
call "%DOTNET_CMD%" restore --source https://www.myget.org/F/dotnet-buildtools/ --packages "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\"
Robocopy "%BUILDTOOLS_PACKAGE_DIR%\portableTargets\packages\Microsoft.Portable.Targets\0.1.1-dev\contentFiles\any\any\." "%TOOLRUNTIME_DIR%\." /E

exit /b %ERRORLEVEL%
14 changes: 13 additions & 1 deletion src/Microsoft.DotNet.Build.Tasks/PackageFiles/init-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __PROJECT_DIR=$1
__DOTNET_CMD=$2
__TOOLRUNTIME_DIR=$3
__TOOLS_DIR=$(cd "$(dirname "$0")"; pwd -P)
__MSBUILD_CONTENT_JSON="{\"dependencies\": {\"Microsoft.Portable.Targets\": \"0.1.1-dev\"},\"frameworks\": {\"dnxcore50\": {},\"net46\": {}}}"

__BUILDERRORLEVEL=0

Expand Down Expand Up @@ -39,15 +40,26 @@ case $OSName in
esac

cp -R $__TOOLS_DIR/* $__TOOLRUNTIME_DIR
chmod a+x $__TOOLRUNTIME_DIR/corerun

cd $__TOOLS_DIR/tool-runtime/
$__DOTNET_CMD restore --source https://www.myget.org/F/dotnet-core/ --source https://www.myget.org/F/dotnet-buildtools/ --source https://www.nuget.org/api/v2/
$__DOTNET_CMD publish -f dnxcore50 -r ${__PUBLISH_RID} -o $__TOOLRUNTIME_DIR
chmod a+x $__TOOLRUNTIME_DIR/corerun

if [ -n "$BUILDTOOLS_OVERRIDE_RUNTIME" ]; then
find $__TOOLRUNTIME_DIR -name *.ni.* | xargs rm 2>/dev/null
cp -R $BUILDTOOLS_OVERRIDE_RUNTIME/* $__TOOLRUNTIME_DIR
fi

# Copy Portable Targets Over to ToolRuntime
mkdir "$__TOOLS_DIR/portableTargets"
echo $__MSBUILD_CONTENT_JSON > "$__TOOLS_DIR/portableTargets/project.json"
cd "$__TOOLS_DIR/portableTargets"
"$__DOTNET_CMD" restore --source https://www.myget.org/F/dotnet-buildtools/ --packages "$__TOOLS_DIR/portableTargets/packages/"
cp -R "$__TOOLS_DIR/portableTargets/packages/Microsoft.Portable.Targets/0.1.1-dev/contentFiles/any/any/." "$__TOOLRUNTIME_DIR/."

# Temporary Hacks to fix couple of issues in the msbuild and roslyn nuget packages
cp "$__TOOLRUNTIME_DIR/corerun" "$__TOOLRUNTIME_DIR/corerun.exe"
mv "$__TOOLRUNTIME_DIR/Microsoft.CSharp.targets" "$__TOOLRUNTIME_DIR/Microsoft.CSharp.Targets"

exit $__BUILDERRORLEVEL
12 changes: 6 additions & 6 deletions src/Microsoft.DotNet.Build.Tasks/PackageFiles/packages.targets
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@
</Target>

<PropertyGroup>
<LocalPublishPropsFile Condition="'$(LocalPublishPropsFile)'==''">$(PackagesDir)\localpublish.props</LocalPublishPropsFile>
<LocalPublishPropsFile Condition="'$(LocalPublishPropsFile)'==''">$(PackagesDir)/localpublish.props</LocalPublishPropsFile>
<NugetPackageBuildTargets Condition="'$(NugetPackageBuildTargets)'==''">BuildPackages</NugetPackageBuildTargets>
</PropertyGroup>

<Import Condition="Exists('$(LocalPublishPropsFile)')" Project="$(LocalPublishPropsFile)"/>

<!-- Publish the packages locally -->
<Target Name="LocalPackagePublish" Condition="'@(LocalPackages)'!=''"
Inputs="%(LocalPackages.Identity)\%(LocalPackages.PackageName).%(LocalPackages.PackageVersion).nupkg;%(LocalPackages.InstallLocation)\%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)"
Outputs="%(LocalPackages.InstallLocation)\%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)\MODIFIED.txt"
Inputs="%(LocalPackages.Identity)/%(LocalPackages.PackageName).%(LocalPackages.PackageVersion).nupkg;%(LocalPackages.InstallLocation)/%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)"
Outputs="%(LocalPackages.InstallLocation)/%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)/MODIFIED.txt"
AfterTargets="$(NugetPackageBuildTargets)">

<!-- Generate the packages.config -->
Expand All @@ -99,7 +99,7 @@
</ItemGroup>

<PropertyGroup>
<RestoreConfig>%(LocalPackages.InstallLocation)\packages.%(LocalPackages.PackageName).config</RestoreConfig>
<RestoreConfig>%(LocalPackages.InstallLocation)/packages.%(LocalPackages.PackageName).config</RestoreConfig>
</PropertyGroup>

<WriteLinesToFile File="$(RestoreConfig)" Lines="@(LocalPackageConfigLine)" Overwrite="true" />
Expand All @@ -111,7 +111,7 @@
<Message Text="Generated package install sources: '$(LocalPackages)'"/>

<!-- Remove existing directories -->
<RemoveDir Directories="%(LocalPackages.InstallLocation)\%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)" />
<RemoveDir Directories="%(LocalPackages.InstallLocation)/%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)" />

<!-- Restoring the packages -->
<Exec Command="$(NuGetExe) install &quot;$(RestoreConfig)&quot; -Source $(LocalPackagesSources) -NoCache -Prerelease -OutputDirectory &quot;%(LocalPackages.InstallLocation)&quot;" />
Expand All @@ -120,6 +120,6 @@
<ItemGroup>
<NotOriginalPackages Include="The package was restored from $(LocalPackagesSources)" />
</ItemGroup>
<WriteLinesToFile File="%(LocalPackages.InstallLocation)\%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)\MODIFIED.txt" Lines="@(NotOriginalPackages)" Overwrite="true" />
<WriteLinesToFile File="%(LocalPackages.InstallLocation)/%(LocalPackages.PackageName).%(LocalPackages.PackageVersion)/MODIFIED.txt" Lines="@(NotOriginalPackages)" Overwrite="true" />
</Target>
</Project>
Loading

0 comments on commit ca64e7c

Please sign in to comment.