Skip to content

Commit

Permalink
Take most recent build tool version and script updates
Browse files Browse the repository at this point in the history
  • Loading branch information
roncain committed Jan 14, 2016
1 parent 77bd316 commit 46bc083
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 62 deletions.
2 changes: 1 addition & 1 deletion BuildToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.25-prerelease-00145
1.0.25-prerelease-00148
1 change: 0 additions & 1 deletion build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

<Target Name="BatchRestorePackages">
<Message Importance="High" Text="Restoring all packages..." />
<Message Importance="High" Text="Restoring using command '$(DnuRestoreCommand)' " />
<!-- restore all project.jsons in one pass for perf & to avoid concurrency problems with dnu -->
<!-- include ToolsDir to restore test-runtime\project.json as well -->
<Exec Command="$(DnuRestoreCommand) &quot;%(DnuRestoreDir.Identity)&quot;" StandardOutputImportance="Low" CustomErrorRegularExpression="(^Unable to locate .*)|(^Updating the invalid lock file with .*)" ContinueOnError="WarnAndContinue" />
Expand Down
1 change: 0 additions & 1 deletion dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@

<!-- Common nuget properties -->
<PropertyGroup>
<!-- <NuGetToolPath Condition="'$(NuGetToolPath)'==''">$(PackagesDir)NuGet.exe</NuGetToolPath> -->
<NuGetToolPath Condition="'$(NuGetToolPath)'==''">$(ToolsDir)\NuProj\NuGet.exe</NuGetToolPath>
<NuGetPackageSource>@(NuGetSourceList -> '-source %(Identity)', ' ')</NuGetPackageSource>
<NuGetConfigCommandLine>$(NuGetPackageSource)</NuGetConfigCommandLine>
Expand Down
57 changes: 0 additions & 57 deletions dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,6 @@

<Import Project="$(ToolsDir)/Build.Common.targets" />


<!--
Use a semaphore file to determine the need to restore build tools to avoid conflicts with locked binaries.
-->
<PropertyGroup>
<BuildToolsSemaphore>$(ToolsDir)BuildTools.semaphore</BuildToolsSemaphore>
</PropertyGroup>

<!--
Needed to avoid the IntialTargets from having an Output which ends up getting
added to the output references when you have a project to project reference.
-->
<Target Name="_RestoreBuildToolsWrapper" DependsOnTargets="_RestoreBuildTools" Condition="'$(RestorePackages)' != 'false'" />

<Target Name="_RestoreBuildTools"
Inputs="$(MSBuildThisFileDirectory)dir.props;$(SourceDir).nuget/packages.$(OsEnvironment).config"
Outputs="$(BuildToolsSemaphore)">
<Message Importance="High" Text="Restoring build tools..." />

<Copy Condition="Exists('$(NuGetCachedPath)')" SourceFiles="$(NuGetCachedPath)" DestinationFiles="$(NuGetToolPath)" SkipUnchangedFiles="true" />

<!-- Download latest nuget.exe -->
<DownloadFile FileName="$(NuGetToolPath)"
Address="https://www.nuget.org/nuget.exe"
Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Windows_NT'" />

<Exec Command="curl -sSL --create-dirs -o $(NuGetToolPath) https://api.nuget.org/downloads/nuget.exe"
Condition="!Exists('$(NuGetToolPath)') and '$(OsEnvironment)'=='Unix'" />

<PropertyGroup>
<_RestoreBuildToolsCommand>$(NugetRestoreCommand) "$(SourceDir).nuget/packages.$(OsEnvironment).config"</_RestoreBuildToolsCommand>
</PropertyGroup>

<!-- Restore build tools -->
<Exec Command="$(_RestoreBuildToolsCommand)" StandardOutputImportance="Low" />

<!-- Add DNU and Roslyn tool execute rights -->
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnu&quot;" />
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="chmod a+x &quot;$(DnxPackageDir)/bin/dnx&quot;" />
<Exec Condition="'$(OsEnvironment)'=='Unix'"
Command="find '$(RoslynPackageDir)tools' -name &quot;*.exe&quot; -exec chmod &quot;+x&quot; '{}' ';'" />

<!--
Touch our semaphore file to ensure Inputs/Outputs comparison for this target will show that we're up to date.
Ignore failures in the unlikely, but possible, event that we hit this from two projects simultaneously.
-->
<Touch Files="$(BuildToolsSemaphore)"
ContinueOnError="WarnAndContinue"
AlwaysCreate="true"
ForceTouch="true" />

<Error Condition="'$(ErrorIfBuildToolsRestoredFromIndividualProject)'=='true'"
Text="The build tools package was just restored and so we cannot continue the build of an individual project because targets from the build tools package were not able to be imported. Please retry the build the individual project again." />
</Target>

<!-- Copy the test-runtime project.json and change it to use floating (*) CoreFX dependencies for testing against the latest packages. -->
<Target Name="GenerateFloatingTestRuntimeProjectJson"
Inputs="$(TestFixedRuntimeProjectJson)"
Expand Down
25 changes: 23 additions & 2 deletions init-tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

__scriptpath=$(cd "$(dirname "$0")"; pwd -P)
__PACKAGES_DIR=$__scriptpath/packages
__TOOLRUNTIME_DIR=$__scriptpath/Tools
Expand All @@ -10,12 +12,31 @@ __PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION
__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json
__PROJECT_JSON_CONTENTS="{ \"dependencies\": { \"Microsoft.DotNet.BuildTools\": \"$__BUILD_TOOLS_PACKAGE_VERSION\" }, \"frameworks\": { \"dnxcore50\": { } } }"

OSName=$(uname -s)
case $OSName in
Darwin)
OS=OSX
__DOTNET_PKG=dotnet-osx-x64
;;

Linux)
OS=Linux
__DOTNET_PKG=dotnet-ubuntu-x64
;;

*)
echo "Unsupported OS $OSName detected. Downloading ubuntu-x64 tools"
OS=Linux
__DOTNET_PKG=dotnet-ubuntu-x64
;;
esac

if [ ! -e $__PROJECT_JSON_FILE ]; then
if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi

if [ ! -e $__DOTNET_PATH ]; then
mkdir "$__DOTNET_PATH" -p
wget -q -O $__DOTNET_PATH/dotnet.tar https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/dotnet-ubuntu-x64.latest.tar.gz
mkdir -p "$__DOTNET_PATH"
wget -q -O $__DOTNET_PATH/dotnet.tar https://dotnetcli.blob.core.windows.net/dotnet/dev/Binaries/Latest/${__DOTNET_PKG}.latest.tar.gz
cd $__DOTNET_PATH
tar -xvf $__DOTNET_PATH/dotnet.tar
cd $__scriptpath
Expand Down

0 comments on commit 46bc083

Please sign in to comment.