Browse Source

Merge branch 'master' into runtime-platform

pull/703/head
Nikita Tsukanov 10 years ago
parent
commit
3809d96815
  1. 1
      .gitignore
  2. 18
      build.cake
  3. 10
      build.ps1
  4. 4
      build.sh

1
.gitignore

@ -159,3 +159,4 @@ $RECYCLE.BIN/
tools/ tools/
.nuget .nuget
artifacts/ artifacts/
nuget

18
build.cake

@ -29,7 +29,7 @@ using NuGet;
var target = Argument("target", "Default"); var target = Argument("target", "Default");
var platform = Argument("platform", "Any CPU"); var platform = Argument("platform", "Any CPU");
var configuration = Argument("configuration", "Release"); var configuration = Argument("configuration", "Release");
var skipTests = HasArgument("skip-tests");
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// CONFIGURATION // CONFIGURATION
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -129,16 +129,11 @@ var buildDirs =
Information("Getting git modules:"); Information("Getting git modules:");
IEnumerable<string> subModules; IEnumerable<string> subModules;
var gitSettings = new ProcessSettings { Arguments = "config --file .gitmodules --get-regexp path", RedirectStandardOutput = true }; var gitSettings = System.IO.File.ReadAllLines(".git/config");
var exitCode = StartProcess("git", gitSettings, out subModules);
if (exitCode != 0)
{
throw new Exception("Failed to retrieve git submodule paths.");
}
var ignoredSubModulesPaths = subModules.Select(m => var ignoredSubModulesPaths = gitSettings.Where(m=>m.StartsWith("[submodule ")).Select(m =>
{ {
var path = m.Split(' ')[1]; var path = m.Split(' ')[1].Trim("\"[] \t".ToArray());
Information(path); Information(path);
return ((DirectoryPath)Directory(path)).FullPath; return ((DirectoryPath)Directory(path)).FullPath;
}).ToList(); }).ToList();
@ -628,6 +623,11 @@ Task("Run-Unit-Tests")
.IsDependentOn("Build") .IsDependentOn("Build")
.Does(() => .Does(() =>
{ {
if(skipTests)
{
Information("Skipping unit tests because of -skip-tests");
return;
}
var pattern = "./tests/Avalonia.*.UnitTests/bin/" + dirSuffix + "/Avalonia.*.UnitTests.dll"; var pattern = "./tests/Avalonia.*.UnitTests/bin/" + dirSuffix + "/Avalonia.*.UnitTests.dll";
Func<IFileSystemInfo, bool> ExcludeWindowsTests = i => { Func<IFileSystemInfo, bool> ExcludeWindowsTests = i => {

10
build.ps1

@ -32,6 +32,8 @@ No tasks will be executed.
Tells Cake to use the Mono scripting engine. Tells Cake to use the Mono scripting engine.
.PARAMETER SkipToolPackageRestore .PARAMETER SkipToolPackageRestore
Skips restoring of packages. Skips restoring of packages.
.PARAMETER SkipTests
Skips unit tests
.PARAMETER ScriptArgs .PARAMETER ScriptArgs
Remaining arguments are added here. Remaining arguments are added here.
@ -117,6 +119,12 @@ if($WhatIf.IsPresent) {
$UseDryRun = "-dryrun" $UseDryRun = "-dryrun"
} }
# Is this a dry run?
$UseSkipTests = "";
if($SkipTests.IsPresent) {
$UseSkipTests = "-skip-tests"
}
# Make sure tools folder exists # Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) { if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..." Write-Verbose -Message "Creating tools directory..."
@ -189,5 +197,5 @@ if (!(Test-Path $CAKE_EXE)) {
# Start Cake # Start Cake
Write-Host "Running build script..." Write-Host "Running build script..."
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -platform=`"$Platform`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs" Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -platform=`"$Platform`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseSkipTests $UseMono $UseDryRun $UseExperimental $ScriptArgs"
exit $LASTEXITCODE exit $LASTEXITCODE

4
build.sh

@ -29,6 +29,7 @@ CONFIGURATION="Release"
PLATFORM="Any CPU" PLATFORM="Any CPU"
VERBOSITY="verbose" VERBOSITY="verbose"
DRYRUN= DRYRUN=
SKIP_TESTS=
SHOW_VERSION=false SHOW_VERSION=false
SCRIPT_ARGUMENTS=() SCRIPT_ARGUMENTS=()
@ -39,6 +40,7 @@ for i in "$@"; do
-t|--target) TARGET="$2"; shift ;; -t|--target) TARGET="$2"; shift ;;
-p|--platform) PLATFORM="$2"; shift ;; -p|--platform) PLATFORM="$2"; shift ;;
-c|--configuration) CONFIGURATION="$2"; shift ;; -c|--configuration) CONFIGURATION="$2"; shift ;;
--skip-tests) SKIP_TESTS="-skip-tests"; shift ;;
-v|--verbosity) VERBOSITY="$2"; shift ;; -v|--verbosity) VERBOSITY="$2"; shift ;;
-d|--dryrun) DRYRUN="-dryrun" ;; -d|--dryrun) DRYRUN="-dryrun" ;;
--version) SHOW_VERSION=true ;; --version) SHOW_VERSION=true ;;
@ -99,5 +101,5 @@ fi
if $SHOW_VERSION; then if $SHOW_VERSION; then
exec mono "$CAKE_EXE" -version exec mono "$CAKE_EXE" -version
else else
exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -platform="$PLATFORM" -configuration="$CONFIGURATION" -target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" exec mono "$CAKE_EXE" $SCRIPT -verbosity=$VERBOSITY -platform="$PLATFORM" -configuration="$CONFIGURATION" -target=$TARGET $DRYRUN SKIP_TESTS "${SCRIPT_ARGUMENTS[@]}"
fi fi

Loading…
Cancel
Save