Bootstrap by default in prep script (#15378)

This commit is contained in:
Matt Thalman 2023-02-01 07:24:03 -06:00 committed by GitHub
parent e5062aef44
commit 31a14bea38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 43 deletions

View file

@ -5,14 +5,10 @@ IFS=$'\n\t'
SCRIPT_ROOT="$(cd -P "$( dirname "$0" )" && pwd)"
usage() {
echo "usage: $0 [options]"
echo "usage: $0"
echo ""
echo " Prepares the environment to be built by downloading Private.SourceBuilt.Artifacts.*.tar.gz and"
echo " installing the version of dotnet referenced in global.json"
echo "options:"
echo " --bootstrap Build a bootstrap version of previously source-built packages archive."
echo " This modifies the downloaded version, replacing portable packages"
echo " with official ms-built packages restored from package feeds."
echo ""
}
@ -28,9 +24,6 @@ while :; do
usage
exit 0
;;
--bootstrap)
buildBootstrap=true
;;
*)
positional_args+=("$1")
;;
@ -95,23 +88,7 @@ function DownloadArchive {
fi
}
# Read the eng/Versions.props to get the archives to download and download them
if [ "$downloadArtifacts" == "true" ]; then
DownloadArchive "Artifacts" $artifactsBaseFileName "true"
fi
if [ "$downloadPrebuilts" == "true" ]; then
DownloadArchive "Prebuilts" $prebuiltsBaseFileName "false"
fi
# Check for the version of dotnet to install
if [ "$installDotnet" == "true" ]; then
echo " Installing dotnet..."
(source ./eng/common/tools.sh && InitializeDotNetCli true)
fi
# Build bootstrap, if specified
if [ "$buildBootstrap" == "true" ]; then
function BootstrapArtifacts {
DOTNET_SDK_PATH="$SCRIPT_ROOT/.dotnet"
# Create working directory for running bootstrap project
@ -136,4 +113,20 @@ if [ "$buildBootstrap" == "true" ]; then
# Remove working directory
rm -rf $workingDir
}
# Check for the version of dotnet to install
if [ "$installDotnet" == "true" ]; then
echo " Installing dotnet..."
(source ./eng/common/tools.sh && InitializeDotNetCli true)
fi
# Read the eng/Versions.props to get the archives to download and download them
if [ "$downloadArtifacts" == "true" ]; then
DownloadArchive "Artifacts" $artifactsBaseFileName "true"
BootstrapArtifacts
fi
if [ "$downloadPrebuilts" == "true" ]; then
DownloadArchive "Prebuilts" $prebuiltsBaseFileName "false"
fi