2017-12-14 08:58:33 +03:00
|
|
|
#addin nuget:?package=Cake.Xamarin&version=2.0.1
|
|
|
|
#addin nuget:?package=Cake.XCode&version=3.0.0
|
|
|
|
#addin nuget:?package=Cake.FileHelpers&version=2.0.0
|
2017-12-14 02:51:18 +03:00
|
|
|
|
2017-04-27 22:35:54 +03:00
|
|
|
#reference "tools/SharpCompress/lib/net45/SharpCompress.dll"
|
2016-01-14 07:42:16 +03:00
|
|
|
|
2017-03-12 13:57:06 +03:00
|
|
|
using System.Linq;
|
2017-03-18 16:03:10 +03:00
|
|
|
using System.Runtime.InteropServices;
|
2016-02-24 22:10:20 +03:00
|
|
|
using System.Text.RegularExpressions;
|
2016-01-14 07:42:16 +03:00
|
|
|
using System.Xml;
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
2017-03-18 16:03:10 +03:00
|
|
|
#load "cake/Utils.cake"
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
var TARGET = Argument ("t", Argument ("target", Argument ("Target", "Default")));
|
2017-02-12 01:50:22 +03:00
|
|
|
var VERBOSITY = (Verbosity) Enum.Parse (typeof(Verbosity), Argument ("v", Argument ("verbosity", Argument ("Verbosity", "Verbose"))), true);
|
2016-02-23 00:14:48 +03:00
|
|
|
|
2017-12-14 08:08:47 +03:00
|
|
|
var NuGetSources = new [] { MakeAbsolute (Directory ("./output")).FullPath, "https://api.nuget.org/v3/index.json", "https://www.myget.org/F/xunit/api/v3/index.json" };
|
2016-09-15 04:14:35 +03:00
|
|
|
var NugetToolPath = GetToolPath ("nuget.exe");
|
2017-06-06 05:10:52 +03:00
|
|
|
var XamarinComponentToolPath = GetToolPath ("XamarinComponent/tools/xamarin-component.exe");
|
2016-09-15 04:14:35 +03:00
|
|
|
var CakeToolPath = GetToolPath ("Cake/Cake.exe");
|
2017-06-24 00:32:40 +03:00
|
|
|
var GenApiToolPath = GetToolPath ("Microsoft.DotNet.BuildTools.GenAPI/tools/GenAPI.exe");
|
2017-12-14 08:58:33 +03:00
|
|
|
var MDocPath = GetToolPath ("mdoc/tools/mdoc.exe");
|
2017-03-12 16:24:40 +03:00
|
|
|
var SNToolPath = GetSNToolPath (EnvironmentVariable ("SN_EXE"));
|
2017-05-12 19:25:21 +03:00
|
|
|
var MSBuildToolPath = GetMSBuildToolPath (EnvironmentVariable ("MSBUILD_EXE"));
|
2017-09-05 18:29:58 +03:00
|
|
|
var PythonToolPath = EnvironmentVariable ("PYTHON_EXE") ?? "python";
|
2016-02-23 00:14:48 +03:00
|
|
|
|
2017-09-05 18:29:58 +03:00
|
|
|
var VERSION_ASSEMBLY = "1.60.0.0";
|
|
|
|
var VERSION_FILE = "1.60.0.0";
|
2017-01-29 17:36:02 +03:00
|
|
|
var VERSION_SONAME = VERSION_FILE.Substring(VERSION_FILE.IndexOf(".") + 1);
|
2017-04-27 22:35:54 +03:00
|
|
|
|
2017-05-07 21:59:20 +03:00
|
|
|
var ANGLE_VERSION_SOURCE = "2.1.13";
|
|
|
|
|
2017-05-12 10:53:26 +03:00
|
|
|
var HARFBUZZ_VERSION_SOURCE = "1.4.6";
|
2017-04-27 22:35:54 +03:00
|
|
|
var HARFBUZZ_VERSION_ASSEMBLY = "1.0.0.0";
|
2017-05-12 10:53:26 +03:00
|
|
|
var HARFBUZZ_VERSION_FILE = "1.4.6.0";
|
2017-05-02 16:21:30 +03:00
|
|
|
var HARFBUZZ_VERSION_SONAME = HARFBUZZ_VERSION_FILE.Substring(0, HARFBUZZ_VERSION_FILE.LastIndexOf("."));
|
2017-04-27 22:35:54 +03:00
|
|
|
|
2017-01-29 17:36:02 +03:00
|
|
|
var VERSION_PACKAGES = new Dictionary<string, string> {
|
2017-09-05 18:29:58 +03:00
|
|
|
{ "SkiaSharp", "1.60.0" },
|
|
|
|
{ "SkiaSharp.Views", "1.60.0" },
|
|
|
|
{ "SkiaSharp.Views.Forms", "1.60.0" },
|
|
|
|
{ "SkiaSharp.HarfBuzz", "1.60.0-beta" },
|
2017-05-12 10:53:26 +03:00
|
|
|
|
|
|
|
{ "HarfBuzzSharp", "1.4.6" },
|
2017-01-29 17:36:02 +03:00
|
|
|
};
|
|
|
|
|
2017-03-12 13:57:06 +03:00
|
|
|
var CI_TARGETS = new string[] { "CI", "WINDOWS-CI", "LINUX-CI", "MAC-CI" };
|
|
|
|
var IS_ON_CI = CI_TARGETS.Contains (TARGET.ToUpper ());
|
|
|
|
var IS_ON_FINAL_CI = TARGET.ToUpper () == "CI";
|
|
|
|
|
2017-01-30 20:57:06 +03:00
|
|
|
string ANDROID_HOME = EnvironmentVariable ("ANDROID_HOME") ?? EnvironmentVariable ("HOME") + "/Library/Developer/Xamarin/android-sdk-macosx";
|
|
|
|
string ANDROID_SDK_ROOT = EnvironmentVariable ("ANDROID_SDK_ROOT") ?? ANDROID_HOME;
|
|
|
|
string ANDROID_NDK_HOME = EnvironmentVariable ("ANDROID_NDK_HOME") ?? EnvironmentVariable ("HOME") + "/Library/Developer/Xamarin/android-ndk";
|
|
|
|
|
2016-05-06 18:39:38 +03:00
|
|
|
DirectoryPath ROOT_PATH = MakeAbsolute(Directory("."));
|
2016-09-15 04:14:35 +03:00
|
|
|
DirectoryPath DEPOT_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/depot_tools"));
|
|
|
|
DirectoryPath SKIA_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/skia"));
|
|
|
|
DirectoryPath ANGLE_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/angle"));
|
2017-04-27 22:35:54 +03:00
|
|
|
DirectoryPath HARFBUZZ_PATH = MakeAbsolute(ROOT_PATH.Combine("externals/harfbuzz"));
|
2016-10-19 01:46:12 +03:00
|
|
|
DirectoryPath DOCS_PATH = MakeAbsolute(ROOT_PATH.Combine("docs/en"));
|
2016-01-14 07:42:16 +03:00
|
|
|
|
2016-09-15 04:14:35 +03:00
|
|
|
#load "cake/UtilsManaged.cake"
|
|
|
|
#load "cake/UtilsMSBuild.cake"
|
|
|
|
#load "cake/UtilsNative.cake"
|
|
|
|
#load "cake/BuildExternals.cake"
|
2016-09-08 19:01:22 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// EXTERNALS - the native C and C++ libraries
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
2016-01-15 03:18:32 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
// this builds all the externals
|
2016-01-14 07:42:16 +03:00
|
|
|
Task ("externals")
|
2016-02-23 00:14:48 +03:00
|
|
|
.IsDependentOn ("externals-native")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
|
|
|
});
|
2016-09-12 23:29:14 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// LIBS - the managed C# libraries
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-09-15 10:25:05 +03:00
|
|
|
Task ("libs")
|
2016-02-23 00:14:48 +03:00
|
|
|
.IsDependentOn ("externals")
|
2016-09-16 00:03:29 +03:00
|
|
|
.IsDependentOn ("set-versions")
|
2016-02-23 00:14:48 +03:00
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-09-19 01:05:58 +03:00
|
|
|
// create all the directories
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/windows/");
|
|
|
|
EnsureDirectoryExists ("./output/uwp/");
|
|
|
|
EnsureDirectoryExists ("./output/android/");
|
|
|
|
EnsureDirectoryExists ("./output/ios/");
|
|
|
|
EnsureDirectoryExists ("./output/tvos/");
|
2017-09-05 18:29:58 +03:00
|
|
|
EnsureDirectoryExists ("./output/watchos/");
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/osx/");
|
|
|
|
EnsureDirectoryExists ("./output/portable/");
|
|
|
|
EnsureDirectoryExists ("./output/mac/");
|
|
|
|
EnsureDirectoryExists ("./output/netstandard/");
|
|
|
|
EnsureDirectoryExists ("./output/linux/");
|
|
|
|
EnsureDirectoryExists ("./output/interactive/");
|
|
|
|
EnsureDirectoryExists ("./output/desktop/");
|
2016-09-19 01:05:58 +03:00
|
|
|
|
2017-06-24 03:02:42 +03:00
|
|
|
// .NET Standard / .NET Core
|
|
|
|
RunNuGetRestore ("source/SkiaSharpSource.NetStandard.sln");
|
|
|
|
RunMSBuild ("source/SkiaSharpSource.NetStandard.sln");
|
2017-06-29 23:27:21 +03:00
|
|
|
// copy to output
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.NetStandard/bin/Release/SkiaSharp.dll", "./output/netstandard/");
|
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.NetStandard/bin/Release/HarfBuzzSharp.dll", "./output/netstandard/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.HarfBuzz/SkiaSharp.HarfBuzz.NetStandard/bin/Release/SkiaSharp.HarfBuzz.dll", "./output/netstandard/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.NetStandard/bin/Release/SkiaSharp.Views.Forms.dll", "./output/netstandard/");
|
2017-06-24 02:03:09 +03:00
|
|
|
|
2017-06-24 03:02:42 +03:00
|
|
|
// Generate the portable code - we can't do it automatically as there are issues on linux
|
|
|
|
RunGenApi ("./binding/SkiaSharp.NetStandard/bin/Release/SkiaSharp.dll", "binding/SkiaSharp.Portable/SkiaPortable.cs");
|
|
|
|
RunGenApi ("./binding/HarfBuzzSharp.NetStandard/bin/Release/HarfBuzzSharp.dll", "binding/HarfBuzzSharp.Portable/HarfBuzzPortable.cs");
|
|
|
|
|
|
|
|
// .NET Framework / Xamarin
|
|
|
|
if (IsRunningOnWindows ()) {
|
|
|
|
RunNuGetRestore ("./source/SkiaSharpSource.Windows.sln");
|
|
|
|
RunMSBuild ("./source/SkiaSharpSource.Windows.sln");
|
|
|
|
// SkiaSharp
|
2016-09-15 10:25:05 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.dll", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.pri", "./output/uwp/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// HarfBuzzSharp
|
2017-05-01 11:25:10 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.UWP/bin/Release/HarfBuzzSharp.dll", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.UWP/bin/Release/HarfBuzzSharp.pri", "./output/uwp/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// SkiaSharp.Views
|
2016-09-19 01:05:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.UWP/bin/Release/SkiaSharp.Views.UWP.dll", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.Desktop/bin/Release/SkiaSharp.Views.Desktop.dll", "./output/windows/");
|
2016-09-20 01:37:31 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.WPF/bin/Release/SkiaSharp.Views.WPF.dll", "./output/windows/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// SkiaSharp.Views.Forms
|
2017-06-24 01:17:26 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/bin/Release/SkiaSharp.Views.Forms.dll", "./output/portable/");
|
2016-09-19 01:05:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.UWP/bin/Release/SkiaSharp.Views.Forms.dll", "./output/uwp/");
|
2017-06-24 03:02:42 +03:00
|
|
|
} else if (IsRunningOnMac ()) {
|
2017-09-27 17:40:22 +03:00
|
|
|
// fix for old MSBuild
|
|
|
|
RunMSBuildRestore ("source/SkiaSharpSource.Mac.sln");
|
2017-06-24 03:02:42 +03:00
|
|
|
RunMSBuild ("source/SkiaSharpSource.Mac.sln");
|
|
|
|
// SkiaSharp
|
2016-09-15 10:25:05 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Android/bin/Release/SkiaSharp.dll", "./output/android/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.iOS/bin/Release/SkiaSharp.dll", "./output/ios/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.tvOS/bin/Release/SkiaSharp.dll", "./output/tvos/");
|
2017-09-05 18:29:58 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.watchOS/bin/Release/SkiaSharp.dll", "./output/watchos/");
|
2016-09-15 10:25:05 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.OSX/bin/Release/SkiaSharp.dll", "./output/osx/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// HarfBuzzSharp
|
2017-04-29 00:19:14 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.Android/bin/Release/HarfBuzzSharp.dll", "./output/android/");
|
2017-04-28 23:05:31 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.iOS/bin/Release/HarfBuzzSharp.dll", "./output/ios/");
|
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.tvOS/bin/Release/HarfBuzzSharp.dll", "./output/tvos/");
|
2017-09-05 18:29:58 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.watchOS/bin/Release/HarfBuzzSharp.dll", "./output/watchos/");
|
2017-04-28 23:05:31 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.OSX/bin/Release/HarfBuzzSharp.dll", "./output/osx/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// SkiaSharp.Views
|
2016-09-19 01:05:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.Android/bin/Release/SkiaSharp.Views.Android.dll", "./output/android/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.iOS/bin/Release/SkiaSharp.Views.iOS.dll", "./output/ios/");
|
2017-06-24 02:03:09 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.Mac/bin/Release/SkiaSharp.Views.Mac.dll", "./output/osx/");
|
2017-06-24 03:02:42 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.tvOS/bin/Release/SkiaSharp.Views.tvOS.dll", "./output/tvos/");
|
2017-09-05 18:29:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.watchOS/bin/Release/SkiaSharp.Views.watchOS.dll", "./output/watchos/");
|
2017-06-24 03:02:42 +03:00
|
|
|
// SkiaSharp.Views.Forms
|
2017-06-24 01:17:26 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/bin/Release/SkiaSharp.Views.Forms.dll", "./output/portable/");
|
2016-09-19 01:05:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Android/bin/Release/SkiaSharp.Views.Forms.dll", "./output/android/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.iOS/bin/Release/SkiaSharp.Views.Forms.dll", "./output/ios/");
|
2017-04-23 22:28:32 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Mac/bin/Release/SkiaSharp.Views.Forms.dll", "./output/osx/");
|
2017-06-24 03:02:42 +03:00
|
|
|
} else if (IsRunningOnLinux ()) {
|
2017-01-30 20:45:18 +03:00
|
|
|
RunNuGetRestore ("./source/SkiaSharpSource.Linux.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuild ("./source/SkiaSharpSource.Linux.sln");
|
2017-02-11 19:14:22 +03:00
|
|
|
}
|
2017-06-24 03:02:42 +03:00
|
|
|
// SkiaSharp
|
2017-06-24 14:52:09 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.dll", "./output/desktop/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/nuget/build/net45/SkiaSharp.dll.config", "./output/desktop/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/nuget/build/net45/SkiaSharp.Desktop.targets", "./output/desktop/");
|
2017-06-24 03:02:42 +03:00
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Portable/bin/Release/SkiaSharp.dll", "./output/portable/");
|
|
|
|
// HarfBuzzSharp
|
2017-06-24 14:52:09 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.Desktop/bin/Release/HarfBuzzSharp.dll", "./output/desktop/");
|
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.Desktop/bin/Release/nuget/build/net45/HarfBuzzSharp.dll.config", "./output/desktop/");
|
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.Desktop/bin/Release/nuget/build/net45/HarfBuzzSharp.Desktop.targets", "./output/desktop/");
|
2017-06-24 03:02:42 +03:00
|
|
|
CopyFileToDirectory ("./binding/HarfBuzzSharp.Portable/bin/Release/HarfBuzzSharp.dll", "./output/portable/");
|
|
|
|
// SkiaSharp.HarfBuzz
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.HarfBuzz/SkiaSharp.HarfBuzz/bin/Release/SkiaSharp.HarfBuzz.dll", "./output/portable/");
|
|
|
|
// SkiaSharp.Workbooks
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Workbooks/bin/Release/SkiaSharp.Workbooks.dll", "./output/interactive/");
|
2017-06-29 23:27:21 +03:00
|
|
|
|
|
|
|
// make sure everything is signed and strong named
|
|
|
|
// (msbuild on non-Windows can't sign as part of the build process, so use sn)
|
|
|
|
var excludedAssemblies = new string[] {
|
|
|
|
"/SkiaSharp.Views.Forms.dll", // Xamarin.Forms is not sigend, so we can't sign
|
|
|
|
"/SkiaSharp.Workbooks.dll" // Workbooks integration library is not signed, so we can't sign
|
|
|
|
};
|
|
|
|
foreach (var f in GetFiles("./output/*/*.dll")) {
|
|
|
|
// skip the excluded assemblies
|
|
|
|
var excluded = false;
|
|
|
|
foreach (var assembly in excludedAssemblies) {
|
|
|
|
if (f.FullPath.EndsWith (assembly)) {
|
|
|
|
excluded = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// sign and verify
|
|
|
|
if (!excluded) {
|
|
|
|
Information("Making sure that '{0}' is signed.", f);
|
|
|
|
RunSNReSign(f, "mono.snk");
|
|
|
|
RunSNVerify(f);
|
|
|
|
}
|
|
|
|
}
|
2017-02-11 19:14:22 +03:00
|
|
|
});
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// TESTS - some test cases to make sure it works
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("tests")
|
2017-04-28 23:00:05 +03:00
|
|
|
.IsDependentOn ("libs")
|
|
|
|
.IsDependentOn ("nuget")
|
2016-02-23 00:14:48 +03:00
|
|
|
.Does (() =>
|
|
|
|
{
|
2017-01-22 01:27:08 +03:00
|
|
|
ClearSkiaSharpNuGetCache ();
|
|
|
|
|
2016-02-23 01:18:12 +03:00
|
|
|
RunNuGetRestore ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln");
|
2017-04-27 22:35:54 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
// Windows (x86 and x64)
|
|
|
|
if (IsRunningOnWindows ()) {
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/tests/windows/x86");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuildWithPlatform ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", "x86");
|
2018-01-25 02:56:57 +03:00
|
|
|
RunTests ("./tests/SkiaSharp.Desktop.Tests/bin/x86/Release/SkiaSharp.Tests.dll", null, true);
|
2017-05-13 18:35:15 +03:00
|
|
|
CopyFileToDirectory ("./tests/SkiaSharp.Desktop.Tests/bin/x86/Release/TestResult.xml", "./output/tests/windows/x86");
|
|
|
|
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/tests/windows/x64");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuildWithPlatform ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", "x64");
|
2018-01-25 02:56:57 +03:00
|
|
|
RunTests ("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/SkiaSharp.Tests.dll", null, false);
|
2017-05-13 18:35:15 +03:00
|
|
|
CopyFileToDirectory ("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/TestResult.xml", "./output/tests/windows/x64");
|
2016-02-23 00:14:48 +03:00
|
|
|
}
|
2017-05-13 18:35:15 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
// Mac OSX (Any CPU)
|
2017-01-25 01:33:42 +03:00
|
|
|
if (IsRunningOnMac ()) {
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/tests/mac/AnyCPU");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln");
|
2018-01-25 02:56:57 +03:00
|
|
|
RunTests ("./tests/SkiaSharp.Desktop.Tests/bin/AnyCPU/Release/SkiaSharp.Tests.dll", null, false);
|
2017-05-13 18:35:15 +03:00
|
|
|
CopyFileToDirectory ("./tests/SkiaSharp.Desktop.Tests/bin/AnyCPU/Release/TestResult.xml", "./output/tests/mac/AnyCPU");
|
2016-02-23 00:14:48 +03:00
|
|
|
}
|
2017-05-13 18:35:15 +03:00
|
|
|
|
2017-06-27 23:48:01 +03:00
|
|
|
// Linux (x64)
|
2017-12-14 02:51:18 +03:00
|
|
|
if (IsRunningOnLinux ()) {
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/tests/linux/x64");
|
|
|
|
RunMSBuildWithPlatform ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", "x64");
|
2018-01-25 02:56:57 +03:00
|
|
|
RunTests ("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/SkiaSharp.Tests.dll", null, false);
|
2017-06-27 23:48:01 +03:00
|
|
|
CopyFileToDirectory ("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/TestResult.xml", "./output/tests/linux/x64");
|
|
|
|
}
|
|
|
|
|
2017-01-22 01:27:08 +03:00
|
|
|
// .NET Core
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/tests/netcore");
|
2017-12-14 02:51:18 +03:00
|
|
|
RunNuGetRestore ("./tests/SkiaSharp.NetCore.Tests/SkiaSharp.NetCore.Tests.sln");
|
2018-01-25 02:56:57 +03:00
|
|
|
RunNetCoreTests ("./tests/SkiaSharp.NetCore.Tests/SkiaSharp.NetCore.Tests.csproj", null);
|
2017-12-14 08:08:47 +03:00
|
|
|
CopyFileToDirectory ("./tests/SkiaSharp.NetCore.Tests/TestResult.xml", "./output/tests/netcore");
|
2016-02-23 00:14:48 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// SAMPLES - the demo apps showing off the work
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("samples")
|
|
|
|
.IsDependentOn ("libs")
|
2016-08-30 10:29:26 +03:00
|
|
|
.IsDependentOn ("nuget")
|
2016-02-23 00:14:48 +03:00
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-09-14 23:50:26 +03:00
|
|
|
ClearSkiaSharpNuGetCache ();
|
2017-02-24 12:08:57 +03:00
|
|
|
CleanDirectories ("./samples/*/packages/SkiaSharp.*");
|
2016-06-15 09:36:03 +03:00
|
|
|
|
2016-11-08 23:43:25 +03:00
|
|
|
// zip the samples for the GitHub release notes
|
2017-03-12 13:57:06 +03:00
|
|
|
if (IS_ON_CI) {
|
2016-11-08 23:43:25 +03:00
|
|
|
Zip ("./samples", "./output/samples.zip");
|
|
|
|
}
|
|
|
|
|
2017-01-11 07:35:43 +03:00
|
|
|
if (IsRunningOnLinux ()) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsRunningOnMac ()) {
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/MacSample/MacSample.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuildWithPlatform ("./samples/MacSample/MacSample.sln", "x86");
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/FormsSample/FormsSample.Mac.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuildWithPlatform ("./samples/FormsSample/FormsSample.Mac.sln", "iPhone");
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/TvSample/TvSample.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuildWithPlatform ("./samples/TvSample/TvSample.sln", "iPhoneSimulator");
|
2016-02-23 00:14:48 +03:00
|
|
|
}
|
|
|
|
|
2016-06-03 18:32:14 +03:00
|
|
|
if (IsRunningOnWindows ()) {
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/WPFSample/WPFSample.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuild ("./samples/WPFSample/WPFSample.sln");
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/UWPSample/UWPSample.sln");
|
2017-06-24 10:43:21 +03:00
|
|
|
RunMSBuildWithPlatformTarget ("./samples/UWPSample/UWPSample.sln", "x86");
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/FormsSample/FormsSample.Windows.sln");
|
2017-06-24 10:43:21 +03:00
|
|
|
RunMSBuildWithPlatformTarget ("./samples/FormsSample/FormsSample.Windows.sln", "x86");
|
2016-10-04 23:30:10 +03:00
|
|
|
RunNuGetRestore ("./samples/WindowsSample/WindowsSample.sln");
|
2017-05-12 19:25:21 +03:00
|
|
|
RunMSBuild ("./samples/WindowsSample/WindowsSample.sln");
|
2016-06-03 18:32:14 +03:00
|
|
|
}
|
2016-02-23 00:14:48 +03:00
|
|
|
});
|
|
|
|
|
2016-02-23 13:57:08 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DOCS - building the API documentation
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("docs")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-10-19 23:49:25 +03:00
|
|
|
// log TODOs
|
2016-10-21 00:50:32 +03:00
|
|
|
var docFiles = GetFiles ("./docs/**/*.xml");
|
|
|
|
float typeCount = 0;
|
|
|
|
float memberCount = 0;
|
|
|
|
float totalTypes = 0;
|
|
|
|
float totalMembers = 0;
|
|
|
|
foreach (var file in docFiles) {
|
|
|
|
var xdoc = XDocument.Load (file.ToString ());
|
|
|
|
|
|
|
|
var typesWithDocs = xdoc.Root
|
|
|
|
.Elements ("Docs");
|
|
|
|
|
2016-11-03 06:00:38 +03:00
|
|
|
totalTypes += typesWithDocs.Count ();
|
|
|
|
var currentTypeCount = typesWithDocs.Where (m => m.Value != null && m.Value.IndexOf ("To be added.") >= 0).Count ();
|
|
|
|
typeCount += currentTypeCount;
|
2016-10-21 00:50:32 +03:00
|
|
|
|
|
|
|
var membersWithDocs = xdoc.Root
|
|
|
|
.Elements ("Members")
|
|
|
|
.Elements ("Member")
|
2016-11-03 06:00:38 +03:00
|
|
|
.Where (m => m.Attribute ("MemberName") != null && m.Attribute ("MemberName").Value != "Dispose" && m.Attribute ("MemberName").Value != "Finalize")
|
2016-10-21 00:50:32 +03:00
|
|
|
.Elements ("Docs");
|
|
|
|
|
|
|
|
totalMembers += membersWithDocs.Count ();
|
2016-11-03 06:00:38 +03:00
|
|
|
var currentMemberCount = membersWithDocs.Where (m => m.Value != null && m.Value.IndexOf ("To be added.") >= 0).Count ();
|
|
|
|
memberCount += currentMemberCount;
|
|
|
|
|
|
|
|
currentMemberCount += currentTypeCount;
|
|
|
|
if (currentMemberCount > 0) {
|
|
|
|
var fullName = xdoc.Root.Attribute ("FullName");
|
|
|
|
if (fullName != null)
|
|
|
|
Information ("Docs missing on {0} = {1}", fullName.Value, currentMemberCount);
|
|
|
|
}
|
2016-10-21 00:50:32 +03:00
|
|
|
}
|
|
|
|
Information (
|
|
|
|
"Documentation missing in {0}/{1} ({2:0.0%}) types and {3}/{4} ({5:0.0%}) members.",
|
|
|
|
typeCount, totalTypes, typeCount / totalTypes,
|
|
|
|
memberCount, totalMembers, memberCount / totalMembers);
|
2016-10-19 23:49:25 +03:00
|
|
|
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/docs/msxml/");
|
2016-10-19 01:46:12 +03:00
|
|
|
RunMdocMSXml (DOCS_PATH, "./output/docs/msxml/");
|
2016-05-05 04:24:31 +03:00
|
|
|
|
2017-06-27 23:48:01 +03:00
|
|
|
EnsureDirectoryExists ("./output/docs/mdoc/");
|
2016-10-19 01:46:12 +03:00
|
|
|
RunMdocAssemble (DOCS_PATH, "./output/docs/mdoc/SkiaSharp");
|
2016-10-19 01:50:16 +03:00
|
|
|
|
|
|
|
CopyFileToDirectory ("./docs/SkiaSharp.source", "./output/docs/mdoc/");
|
2016-02-23 13:57:08 +03:00
|
|
|
});
|
|
|
|
|
2016-10-19 01:47:20 +03:00
|
|
|
// we can only update the docs on the platform machines
|
|
|
|
// becuase each requires platform features for the views
|
|
|
|
Task ("update-docs")
|
|
|
|
.IsDependentOn ("libs")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
|
|
|
// the reference folders to locate assemblies
|
2016-10-19 01:50:16 +03:00
|
|
|
IEnumerable<DirectoryPath> refs = new DirectoryPath [] {
|
2017-04-25 00:32:28 +03:00
|
|
|
"./output/portable/",
|
2016-10-19 03:50:27 +03:00
|
|
|
}
|
|
|
|
.Union (GetDirectories ("./source/packages/Xamarin.Forms.*/lib/portable*"))
|
|
|
|
.Union (GetDirectories ("./source/packages/OpenTK.*/lib/net40*"));
|
2016-10-19 01:47:20 +03:00
|
|
|
// add windows-specific references
|
|
|
|
if (IsRunningOnWindows ()) {
|
2017-05-20 08:23:47 +03:00
|
|
|
// Windows.Foundation.UniversalApiContract is a winmd, so fake the dll
|
|
|
|
// types aren't needed here
|
|
|
|
RunMSBuild ("./externals/Windows.Foundation.UniversalApiContract/Windows.Foundation.UniversalApiContract.csproj");
|
2016-10-19 01:47:20 +03:00
|
|
|
refs = refs.Union (new DirectoryPath [] {
|
|
|
|
"./externals/Windows.Foundation.UniversalApiContract/bin/Release",
|
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/MonoAndroid/v1.0",
|
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/MonoAndroid/v2.3",
|
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0",
|
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.TVOS/v1.0",
|
2017-09-05 18:29:58 +03:00
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.WatchOS/v1.0",
|
2017-04-25 00:32:28 +03:00
|
|
|
"C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.Mac/v2.0",
|
2016-10-19 01:47:20 +03:00
|
|
|
"./externals",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// add mac-specific references
|
2017-01-11 07:35:43 +03:00
|
|
|
if (IsRunningOnMac ()) {
|
2016-10-19 01:47:20 +03:00
|
|
|
refs = refs.Union (new DirectoryPath [] {
|
|
|
|
"/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild-frameworks/.NETPortable/v4.5",
|
|
|
|
"/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild-frameworks/MonoAndroid/v1.0",
|
|
|
|
"/Library/Frameworks/Xamarin.Android.framework/Versions/Current/lib/xbuild-frameworks/MonoAndroid/v4.5",
|
|
|
|
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.TVOS",
|
2017-09-05 18:29:58 +03:00
|
|
|
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.WatchOS",
|
2016-10-19 01:47:20 +03:00
|
|
|
"/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS",
|
|
|
|
"/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
// the assemblies to generate docs for
|
|
|
|
var assemblies = new FilePath [] {
|
|
|
|
"./output/portable/SkiaSharp.dll",
|
2017-03-30 22:26:14 +03:00
|
|
|
"./output/portable/SkiaSharp.Views.Forms.dll",
|
2017-05-01 12:02:46 +03:00
|
|
|
"./output/portable/HarfBuzzSharp.dll",
|
|
|
|
"./output/portable/SkiaSharp.HarfBuzz.dll",
|
2016-10-19 01:47:20 +03:00
|
|
|
};
|
2017-03-30 22:26:14 +03:00
|
|
|
// add windows-specific assemblies
|
|
|
|
if (IsRunningOnWindows ()) {
|
|
|
|
assemblies = assemblies.Union (new FilePath [] {
|
|
|
|
"./output/windows/SkiaSharp.Views.Desktop.dll",
|
|
|
|
"./output/windows/SkiaSharp.Views.WPF.dll",
|
|
|
|
"./output/android/SkiaSharp.Views.Android.dll",
|
|
|
|
"./output/ios/SkiaSharp.Views.iOS.dll",
|
|
|
|
"./output/osx/SkiaSharp.Views.Mac.dll",
|
|
|
|
"./output/tvos/SkiaSharp.Views.tvOS.dll",
|
2017-09-05 18:29:58 +03:00
|
|
|
"./output/watchos/SkiaSharp.Views.watchOS.dll",
|
2017-04-25 00:32:28 +03:00
|
|
|
"./output/uwp/SkiaSharp.Views.UWP.dll",
|
2017-03-30 22:26:14 +03:00
|
|
|
}).ToArray ();
|
|
|
|
}
|
|
|
|
// add mac-specific assemblies
|
|
|
|
if (IsRunningOnMac ()) {
|
|
|
|
assemblies = assemblies.Union (new FilePath [] {
|
|
|
|
"./output/android/SkiaSharp.Views.Android.dll",
|
|
|
|
"./output/ios/SkiaSharp.Views.iOS.dll",
|
|
|
|
"./output/osx/SkiaSharp.Views.Mac.dll",
|
|
|
|
"./output/tvos/SkiaSharp.Views.tvOS.dll",
|
2017-09-05 18:29:58 +03:00
|
|
|
"./output/watchos/SkiaSharp.Views.watchOS.dll",
|
2017-03-30 22:26:14 +03:00
|
|
|
}).ToArray ();
|
|
|
|
}
|
2016-10-19 01:47:20 +03:00
|
|
|
|
|
|
|
// print out the assemblies
|
|
|
|
foreach (var r in refs) {
|
|
|
|
Information ("Reference Directory: {0}", r);
|
|
|
|
}
|
|
|
|
foreach (var a in assemblies) {
|
|
|
|
Information ("Processing {0}...", a);
|
|
|
|
}
|
|
|
|
|
|
|
|
// generate doc files
|
|
|
|
RunMdocUpdate (assemblies, DOCS_PATH, refs.ToArray ());
|
2016-11-08 07:46:26 +03:00
|
|
|
|
|
|
|
// apply some formatting
|
|
|
|
var docFiles = GetFiles ("./docs/**/*.xml");
|
|
|
|
foreach (var file in docFiles) {
|
|
|
|
|
|
|
|
var xdoc = XDocument.Load (file.ToString ());
|
|
|
|
|
|
|
|
// remove IComponent docs as this is just designer
|
|
|
|
var icomponents = xdoc.Root
|
|
|
|
.Elements ("Members")
|
|
|
|
.Elements ("Member")
|
|
|
|
.Where (e => e.Attribute ("MemberName") != null && e.Attribute ("MemberName").Value.StartsWith ("System.ComponentModel.IComponent."))
|
|
|
|
.ToArray ();
|
|
|
|
foreach (var ic in icomponents) {
|
|
|
|
Information ("Removing IComponent member '{0}' from '{1}'...", ic.Attribute ("MemberName").Value, file);
|
|
|
|
icomponents.Remove ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// get the whitespaces right
|
|
|
|
var settings = new XmlWriterSettings {
|
|
|
|
Encoding = new UTF8Encoding (),
|
|
|
|
Indent = true,
|
|
|
|
NewLineChars = "\n",
|
|
|
|
OmitXmlDeclaration = true,
|
|
|
|
};
|
|
|
|
using (var writer = XmlWriter.Create (file.ToString (), settings)) {
|
|
|
|
xdoc.Save (writer);
|
|
|
|
writer.Flush ();
|
|
|
|
}
|
|
|
|
|
|
|
|
// empty line at the end
|
|
|
|
System.IO.File.AppendAllText (file.ToString (), "\n");
|
|
|
|
}
|
2016-10-19 01:47:20 +03:00
|
|
|
});
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// NUGET - building the package for NuGet.org
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("nuget")
|
|
|
|
.IsDependentOn ("libs")
|
2016-05-05 04:24:31 +03:00
|
|
|
.IsDependentOn ("docs")
|
2016-02-23 00:14:48 +03:00
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-06-06 22:29:44 +03:00
|
|
|
// we can only build the combined package on CI
|
2017-03-12 13:57:06 +03:00
|
|
|
if (IS_ON_FINAL_CI) {
|
2016-05-05 04:24:31 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.nuspec", "./output/");
|
2017-04-27 22:35:54 +03:00
|
|
|
PackageNuGet ("./nuget/HarfBuzzSharp.nuspec", "./output/");
|
2016-09-09 02:52:03 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Forms.nuspec", "./output/");
|
|
|
|
} else {
|
|
|
|
if (IsRunningOnWindows ()) {
|
2016-09-19 01:05:58 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Windows.nuspec", "./output/");
|
2017-04-27 22:35:54 +03:00
|
|
|
PackageNuGet ("./nuget/HarfBuzzSharp.Windows.nuspec", "./output/");
|
2016-09-19 01:05:58 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Windows.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Forms.Windows.nuspec", "./output/");
|
|
|
|
}
|
2017-01-11 07:35:43 +03:00
|
|
|
if (IsRunningOnMac ()) {
|
2016-09-19 01:05:58 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Mac.nuspec", "./output/");
|
2017-04-27 22:35:54 +03:00
|
|
|
PackageNuGet ("./nuget/HarfBuzzSharp.Mac.nuspec", "./output/");
|
2016-09-19 01:05:58 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Mac.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Forms.Mac.nuspec", "./output/");
|
|
|
|
}
|
2017-01-11 07:35:43 +03:00
|
|
|
if (IsRunningOnLinux ()) {
|
2017-01-25 01:33:42 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Linux.nuspec", "./output/");
|
2017-04-27 22:35:54 +03:00
|
|
|
PackageNuGet ("./nuget/HarfBuzzSharp.Linux.nuspec", "./output/");
|
2017-01-11 07:35:43 +03:00
|
|
|
}
|
2016-09-15 10:25:05 +03:00
|
|
|
}
|
2017-04-27 22:35:54 +03:00
|
|
|
// HarfBuzz is a PCL
|
|
|
|
PackageNuGet ("./nuget/SkiaSharp.HarfBuzz.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
});
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// COMPONENT - building the package for components.xamarin.com
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("component")
|
|
|
|
.IsDependentOn ("nuget")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-02-23 01:18:12 +03:00
|
|
|
// TODO: Not yet ready
|
2016-02-23 00:14:48 +03:00
|
|
|
|
2017-06-27 23:48:01 +03:00
|
|
|
// EnsureDirectoryExists ("./output/");
|
2016-02-23 01:18:12 +03:00
|
|
|
|
|
|
|
// FilePath yaml = "./component/component.yaml";
|
|
|
|
// var yamlDir = yaml.GetDirectory ();
|
|
|
|
// PackageComponent (yamlDir, new XamarinComponentSettings {
|
|
|
|
// ToolPath = XamarinComponentToolPath
|
|
|
|
// });
|
2016-02-23 00:14:48 +03:00
|
|
|
|
2016-02-23 01:18:12 +03:00
|
|
|
// MoveFiles (yamlDir.FullPath.TrimEnd ('/') + "/*.xam", "./output/");
|
2016-02-23 00:14:48 +03:00
|
|
|
});
|
|
|
|
|
2016-09-16 00:03:29 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// VERSIONS - update all packages and references to the new version
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("set-versions")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
|
|
|
// set the SHA on the assembly info
|
|
|
|
var sha = EnvironmentVariable ("GIT_COMMIT") ?? string.Empty;
|
|
|
|
if (!string.IsNullOrEmpty (sha) && sha.Length >= 6) {
|
|
|
|
sha = sha.Substring (0, 6);
|
|
|
|
} else {
|
|
|
|
sha = "{GIT_SHA}";
|
|
|
|
}
|
|
|
|
|
|
|
|
var files = new List<string> ();
|
|
|
|
var add = new Action<string> (glob => {
|
|
|
|
files.AddRange (GetFiles (glob).Select (p => MakeAbsolute (p).ToString ()));
|
|
|
|
});
|
|
|
|
// nuspecs
|
|
|
|
add ("./nuget/*.nuspec");
|
|
|
|
// packages files
|
|
|
|
add ("./source/*/*/packages.config");
|
|
|
|
add ("./source/*/*/project.json");
|
|
|
|
// project files
|
|
|
|
add ("./source/*/*/*.nuget.targets");
|
|
|
|
add ("./source/*/*/*.csproj");
|
|
|
|
// sample packages files
|
2016-10-04 23:30:10 +03:00
|
|
|
add ("./samples/*/*/packages.config");
|
|
|
|
add ("./samples/*/*/project.json");
|
2016-09-16 00:03:29 +03:00
|
|
|
// sample project files
|
2016-10-04 23:30:10 +03:00
|
|
|
add ("./samples/*/*/*.nuget.targets");
|
|
|
|
add ("./samples/*/*/*.csproj");
|
2017-01-31 20:29:15 +03:00
|
|
|
// tests packages files
|
|
|
|
add ("./tests/*/packages.config");
|
|
|
|
add ("./tests/*/project.json");
|
|
|
|
// tests project files
|
|
|
|
add ("./tests/*/*.nuget.targets");
|
|
|
|
add ("./tests/*/*.csproj");
|
2016-09-16 00:03:29 +03:00
|
|
|
// update
|
|
|
|
foreach (var file in files) {
|
2017-01-29 17:36:02 +03:00
|
|
|
UpdateSkiaSharpVersion (file, VERSION_PACKAGES);
|
2016-09-16 00:03:29 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// assembly infos
|
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./binding/Binding/Properties/SkiaSharpAssemblyInfo.cs",
|
2017-01-29 17:36:02 +03:00
|
|
|
VERSION_ASSEMBLY, VERSION_FILE, sha);
|
2016-09-16 00:03:29 +03:00
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./source/SkiaSharp.Views/SkiaSharp.Views.Shared/Properties/SkiaSharpViewsAssemblyInfo.cs",
|
2017-01-29 17:36:02 +03:00
|
|
|
VERSION_ASSEMBLY, VERSION_FILE, sha);
|
2016-09-16 00:03:29 +03:00
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Properties/SkiaSharpViewsFormsAssemblyInfo.cs",
|
2017-01-29 17:36:02 +03:00
|
|
|
VERSION_ASSEMBLY, VERSION_FILE, sha);
|
2017-04-27 22:35:54 +03:00
|
|
|
UpdateAssemblyInfo (
|
|
|
|
"./source/SkiaSharp.HarfBuzz/SkiaSharp.HarfBuzz.Shared/Properties/SkiaSharpHarfBuzzAssemblyInfo.cs",
|
|
|
|
VERSION_ASSEMBLY, VERSION_FILE, sha);
|
|
|
|
|
|
|
|
UpdateAssemblyInfo (
|
|
|
|
"./binding/HarfBuzzSharp.Shared/Properties/HarfBuzzSharpAssemblyInfo.cs",
|
|
|
|
HARFBUZZ_VERSION_ASSEMBLY, HARFBUZZ_VERSION_FILE, sha);
|
2017-05-02 18:41:34 +03:00
|
|
|
UpdateAssemblyInfo (
|
|
|
|
"./source/SkiaSharp.Workbooks/Properties/SkiaSharpWorkbooksAssemblyInfo.cs",
|
|
|
|
VERSION_ASSEMBLY, VERSION_FILE, sha);
|
2016-09-16 00:03:29 +03:00
|
|
|
});
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CLEAN - remove all the build artefacts
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2016-01-15 03:18:32 +03:00
|
|
|
Task ("clean")
|
|
|
|
.IsDependentOn ("clean-externals")
|
2016-06-08 02:20:27 +03:00
|
|
|
.IsDependentOn ("clean-managed")
|
2016-01-15 03:18:32 +03:00
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-06-08 02:20:27 +03:00
|
|
|
});
|
|
|
|
Task ("clean-managed").Does (() =>
|
|
|
|
{
|
|
|
|
CleanDirectories ("./binding/*/bin");
|
|
|
|
CleanDirectories ("./binding/*/obj");
|
2017-01-25 16:36:10 +03:00
|
|
|
DeleteFiles ("./binding/*/project.lock.json");
|
2016-06-08 02:20:27 +03:00
|
|
|
|
|
|
|
CleanDirectories ("./samples/*/bin");
|
|
|
|
CleanDirectories ("./samples/*/obj");
|
2016-09-15 05:57:22 +03:00
|
|
|
CleanDirectories ("./samples/*/AppPackages");
|
2016-06-08 02:20:27 +03:00
|
|
|
CleanDirectories ("./samples/*/*/bin");
|
|
|
|
CleanDirectories ("./samples/*/*/obj");
|
2017-01-25 16:36:10 +03:00
|
|
|
DeleteFiles ("./samples/*/*/project.lock.json");
|
2016-09-15 05:57:22 +03:00
|
|
|
CleanDirectories ("./samples/*/*/AppPackages");
|
2016-06-08 02:20:27 +03:00
|
|
|
CleanDirectories ("./samples/*/packages");
|
2016-02-23 00:19:23 +03:00
|
|
|
|
|
|
|
CleanDirectories ("./tests/**/bin");
|
|
|
|
CleanDirectories ("./tests/**/obj");
|
2017-03-11 09:37:12 +03:00
|
|
|
CleanDirectories ("./tests/**/artifacts");
|
2017-01-25 16:36:10 +03:00
|
|
|
DeleteFiles ("./tests/**/project.lock.json");
|
2016-01-15 03:18:32 +03:00
|
|
|
|
2016-09-15 05:08:30 +03:00
|
|
|
CleanDirectories ("./source/*/*/bin");
|
|
|
|
CleanDirectories ("./source/*/*/obj");
|
2017-01-25 16:36:10 +03:00
|
|
|
DeleteFiles ("./source/*/*/project.lock.json");
|
2016-09-15 05:08:30 +03:00
|
|
|
CleanDirectories ("./source/*/*/Generated Files");
|
2016-09-19 01:05:58 +03:00
|
|
|
CleanDirectories ("./source/packages");
|
2016-09-09 05:40:29 +03:00
|
|
|
|
2016-10-18 23:14:08 +03:00
|
|
|
CleanDirectories ("./externals/Windows.Foundation.UniversalApiContract/bin");
|
|
|
|
CleanDirectories ("./externals/Windows.Foundation.UniversalApiContract/obj");
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
if (DirectoryExists ("./output"))
|
|
|
|
DeleteDirectory ("./output", true);
|
|
|
|
});
|
2016-01-15 03:18:32 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// DEFAULT - target for common development
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("Default")
|
|
|
|
.IsDependentOn ("externals")
|
|
|
|
.IsDependentOn ("libs");
|
|
|
|
|
2016-06-09 07:49:58 +03:00
|
|
|
Task ("Everything")
|
|
|
|
.IsDependentOn ("externals")
|
|
|
|
.IsDependentOn ("libs")
|
|
|
|
.IsDependentOn ("docs")
|
|
|
|
.IsDependentOn ("nuget")
|
|
|
|
.IsDependentOn ("component")
|
|
|
|
.IsDependentOn ("tests")
|
|
|
|
.IsDependentOn ("samples");
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CI - the master target to build everything
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("CI")
|
|
|
|
.IsDependentOn ("externals")
|
|
|
|
.IsDependentOn ("libs")
|
2016-02-23 13:57:08 +03:00
|
|
|
.IsDependentOn ("docs")
|
2016-02-23 00:14:48 +03:00
|
|
|
.IsDependentOn ("nuget")
|
|
|
|
.IsDependentOn ("component")
|
|
|
|
.IsDependentOn ("tests")
|
|
|
|
.IsDependentOn ("samples");
|
|
|
|
|
2017-03-12 13:57:06 +03:00
|
|
|
Task ("Mac-CI")
|
|
|
|
.IsDependentOn ("CI");
|
|
|
|
|
2016-05-05 04:24:31 +03:00
|
|
|
Task ("Windows-CI")
|
2017-03-12 13:57:06 +03:00
|
|
|
.IsDependentOn ("CI");
|
2016-05-05 04:24:31 +03:00
|
|
|
|
2017-02-21 23:38:18 +03:00
|
|
|
Task ("Linux-CI")
|
2017-03-12 13:57:06 +03:00
|
|
|
.IsDependentOn ("CI");
|
2017-02-21 23:38:18 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// BUILD NOW
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Information ("Cake.exe ToolPath: {0}", CakeToolPath);
|
|
|
|
Information ("NuGet.exe ToolPath: {0}", NugetToolPath);
|
|
|
|
Information ("Xamarin-Component.exe ToolPath: {0}", XamarinComponentToolPath);
|
2017-06-24 00:32:40 +03:00
|
|
|
Information ("genapi.exe ToolPath: {0}", GenApiToolPath);
|
2017-03-12 15:15:01 +03:00
|
|
|
Information ("sn.exe ToolPath: {0}", SNToolPath);
|
2017-05-12 19:25:21 +03:00
|
|
|
Information ("msbuild.exe ToolPath: {0}", MSBuildToolPath);
|
2016-01-14 07:42:16 +03:00
|
|
|
|
2017-03-12 13:57:06 +03:00
|
|
|
if (IS_ON_CI) {
|
|
|
|
Information ("Detected that we are building on CI, {0}.", IS_ON_FINAL_CI ? "and on FINAL CI" : "but NOT on final CI");
|
|
|
|
} else {
|
|
|
|
Information ("Detected that we are {0} on CI.", "NOT");
|
|
|
|
}
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
ListEnvironmentVariables ();
|
2016-01-14 07:42:16 +03:00
|
|
|
|
|
|
|
RunTarget (TARGET);
|