Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgor Bogatov <egorbo@gmail.com>2019-06-05 12:52:01 +0300
committerMarek Safar <marek.safar@gmail.com>2019-06-05 12:52:00 +0300
commitd3101fbaeb7e5a0f29418876588856b132cabff3 (patch)
treebaa676482f19d0c59601ff9771997f64b04b3625 /netcore/build.sh
parent9e5c2c1e52816fadb75d908b87b9fc75ebfcb678 (diff)
[netcore] Download and use local .NET Core SDK (#14696)
* Download and use local .NET Core SDK * depend on 'all' rule in nupkg * fix build error * Windows support * use InitializeToolset function * ouput full path of dotnet in init-tools.sh * remove init-tools * Add init-tools.ps1 (Windows) * fix / issue on cygwin * address Jo's feedback * add powershell to PATH for make nupkg * add netcore/build.sh * handle pack and test commands * Update tools.ps1 * Update tools.ps1
Diffstat (limited to 'netcore/build.sh')
-rwxr-xr-xnetcore/build.sh84
1 files changed, 84 insertions, 0 deletions
diff --git a/netcore/build.sh b/netcore/build.sh
new file mode 100755
index 00000000000..6b3ea801d5f
--- /dev/null
+++ b/netcore/build.sh
@@ -0,0 +1,84 @@
+#!/usr/bin/env bash
+
+usage()
+{
+ echo "Common settings:"
+ echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
+ echo " --help Print help and exit (short: -h)"
+ echo ""
+
+ echo "Actions:"
+ echo " --pack Package build outputs into NuGet packages"
+ echo " --test Run all unit tests in the solution (short: -t)"
+ echo ""
+
+ echo "Command line arguments starting with '/p:' are passed through to MSBuild."
+ echo "Arguments can also be passed in with a single hyphen."
+}
+
+pack=false
+configuration='Debug'
+properties=''
+
+while [[ $# > 0 ]]; do
+ opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
+ case "$opt" in
+ -help|-h)
+ usage
+ exit 0
+ ;;
+ -configuration|-c)
+ properties="$properties $1 $2"
+ configuration=$2
+ shift
+ ;;
+ -pack)
+ pack=true
+ ;;
+ -test|-t)
+ test=true
+ ;;
+ -p:*|/p:*)
+ properties="$properties $1"
+ ;;
+ -m:*|/m:*)
+ properties="$properties $1"
+ ;;
+ -bl:*|/bl:*)
+ properties="$properties $1"
+ ;;
+ -dl:*|/dl:*)
+ properties="$properties $1"
+ ;;
+ *)
+ echo "Invalid argument: $1"
+ usage
+ exit 1
+ ;;
+ esac
+
+ shift
+done
+
+
+cd ..
+./autogen.sh --with-core=only
+cd netcore
+
+CPU_COUNT=$(getconf _NPROCESSORS_ONLN || echo 4)
+
+# build mono runtime
+make runtime -j$(CPU_COUNT)
+
+# build System.Private.CoreLib (../mcs/class/System.Private.CoreLib)
+make bcl CORLIB_BUILD_FLAGS="$properties"
+
+# create a nupkg with runtime and System.Private.CoreLib
+if [ "$pack" = "true" ]; then
+ make nupkg
+fi
+
+# run all xunit tests
+if [ "$test" = "true" ]; then
+ make xtestall
+fi \ No newline at end of file