diff options
author | Eric Mellino <erme@microsoft.com> | 2017-04-11 03:03:14 +0300 |
---|---|---|
committer | Eric Mellino <erme@microsoft.com> | 2017-04-25 03:32:28 +0300 |
commit | 77cbe83794aa1a7853b48e9ee5e3930697d9807c (patch) | |
tree | e9b4ac5c1347e705ab8d74718bc4b2f6e225ff6e /init-tools.sh | |
parent | 93fa7c4b26bb64f221755097a39d4392935d1a15 (diff) |
Create an init-tools.msbuild project file.
This file is used in init-tools.cmd/sh, and replaces the "generated"
project file used previously. Because we are using MSBuild projects for
nuget restore now, we are able to "parameterize" the version of
Microsoft.DotNet.BuildTools based on an MSBuild property which is passed
in to the "dotnet restore" command in init-tools.
Diffstat (limited to 'init-tools.sh')
-rwxr-xr-x | init-tools.sh | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/init-tools.sh b/init-tools.sh index 70b73eda5a..e66c957412 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -11,10 +11,8 @@ export __BUILDTOOLS_USE_CSPROJ=true __BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/BuildToolsVersion.txt) __DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt) __BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib -__PROJECT_JSON_PATH=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION -__PROJECT_JSON_FILE=$__PROJECT_JSON_PATH/project.json -__PROJECT_JSON_CONTENTS="<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><TargetFramework>netcoreapp1.0</TargetFramework><DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences></PropertyGroup><ItemGroup><PackageReference Include=\"Microsoft.DotNet.BuildTools\" Version=\"$__BUILD_TOOLS_PACKAGE_VERSION\" /></ItemGroup></Project>" -__INIT_TOOLS_DONE_MARKER=$__PROJECT_JSON_PATH/done +__INIT_TOOLS_RESTORE_PROJECT=$__scriptpath/init-tools.msbuild +__INIT_TOOLS_DONE_MARKER=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/done # Extended version of platform detection logic from dotnet/cli/scripts/obtain/dotnet-install.sh 16692fc get_current_linux_name() { @@ -133,13 +131,10 @@ if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then echo "Copying $BUILD_TOOLS_TOOL_DIR to $__TOOLRUNTIME_DIR" >> $__init_tools_log cp -r $BUILD_TOOLS_TOOL_DIR/* $__TOOLRUNTIME_DIR else - if [ ! -d "$__PROJECT_JSON_PATH" ]; then mkdir "$__PROJECT_JSON_PATH"; fi - echo $__PROJECT_JSON_CONTENTS > "$__PROJECT_JSON_FILE" - if [ ! -e $__BUILD_TOOLS_PATH ]; then echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..." - echo "Running: $__DOTNET_CMD restore \"$__PROJECT_JSON_FILE\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE" >> $__init_tools_log - $__DOTNET_CMD restore "$__PROJECT_JSON_FILE" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE >> $__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. See '$__init_tools_log' for more details."1>&2; fi fi |