Add build and package scripts for Linux; rename build/package directories to builds/packages; refactor other scripts

This commit is contained in:
Charlie Poole 2011-03-11 20:07:59 -08:00
Родитель 5c2cc843ca
Коммит 4364598cc9
10 изменённых файлов: 272 добавлений и 32 удалений

Просмотреть файл

@ -17,10 +17,10 @@ solutions/*/NUnitCore/tests/*
solutions/*/NUnitFramework/tests/* solutions/*/NUnitFramework/tests/*
solutions/*/NUnitFramework/framework/* solutions/*/NUnitFramework/framework/*
solutions/*/tests/loadtest-assembly/* solutions/*/tests/loadtest-assembly/*
build builds
*.db *.db
*.VisualState.xml *.VisualState.xml
package packages
GeneratedAssemblyInfo.cs GeneratedAssemblyInfo.cs
debug debug
release release
@ -29,4 +29,4 @@ Release
*.pidb *.pidb
*.resources *.resources
*.userprefs *.userprefs
_ReSharper* _ReSharper*

126
build Executable file
Просмотреть файл

@ -0,0 +1,126 @@
#!/bin/sh
# build - Builds and tests NUnit
NANT="tools/nant-0.90/bin/NAnt.exe"
options="-f:scripts/nunit.build.targets"
config=""
runtime=""
clean=""
commands=""
passthru=false
for arg in $@
do
if [ $passthru = true ]
then
commands="$commands $arg"
continue
fi
case "$arg" in
debug|release)
config="$arg"
;;
mono-1.0|1.0)
runtime="mono-1.0"
;;
mono-2.0|2.0)
runtime="mono-2.0"
;;
mono-3.5|3.5)
runtime="mono-3.5"
;;
mono-4.0|4.0)
runtime="mono-4.0"
;;
clean)
clean="clean"
;;
clean-all)
clean="clean-all"
;;
samples|tools|all)
commands="$commands build-$arg"
;;
test|gui-test)
commands="$commands $arg"
;;
-h|--help)
echo "Builds and tests NUnit"
echo
echo "usage: BUILD [option [...] ]"
echo
echo "Options may be any of the following, in any order..."
echo
echo " debug Builds debug configuration (default)"
echo " release Builds release configuration"
echo
echo " mono-4.0, 4.0 Builds using Mono 4.0 profile (future)"
echo " mono-3.5, 3.5 Builds using Mono 3.5 profile (default)"
echo " mono-2.0, 2.0 Builds using Mono 2.0 profile"
echo " mono-1.0, 1.0 Builds using Mono 1.0 profile"
echo
echo " clean Cleans the output directory before building"
echo " clean-all Removes output directories for all runtimes"
echo
echo " samples Builds the NUnit samples"
echo " tools Builds the NUnit tools"
echo
echo " test Runs tests for a build using the console runner"
echo " gui-test Runs tests for a build using the NUnit gui"
echo
echo " -h, --help Displays this help message"
echo
echo "Notes:"
echo
echo " 1. The default Mono profile to be used is selected automatically"
echo " by the NAnt script based on the version of Mono installed"
echo
echo " 2. When building under the 3.5 or higher profile, the 2.0"
echo " runtime version is targeted for NUnit itself. Tests use"
echo " the specified higher level framework."
echo
exit;
;;
--)
passthru=true
;;
*)
echo "Invalid argument: $arg"
echo
echo "Use $0 -h for more info"
echo
exit;
;;
esac
done
if [ "$commands" = "" ]
then
commands="build"
fi
if [ "$config" != "" ]
then
options="$options -D:build.config=$config"
fi
if [ "$runtime" != "" ]
then
options="$options -D:runtime.config=$runtime"
fi
exec mono "$NANT" $options $clean $commands

Просмотреть файл

@ -10,7 +10,7 @@ set CONFIG=
set RUNTIME= set RUNTIME=
set CLEAN= set CLEAN=
set COMMANDS= set COMMANDS=
set FLAG= set PASSTHRU=
goto start goto start
:shift :shift
@ -20,7 +20,7 @@ shift /1
IF "%1" EQU "" goto execute IF "%1" EQU "" goto execute
IF "%FLAG%" NEQ "" set COMMANDS=%COMMANDS% %1&goto shift IF "%PASSTHRU%" EQU "TRUE" set COMMANDS=%COMMANDS% %1&goto shift
IF /I "%1" EQU "?" goto usage IF /I "%1" EQU "?" goto usage
IF /I "%1" EQU "/h" goto usage IF /I "%1" EQU "/h" goto usage
@ -44,12 +44,13 @@ IF /I "%1" EQU "mono-3.5" set RUNTIME=mono-3.5&goto shift
IF /I "%1" EQU "mono-4.0" set RUNTIME=mono-4.0&goto shift IF /I "%1" EQU "mono-4.0" set RUNTIME=mono-4.0&goto shift
if /I "%1" EQU "clean" set CLEAN=clean&goto shift if /I "%1" EQU "clean" set CLEAN=clean&goto shift
if /I "%1" EQU "clean-all" set CLEAN=clean-all&goto shift
IF /I "%1" EQU "samples" set COMMANDS=%COMMANDS% build-samples&goto shift IF /I "%1" EQU "samples" set COMMANDS=%COMMANDS% build-samples&goto shift
IF /I "%1" EQU "tools" set COMMANDS=%COMMANDS% build-tools&goto shift IF /I "%1" EQU "tools" set COMMANDS=%COMMANDS% build-tools&goto shift
IF /I "%1" EQU "test" set COMMANDS=%COMMANDS% test&goto shift IF /I "%1" EQU "test" set COMMANDS=%COMMANDS% test&goto shift
IF /I "%1" EQU "gui-test" set COMMANDS=%COMMANDS% gui-test&goto shift IF /I "%1" EQU "gui-test" set COMMANDS=%COMMANDS% gui-test&goto shift
IF "%1" EQU "--" set FLAG=1&goto shift IF "%1" EQU "--" set PASSTHRU=TRUE&goto shift
echo Invalid option: %1 echo Invalid option: %1
echo. echo.
@ -94,6 +95,7 @@ echo net Builds using default .NET version
echo mono Builds using default Mono profile echo mono Builds using default Mono profile
echo. echo.
echo clean Cleans the output directory before building echo clean Cleans the output directory before building
echo clean-all Removes output directories for all runtimes
echo. echo.
echo samples Builds the NUnit samples echo samples Builds the NUnit samples
echo tools Builds the NUnit tools echo tools Builds the NUnit tools

3
nant
Просмотреть файл

@ -1,2 +1,3 @@
#!/bin/sh #!/bin/sh
exec /usr/bin/cli ./tools/nant-0.90/bin/NAnt.exe "$@" exec mono tools/nant-0.90/bin/NAnt.exe $@

Просмотреть файл

@ -1,2 +1,2 @@
tools\nant-0.90\bin\nant.exe %* tools\nant-0.90\bin\nant.exe %*

110
package Executable file
Просмотреть файл

@ -0,0 +1,110 @@
#!/bin/sh
# PACKAGE - Packages NUnit
NANT="tools/nant-0.90/bin/NAnt.exe"
options="-f:scripts/nunit.package.targets"
config=""
runtime=""
commands=""
passthru=false
for arg in $@
do
if [ $passthru = true ]
then
commands="$commands $arg"
continue
fi
case "$arg" in
debug|release)
config="$arg"
;;
mono-1.0|1.0)
runtime="mono-1.0"
;;
mono-2.0|2.0)
runtime="mono-2.0"
;;
mono-3.5|3.5)
runtime="mono-3.5"
;;
mono-4.0|4.0)
runtime="mono-4.0"
;;
src|docs|zip|all)
commands="$commands package-$arg"
;;
source)
commands="$commands package-src"
;;
-h|--help)
echo "Builds one or more NUnit packages for distribution"
echo
echo "usage: PACKAGE [option [...] ] [ -- nantoptions ]"
echo
echo "Options may be any of the following, in any order..."
echo
echo " debug Builds debug packages (default)"
echo " release Builds release packages"
echo
echo " mono-4.0, 4.0 Builds package using Mono 4.0 profile (future)"
echo " mono-3.5, 3.5 Builds package using Mono 3.5 profile (default)"
echo " mono-2.0, 2.0 Builds package using Mono 2.0 profile"
echo " mono-1.0, 1.0 Builds package using Mono 1.0 profile"
echo
echo " src, source Builds the source package"
echo " docs Builds the documentation package"
echo " zip Builds a binary package in zipped form"
echo " all Builds source, documentation, 3.5 and 1.0 packages"
echo
echo " -h, --help Displays this help message"
echo
echo "In addition, any valid target in the NAnt script may"
echo "be supplied as an argument. This requires some degree"
echo "of familiarity with the script, in order to avoid"
echo "use of incompatible options."
echo
exit;
;;
--)
passthru=true;
;;
*)
echo "Invalid argument: $arg"
echo
echo "Use $0 -h for more info"
echo
exit;
;;
esac
done
if [ "$commands" = "" ]
then
commands="package"
fi
if [ "$config" != "" ]
then
options="$options -D:build.config=$config"
fi
if [ "$runtime" != "" ]
then
options="$options -D:runtime.config=$runtime"
fi
exec mono $NANT $options $clean $commands

Просмотреть файл

@ -9,7 +9,7 @@ set OPTIONS=-f:scripts/nunit.package.targets
set CONFIG= set CONFIG=
set RUNTIME= set RUNTIME=
set COMMANDS= set COMMANDS=
set FLAG= set PASSTHRU=
goto start goto start
:shift :shift
@ -19,7 +19,7 @@ shift /1
IF "%1" EQU "" goto execute IF "%1" EQU "" goto execute
IF "%FLAG%" NEQ "" set COMMANDS=%COMMANDS% %1&goto shift IF "%PASSTHRU%" NEQ "" set COMMANDS=%COMMANDS% %1&goto shift
IF /I "%1" EQU "?" goto usage IF /I "%1" EQU "?" goto usage
IF /I "%1" EQU "/h" goto usage IF /I "%1" EQU "/h" goto usage
@ -47,7 +47,7 @@ IF /I "%1" EQU "src" set COMMANDS=%COMMANDS% package-src&goto shift
IF /I "%1" EQU "zip" set COMMANDS=%COMMANDS% package-zip&goto shift IF /I "%1" EQU "zip" set COMMANDS=%COMMANDS% package-zip&goto shift
IF /I "%1" EQU "msi" set COMMANDS=%COMMANDS% package-msi&goto shift IF /I "%1" EQU "msi" set COMMANDS=%COMMANDS% package-msi&goto shift
IF "%1" EQU "--" set FLAG=1&goto shift IF "%1" EQU "--" set PASSTHRU=1&goto shift
echo Invalid option: %1 echo Invalid option: %1
echo. echo.
@ -76,7 +76,7 @@ echo.
echo Options may be any of the following, in any order... echo Options may be any of the following, in any order...
echo. echo.
echo debug Builds debug packages (default) echo debug Builds debug packages (default)
echo release Builds packages for release echo release Builds release packages
echo. echo.
echo net-4.0 Builds package using .NET 4.0 build (future) echo net-4.0 Builds package using .NET 4.0 build (future)
echo net-3.5 Builds package using .NET 3.5 build (default) echo net-3.5 Builds package using .NET 3.5 build (default)
@ -92,7 +92,7 @@ echo src, source Builds the source package
echo docs Builds the documentation package echo docs Builds the documentation package
echo zip Builds a binary package in zipped form echo zip Builds a binary package in zipped form
echo msi Builds a windows installer (msi) package echo msi Builds a windows installer (msi) package
echo all echo all Builds source, documentation, 3.5 and 1.1 packages
echo. echo.
echo ?, /h, /help Displays this help message echo ?, /h, /help Displays this help message
echo. echo.

Просмотреть файл

@ -39,10 +39,13 @@
The first .NET and Mono frameworks found are the The first .NET and Mono frameworks found are the
respective net and mono defaults. --> respective net and mono defaults. -->
<property name="supported.frameworks" <property name="supported.frameworks"
value="net-3.5,net-2.0,net-4.0,net-1.1,net-1.0,mono-2.0,mono-1.0"/> value="net-3.5,net-2.0,net-4.0,net-1.1,net-1.0,mono-3.5,mono-2.0,mono-1.0"/>
<!-- Packages we normally create --> <!-- Packages we normally create -->
<property name="standard.packages" value="net-3.5,net-1.1" /> <property name="standard.packages" value="net-3.5,net-1.1"
if="${platform::is-windows()}"/>
<property name="standard.packages" value="mono-3.5,mono-1.0"
unless="${platform::is-windows()}"/>
<!-- Our standard package for general distribution --> <!-- Our standard package for general distribution -->
<property name="default.package.config" value="net-3.5" /> <property name="default.package.config" value="net-3.5" />
@ -60,9 +63,9 @@
<!-- Other directories are derived from base dir --> <!-- Other directories are derived from base dir -->
<property name="project.build.dir" <property name="project.build.dir"
value="${path::combine(project.base.dir,'build')}"/> value="${path::combine(project.base.dir,'builds')}"/>
<property name="project.package.dir" <property name="project.package.dir"
value="${path::combine(project.base.dir,'package')}"/> value="${path::combine(project.base.dir,'packages')}"/>
<property name="project.src.dir" <property name="project.src.dir"
value="${path::combine(project.base.dir, 'src')}"/> value="${path::combine(project.base.dir, 'src')}"/>
<property name="project.doc.dir" <property name="project.doc.dir"
@ -100,7 +103,6 @@
<property name="package.install.dir" <property name="package.install.dir"
value="${path::combine(package.working.dir,'install')}"/> value="${path::combine(package.working.dir,'install')}"/>
<!-- Default build configuration -->
<property name="build.defines" value=""/> <property name="build.defines" value=""/>
<!-- sdk-exists causes an error if the framework is not installed! --> <!-- sdk-exists causes an error if the framework is not installed! -->
@ -202,17 +204,6 @@
</target> </target>
<!--
<target name="set-net-3.0-runtime-config">
<property name="runtime.platform" value="net"/>
<property name="runtime.version" value="3.0"/>
<property name="runtime.defines" value="MSNET,NET_3_0"/>
<property name="supported.test.platforms" value="net-2.0,mono-2.0"/>
</target>
-->
<target name="set-net-3.5-runtime-config"> <target name="set-net-3.5-runtime-config">
<property name="runtime.platform" value="net"/> <property name="runtime.platform" value="net"/>
@ -254,6 +245,16 @@
</target> </target>
<target name="set-mono-3.5-runtime-config">
<property name="runtime.platform" value="mono"/>
<property name="runtime.version" value="3.5"/>
<property name="target.version" value="2.0"/>
<property name="runtime.defines" value="MONO,NET_2_0,CS_3_0"/>
<property name="supported.test.platforms" value="mono-3.5,net-3.5,mono-2.0,net-2.0"/>
</target>
<!-- ***************************************************************** --> <!-- ***************************************************************** -->
<!-- *** Targets for setting the package configuration *** --> <!-- *** Targets for setting the package configuration *** -->
<!-- ***************************************************************** --> <!-- ***************************************************************** -->

Просмотреть файл

@ -80,7 +80,7 @@
description="Create a package using the current or default config"> description="Create a package using the current or default config">
<call target="create-zip"/> <call target="create-zip"/>
<call target="create-msi"/> <call target="create-msi" if="${platform::is-windows()}"/>
</target> </target>

Просмотреть файл

@ -1,2 +1,2 @@
start pnunit-agent agent.conf start pnunit-agent agent.conf
pnunit-launcher test.conf pnunit-launcher test.conf