Skip to content

Commit

Permalink
Use new feed tasks package & auto-update version
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgodbe committed Oct 24, 2017
1 parent 15e1472 commit b813321
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
11 changes: 11 additions & 0 deletions dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
<VCRuntimeVersion>1.2.0</VCRuntimeVersion>
</PropertyGroup>

<!-- Package versions used as toolsets -->
<PropertyGroup>
<FeedTasksPackage>Microsoft.DotNet.Build.Tasks.Feed</FeedTasksPackage>
<FeedTasksPackageVersion>1.0.0-prerelease-02121-01</FeedTasksPackageVersion>
</PropertyGroup>

<!-- Package dependency verification/auto-upgrade configuration. -->
<PropertyGroup>
<BaseDotNetBuildInfo>build-info/dotnet/</BaseDotNetBuildInfo>
Expand Down Expand Up @@ -85,6 +91,11 @@
<Path>$(MSBuildThisFileDirectory)BuildToolsVersion.txt</Path>
<PackageId>Microsoft.DotNet.BuildTools</PackageId>
</UpdateStep>
<XmlUpdateStep Include="BuildTools">
<Path>$(MSBuildThisFileFullPath)</Path>
<ElementName>FeedTasksPackageVersion</ElementName>
<PackageId>$(FeedTasksPackage)</PackageId>
</XmlUpdateStep>
<XmlUpdateStep Include="PgoData">
<Path>$(MSBuildThisFileFullPath)</Path>
<ElementName>PgoDataPackageVersion</ElementName>
Expand Down
4 changes: 2 additions & 2 deletions init-tools.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ if NOT exist "%DOTNET_LOCAL_PATH%" (

if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%"
call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% >> "%INIT_TOOLS_LOG%"
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
echo ERROR: Could not restore build tools correctly. 1>&2
goto :error
Expand Down
15 changes: 2 additions & 13 deletions init-tools.msbuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
<EnableDefaultItems>false</EnableDefaultItems>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<BaseIntermediateOutputPath>$(ToolsDir)/$(BuildToolsPackageVersion)</BaseIntermediateOutputPath>
<FeedTasksVersion>1.0.0-prerelease-02111-01</FeedTasksVersion>
<FeedTasksPackage>microsoft.dotnet.build.tasks.feed</FeedTasksPackage>
<PackageTargetFallback>$(PackageTargetFallback);netframework</PackageTargetFallback>
</PropertyGroup>
<Import Project="dependencies.props" />
<ItemGroup>
<PackageReference Include="microsoft.dotnet.buildtools">
<Version>$(BuildToolsPackageVersion)</Version>
Expand All @@ -16,17 +15,7 @@
<Version>1.0.4-prerelease</Version>
</PackageReference>
<PackageReference Include="$(FeedTasksPackage)">
<Version>$(FeedTasksVersion)</Version>
<Version>$(FeedTasksPackageVersion)</Version>
</PackageReference>
</ItemGroup>

<Target Name="CopyFeedTasks" AfterTargets="Restore" >
<ItemGroup>
<FilesToCopy Include="$(MSBuildThisFileDirectory)\packages\$(FeedTasksPackage)\$(FeedTasksVersion)\lib\**\*.*"/>
</ItemGroup>

<Copy SourceFiles="@(FilesToCopy)"
DestinationFiles="@(FilesToCopy->'$(ToolsDir)\$(FeedTasksPackage)\%(RecursiveDir)%(Filename)%(Extension)')"
/>
</Target>
</Project>
4 changes: 2 additions & 2 deletions init-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
else
if [ ! -e $__BUILD_TOOLS_PATH ]; then
echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..."
echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION /p:ToolsDir=$__TOOLRUNTIME_DIR" >> $__init_tools_log
$__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION /p:ToolsDir=$__TOOLRUNTIME_DIR >> $__init_tools_log
echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log
$__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log
if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then
echo "ERROR: Could not restore build tools correctly." 1>&2
display_error_message
Expand Down
7 changes: 1 addition & 6 deletions src/publish.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />

<PropertyGroup>
<FeedsDir Condition="'$(RunningOnCore)' != 'true'">$(ToolsDir)Microsoft.Dotnet.Build.Tasks.Feed/net46/</FeedsDir>
<FeedsDir Condition="'$(RunningOnCore)' == 'true'">$(ToolsDir)microsoft.dotnet.build.tasks.feed/netstandard1.5/</FeedsDir>
</PropertyGroup>

<UsingTask TaskName="PushToBlobFeed" AssemblyFile="$(FeedsDir)Microsoft.DotNet.Build.Tasks.Feed.dll"/>
<Import Project="$(PackagesDir)/$(FeedTasksPackage.ToLower())/$(FeedTasksPackageVersion)/build/$(FeedTasksPackage).targets" />

<PropertyGroup>
<PackagesPattern Condition="'$(PackagesPattern)' == ''">$(PackagesBinDir)pkg\*.nupkg</PackagesPattern>
Expand Down

0 comments on commit b813321

Please sign in to comment.