diff options
author | Jarret Shook <jashoo@microsoft.com> | 2019-06-10 14:13:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 14:13:27 -0700 |
commit | 730c3c5c66183418adbbc63acd40d261c9ce23ed (patch) | |
tree | 6e8d98a0fffaefca0c46e9667afeeb1dc051b4dc | |
parent | 64855db283bf84e8d47cfd6d5cde4248df3e0f50 (diff) | |
download | coreclr-730c3c5c66183418adbbc63acd40d261c9ce23ed.tar.gz coreclr-730c3c5c66183418adbbc63acd40d261c9ce23ed.tar.bz2 coreclr-730c3c5c66183418adbbc63acd40d261c9ce23ed.zip |
Add source-build hook for dotnet install (#24929)
* Add source-build hook for dotnet install
* Fix batch syntax
* Address feedback
* Use the correct returned variables:
unix: _InitializeDotNetCli
windows: DOTNET_TOOL_DIR
* Remove changes to dotnet.cmd
* Do not export, just use _InitializeDotNetCli
-rwxr-xr-x | build.sh | 13 | ||||
-rwxr-xr-x | dotnet.sh | 2 | ||||
-rw-r--r-- | init-dotnet.sh | 2 |
3 files changed, 7 insertions, 10 deletions
@@ -150,14 +150,11 @@ restore_optdata() if [ $__isMSBuildOnNETCoreSupported == 1 ]; then # Parse the optdata package versions out of msbuild so that we can pass them on to CMake - local DotNetCli="$__ProjectRoot/.dotnet/dotnet" - if [ ! -f $DotNetCli ]; then - source "$__ProjectRoot/init-dotnet.sh" - if [ $? != 0 ]; then - echo "Failed to install dotnet." - exit 1 - fi - fi + + # Init dotnet + source "${__ProjectRoot}/init-dotnet.sh" + local DotNetCli=${_InitializeDotNetCli}/dotnet + __PgoOptDataVersion=$(DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 $DotNetCli msbuild $OptDataProjectFilePath /t:DumpPgoDataPackageVersion /nologo) if [ $? != 0 ]; then echo "Failed to get PGO data package version." @@ -11,7 +11,7 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 echo "Running init-dotnet.sh" source $working_tree_root/init-dotnet.sh -dotnet=$working_tree_root/.dotnet/dotnet +dotnet=${_InitializeDotNetCli}/dotnet echo "Running: $dotnet $@" $dotnet "$@" diff --git a/init-dotnet.sh b/init-dotnet.sh index f7ac32bad7..b446260af5 100644 --- a/init-dotnet.sh +++ b/init-dotnet.sh @@ -12,4 +12,4 @@ InitializeBuildTool if [ $? != 0 ]; then echo "Failed to install dotnet using Arcade" exit $? -fi +fi
\ No newline at end of file |