diff --git a/build.sh b/build.sh index 39b03271c71bdf6b1170174e010a6cac2273d1bc..d290e2364ae0615208b0dd35e6d7f0303b01c49c 100755 --- a/build.sh +++ b/build.sh @@ -15,6 +15,8 @@ usage() echo " --release Build Release" echo " --restore Restore projects required to build" echo " --build Build all projects" + echo " --pack Build prerelease nuget packages" + echo " --packall Build all nuget packages" echo " --test Run unit tests" echo " --mono Run unit tests with mono" echo " --build-bootstrap Build the bootstrap compilers" @@ -32,6 +34,8 @@ build_configuration=Debug restore=false build=false test_=false +pack=false +pack_all=false use_mono=false build_bootstrap=false use_bootstrap=false @@ -93,6 +97,13 @@ do --stop-vbcscompiler) stop_vbcscompiler=true ;; + --pack) + pack=true + ;; + --packall) + pack_all=true + pack=true + ;; *) echo "$1" usage @@ -109,6 +120,32 @@ mkdir -p ${binaries_path} mkdir -p ${config_path} mkdir -p ${logs_path} +function pack_all_kind() { + pushd "${root_path}/src/NuGet" + + echo Packing $1 + + local nupkg_path="${config_path}/NuGet/PreRelease" + local nuspec_files=("Microsoft.CodeAnalysis.CSharp.nuspec" "Microsoft.CodeAnalysis.Compilers.nuspec" "Microsoft.CodeAnalysis.VisualBasic.nuspec" "Microsoft.CodeAnalysis.Common.nuspec" "Microsoft.NETCore.Compilers.nuspec") + mkdir -p ${nupkg_path} + for i in "${nuspec_files[@]}" + do + dotnet pack -nologo --no-build NuGetProjectPackUtil.csproj -p:NuSpecFile=$i -p:NuGetPackageKind=$1 -p:NuspecBasePath=${binaries_path}/Debug -o ${nupkg_path} + done + + popd +} + +function pack_all() { + pack_all_kind PreRelease + + if [[ "$pack_all" = true ]] + then + pack_all_kind Release + pack_all_kind PerBuildPreRelease + fi +} + if [[ "$build_in_docker" = true ]] then echo "Docker exec: $args" @@ -167,6 +204,11 @@ then dotnet build "${root_path}"/Compilers.sln ${build_args} "/bl:${binaries_path}/Build.binlog" fi +if [[ "${pack}" == true ]] +then + pack_all +fi + if [[ "${stop_vbcscompiler}" == true ]] then if [[ "${use_bootstrap}" == true ]] diff --git a/build/scripts/cibuild.sh b/build/scripts/cibuild.sh index 803e32a09f67781556b85e9dde26729041d942f6..1d028504b48416342969e38711a6afa505f0310a 100755 --- a/build/scripts/cibuild.sh +++ b/build/scripts/cibuild.sh @@ -24,4 +24,4 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 echo "Building this commit:" git show --no-patch --pretty=raw HEAD -"${root_path}"/build.sh --restore --bootstrap --build --stop-vbcscompiler --test "$@" +"${root_path}"/build.sh --restore --bootstrap --build --packall --stop-vbcscompiler --test "$@"