This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
forked from dotnet/coreclr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dev workflow scripts for build pipeline
- Loading branch information
Showing
13 changed files
with
557 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.25-prerelease-00327-01 | ||
1.0.25-prerelease-00416-04 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@if "%_echo%" neq "on" echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
set "__ProjectDir=%~dp0" | ||
set packagesLog=build-packages.log | ||
set binclashLoggerDll=%~dp0Tools\net45\Microsoft.DotNet.Build.Tasks.dll | ||
set binclashlog=%~dp0binclash.log | ||
echo Running build-packages.cmd %* > %packagesLog% | ||
|
||
set options=/nologo /maxcpucount /v:minimal /clp:Summary /nodeReuse:false /flp:v=detailed;Append;LogFile=%packagesLog% /l:BinClashLogger,%binclashLoggerDll%;LogFile=%binclashlog% /p:FilterToOSGroup=Windows_NT | ||
set allargs=%* | ||
|
||
if /I [%1] == [/?] goto Usage | ||
if /I [%1] == [/help] goto Usage | ||
|
||
REM ensure that msbuild is available | ||
echo Running init-tools.cmd | ||
call %~dp0init-tools.cmd | ||
|
||
set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.Runtime.CoreClr\Microsoft.NETCore.Runtime.CoreCLR.builds" !allargs! | ||
echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog% | ||
call msbuild.exe %__msbuildArgs% !options! | ||
if NOT [!ERRORLEVEL!]==[0] ( | ||
echo ERROR: An error occurred while building packages, see %packagesLog% for more details. | ||
exit /b 1 | ||
) | ||
|
||
set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.Jit\Microsoft.NETCore.Jit.builds" !allargs! | ||
echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog% | ||
call msbuild.exe %__msbuildArgs% !options! | ||
if NOT [!ERRORLEVEL!]==[0] ( | ||
echo ERROR: An error occurred while building packages, see %packagesLog% for more details. | ||
exit /b 1 | ||
) | ||
|
||
|
||
echo Done Building Packages. | ||
exit /b | ||
|
||
:Usage | ||
echo. | ||
echo Builds the NuGet packages from the binaries that were built in the Build product binaries step. | ||
echo The following properties are required to define build architecture | ||
echo /p:__BuildArch=[architecture] /p:__BuildType=[configuration] | ||
echo Architecture can be x64, x86, arm, or arm64 | ||
echo Configuration can be Release, Debug, or Checked | ||
exit /b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() | ||
{ | ||
echo "Builds the NuGet packages from the binaries that were built in the Build product binaries step." | ||
echo "Usage: build-packages [arch] [configuration]" | ||
echo "arch can be x64, x86, arm, arm64 (default is x64)" | ||
echo "configuration can be release, checked, debug (default is debug)" | ||
echo | ||
exit 1 | ||
} | ||
|
||
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
build_packages_log=$__ProjectRoot/build-packages.log | ||
binclashlog=$__ProjectRoot/binclash.log | ||
binclashloggerdll=$__ProjectRoot/Tools/Microsoft.DotNet.Build.Tasks.dll | ||
RuntimeOS=ubuntu.$VERSION_ID | ||
|
||
__MSBuildPath=$__ProjectRoot/Tools/MSBuild.exe | ||
|
||
# Parse arguments | ||
__BuildArch=x64 | ||
__BuildType=Debug | ||
|
||
allargs="$@" | ||
|
||
echo -e "Running build-packages.sh $allargs" > $build_packages_log | ||
|
||
if [ "$allargs" == "-h" ] || [ "$allargs" == "--help" ]; then | ||
usage | ||
fi | ||
|
||
while :; do | ||
if [ $# -le 0 ]; then | ||
break | ||
fi | ||
|
||
lowerI="$(echo $1 | awk '{print tolower($0)}')" | ||
case $lowerI in | ||
-\?|-h|--help) | ||
usage | ||
exit 1 | ||
;; | ||
|
||
x86) | ||
__BuildArch=x86 | ||
;; | ||
|
||
x64) | ||
__BuildArch=x64 | ||
;; | ||
|
||
arm) | ||
__BuildArch=arm | ||
;; | ||
|
||
arm64) | ||
__BuildArch=arm64 | ||
;; | ||
debug) | ||
__BuildType=Debug | ||
;; | ||
release) | ||
__BuildType=Release | ||
;; | ||
checked) | ||
__BuildType=Checked | ||
esac | ||
shift | ||
done | ||
|
||
# Use uname to determine what the OS is. | ||
OSName=$(uname -s) | ||
case $OSName in | ||
Linux) | ||
__BuildOS=Linux | ||
;; | ||
|
||
Darwin) | ||
__BuildOS=OSX | ||
;; | ||
|
||
FreeBSD) | ||
__BuildOS=FreeBSD | ||
;; | ||
|
||
OpenBSD) | ||
__BuildOS=OpenBSD | ||
;; | ||
|
||
NetBSD) | ||
__BuildOS=NetBSD | ||
;; | ||
|
||
SunOS) | ||
__BuildOS=SunOS | ||
;; | ||
|
||
*) | ||
echo "Unsupported OS $OSName detected, configuring as if for Linux" | ||
__BuildOS=Linux | ||
;; | ||
esac | ||
|
||
if [ "$__BuildOS" == "Linux" ]; then | ||
# Detect Distro | ||
if [ "$(cat /etc/*-release | grep -cim1 ubuntu)" -eq 1 ]; then | ||
export __DistroName=ubuntu | ||
elif [ "$(cat /etc/*-release | grep -cim1 centos)" -eq 1 ]; then | ||
export __DistroName=rhel | ||
elif [ "$(cat /etc/*-release | grep -cim1 rhel)" -eq 1 ]; then | ||
export __DistroName=rhel | ||
elif [ "$(cat /etc/*-release | grep -cim1 debian)" -eq 1 ]; then | ||
export __DistroName=debian | ||
else | ||
export __DistroName="" | ||
fi | ||
fi | ||
|
||
__IntermediatesDir="$__ProjectRoot/bin/obj/$__BuildOS.$__BuildArch.$__BuildType" | ||
|
||
# Ensure that MSBuild is available | ||
echo "Running init-tools.sh" | ||
$__ProjectRoot/init-tools.sh | ||
|
||
echo "Generating nuget packages for "$__BuildOS | ||
|
||
# Invoke MSBuild | ||
$__ProjectRoot/Tools/corerun "$__MSBuildPath" /nologo "$__ProjectRoot/src/.nuget/Microsoft.NETCore.Runtime.CoreCLR/Microsoft.NETCore.Runtime.CoreCLR.builds" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$binclashlog" /t:Build /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__IntermediatesDir=$__IntermediatesDir /p:BuildNugetPackage=false /p:UseSharedCompilation=false | ||
|
||
if [ $? -ne 0 ]; then | ||
echo -e "\nAn error occurred. Aborting build-packages.sh ." >> $build_packages_log | ||
echo "ERROR: An error occurred while building packages, see $build_packages_log for more details." | ||
exit 1 | ||
fi | ||
|
||
# Build the JIT packages | ||
$__ProjectRoot/Tools/corerun "$__MSBuildPath" /nologo "$__ProjectRoot/src/.nuget/Microsoft.NETCore.Jit/Microsoft.NETCore.Jit.builds" /verbosity:minimal "/fileloggerparameters:Verbosity=normal;LogFile=$binclashlog" /t:Build /p:__BuildOS=$__BuildOS /p:__BuildArch=$__BuildArch /p:__BuildType=$__BuildType /p:__IntermediatesDir=$__IntermediatesDir /p:BuildNugetPackage=false /p:UseSharedCompilation=false | ||
|
||
if [ $? -ne 0 ]; then | ||
echo -e "\nAn error occurred. Aborting build-packages.sh ." >> $build_packages_log | ||
echo "ERROR: An error occurred while building packages, see $build_packages_log for more details." | ||
exit 1 | ||
fi | ||
|
||
echo "Done building packages." | ||
echo -e "\nDone building packages." >> $build_packages_log | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@if not defined __echo @echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
echo Running clean.cmd | ||
|
||
if /I [%1] == [/?] goto Usage | ||
if /I [%1] == [/help] goto Usage | ||
|
||
:: Set __ProjectDir to be the directory of this script | ||
set "__ProjectDir=%~dp0" | ||
:: remove trailing slash | ||
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%" | ||
set "__RootBinDir=%__ProjectDir%\bin" | ||
|
||
if exist "%__RootBinDir%" rd /s /q "%__RootBinDir%" | ||
if exist "%__ProjectDir%\Tools" rd /s /q "%__ProjectDir%\Tools" | ||
|
||
exit /b 0 | ||
|
||
:Usage | ||
echo. | ||
echo Repository cleaning script. | ||
echo No option parameters. | ||
exit /b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Obtain the location of the bash script to figure out where the root of the repo is. | ||
__ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
echo Cleaning previous output for the selected configuration | ||
|
||
rm -rf "$__ProjectRoot/bin" | ||
|
||
rm -rf "$__ProjectRoot/Tools" | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@if "%_echo%" neq "on" echo off | ||
setlocal EnableDelayedExpansion | ||
|
||
set packagesLog=publish-packages.log | ||
echo Running publish-packages.cmd %* > %packagesLog% | ||
|
||
set options=/nologo /v:minimal /flp:v=detailed;Append;LogFile=%packagesLog% | ||
set allargs=%* | ||
|
||
if /I [%1] == [/?] goto Usage | ||
if /I [%1] == [/help] goto Usage | ||
|
||
REM ensure that msbuild is available | ||
echo Running init-tools.cmd | ||
call %~dp0init-tools.cmd | ||
|
||
echo msbuild.exe %~dp0src\publish.proj !options! !allargs! >> %packagesLog% | ||
call msbuild.exe %~dp0src\publish.proj !options! !allargs! | ||
if NOT [%ERRORLEVEL%]==[0] ( | ||
echo ERROR: An error occurred while publishing packages, see %packagesLog% for more details. | ||
exit /b 1 | ||
) | ||
|
||
echo Done publishing packages. | ||
exit /b | ||
|
||
:Usage | ||
echo. | ||
echo Publishes the NuGet packages to the specified location. | ||
echo For publishing to Azure the following properties are required. | ||
echo /p:CloudDropAccountName="account name" | ||
echo /p:CloudDropAccessToken="access token" | ||
echo /p:__BuildType="Configuration Group" | ||
echo /p:__BuildArch="Architecture" | ||
exit /b |
Oops, something went wrong.