2016-01-14 07:42:16 +03:00
|
|
|
#addin "Cake.Xamarin"
|
|
|
|
#addin "Cake.XCode"
|
2016-02-24 22:10:20 +03:00
|
|
|
#addin "Cake.FileHelpers"
|
2016-01-14 07:42:16 +03:00
|
|
|
|
2016-09-15 04:14:35 +03:00
|
|
|
#load "cake/Utils.cake"
|
|
|
|
|
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;
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
var TARGET = Argument ("t", Argument ("target", Argument ("Target", "Default")));
|
|
|
|
|
2016-08-30 10:29:26 +03:00
|
|
|
var NuGetSources = new [] { MakeAbsolute (Directory ("./output")).FullPath, "https://api.nuget.org/v3/index.json" };
|
2016-09-15 04:14:35 +03:00
|
|
|
var NugetToolPath = GetToolPath ("nuget.exe");
|
|
|
|
var XamarinComponentToolPath = GetToolPath ("xamarin-component.exe");
|
|
|
|
var CakeToolPath = GetToolPath ("Cake/Cake.exe");
|
|
|
|
var NUnitConsoleToolPath = GetToolPath ("NUnit.Console/tools/nunit3-console.exe");
|
|
|
|
var GenApiToolPath = GetToolPath ("genapi.exe");
|
|
|
|
var MDocPath = GetToolPath ("mdoc/mdoc.exe");
|
2016-02-23 00:14:48 +03:00
|
|
|
|
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"));
|
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/TransformToTvOS.cake"
|
|
|
|
#load "cake/TransformToUWP.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-genapi")
|
|
|
|
.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-15 10:25:05 +03:00
|
|
|
// 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);
|
|
|
|
Information ("Setting Git SHA to {0}.", sha);
|
2016-09-20 01:37:31 +03:00
|
|
|
ReplaceTextInFiles ("./binding/Binding/Properties/SkiaSharpAssemblyInfo.cs", "{GIT_SHA}", sha);
|
|
|
|
ReplaceTextInFiles ("./source/SkiaSharp.Views/SkiaSharp.Views.Shared/Properties/SkiaSharpViewsAssemblyInfo.cs", "{GIT_SHA}", sha);
|
|
|
|
ReplaceTextInFiles ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Properties/SkiaSharpViewsFormsAssemblyInfo.cs", "{GIT_SHA}", sha);
|
2016-09-15 10:25:05 +03:00
|
|
|
}
|
2016-02-23 00:14:48 +03:00
|
|
|
|
2016-09-19 01:05:58 +03:00
|
|
|
// create all the directories
|
|
|
|
if (!DirectoryExists ("./output/windows/")) CreateDirectory ("./output/windows/");
|
|
|
|
if (!DirectoryExists ("./output/uwp/")) CreateDirectory ("./output/uwp/");
|
|
|
|
if (!DirectoryExists ("./output/android/")) CreateDirectory ("./output/android/");
|
|
|
|
if (!DirectoryExists ("./output/ios/")) CreateDirectory ("./output/ios/");
|
|
|
|
if (!DirectoryExists ("./output/tvos/")) CreateDirectory ("./output/tvos/");
|
|
|
|
if (!DirectoryExists ("./output/osx/")) CreateDirectory ("./output/osx/");
|
|
|
|
if (!DirectoryExists ("./output/portable/")) CreateDirectory ("./output/portable/");
|
|
|
|
if (!DirectoryExists ("./output/mac/")) CreateDirectory ("./output/mac/");
|
|
|
|
|
2016-09-15 10:25:05 +03:00
|
|
|
if (IsRunningOnWindows ()) {
|
2016-09-19 01:05:58 +03:00
|
|
|
// build bindings
|
2016-09-15 10:25:05 +03:00
|
|
|
RunNuGetRestore ("binding/SkiaSharp.Windows.sln");
|
|
|
|
DotNetBuild ("binding/SkiaSharp.Windows.sln", c => {
|
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
2016-09-19 01:05:58 +03:00
|
|
|
|
2016-09-15 10:25:05 +03:00
|
|
|
// copy build output
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Portable/bin/Release/SkiaSharp.dll", "./output/portable/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.dll", "./output/windows/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.pdb", "./output/windows/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.dll.config", "./output/windows/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.Desktop.targets", "./output/windows/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.dll", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.pdb", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.pri", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.UWP/bin/Release/SkiaSharp.UWP.targets", "./output/uwp/");
|
2016-09-19 01:05:58 +03:00
|
|
|
|
|
|
|
// build other source
|
2016-09-20 01:37:31 +03:00
|
|
|
RunNuGetRestore ("./source/SkiaSharpSource.Windows.sln");
|
|
|
|
DotNetBuild ("./source/SkiaSharpSource.Windows.sln", c => {
|
2016-09-19 01:05:58 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
|
|
|
|
|
|
|
// copy the managed views
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.UWP/bin/Release/SkiaSharp.Views.UWP.dll", "./output/uwp/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.UWP/bin/Release/SkiaSharp.Views.UWP.targets", "./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/");
|
2016-09-19 01:05:58 +03:00
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/bin/Release/SkiaSharp.Views.Forms.dll", "./output/portable/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.UWP/bin/Release/SkiaSharp.Views.Forms.dll", "./output/uwp/");
|
|
|
|
|
2016-09-15 10:25:05 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (IsRunningOnUnix ()) {
|
|
|
|
// build
|
|
|
|
RunNuGetRestore ("binding/SkiaSharp.Mac.sln");
|
|
|
|
DotNetBuild ("binding/SkiaSharp.Mac.sln", c => {
|
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
|
|
|
|
|
|
|
// copy build output
|
|
|
|
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/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.OSX/bin/Release/SkiaSharp.dll", "./output/osx/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.OSX/bin/Release/SkiaSharp.OSX.targets", "./output/osx/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Portable/bin/Release/SkiaSharp.dll", "./output/portable/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.dll", "./output/mac/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.Desktop.targets", "./output/mac/");
|
|
|
|
CopyFileToDirectory ("./binding/SkiaSharp.Desktop/bin/Release/SkiaSharp.dll.config", "./output/mac/");
|
2016-09-19 01:05:58 +03:00
|
|
|
|
|
|
|
// build other source
|
2016-09-20 01:37:31 +03:00
|
|
|
RunNuGetRestore ("./source/SkiaSharpSource.Mac.sln");
|
|
|
|
DotNetBuild ("./source/SkiaSharpSource.Mac.sln", c => {
|
2016-09-19 01:05:58 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
|
|
|
|
|
|
|
// copy other outputs
|
|
|
|
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/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.tvOS/bin/Release/SkiaSharp.Views.tvOS.dll", "./output/tvos/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views/SkiaSharp.Views.Mac/bin/Release/SkiaSharp.Views.Mac.dll", "./output/osx/");
|
|
|
|
CopyFileToDirectory ("./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms/bin/Release/SkiaSharp.Views.Forms.dll", "./output/portable/");
|
|
|
|
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/");
|
2016-09-15 10:25:05 +03:00
|
|
|
}
|
2016-02-23 00:14:48 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// TESTS - some test cases to make sure it works
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Task ("tests")
|
|
|
|
.IsDependentOn ("libs")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
2016-02-23 01:18:12 +03:00
|
|
|
RunNuGetRestore ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln");
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
// Windows (x86 and x64)
|
|
|
|
if (IsRunningOnWindows ()) {
|
|
|
|
DotNetBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", c => {
|
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "x86" };
|
|
|
|
});
|
|
|
|
RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x86/Release/SkiaSharp.Desktop.Tests.dll");
|
|
|
|
DotNetBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", c => {
|
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "x64" };
|
|
|
|
});
|
2016-09-14 08:17:32 +03:00
|
|
|
RunTests("./tests/SkiaSharp.Desktop.Tests/bin/x64/Release/SkiaSharp.Desktop.Tests.dll");
|
2016-02-23 00:14:48 +03:00
|
|
|
}
|
|
|
|
// Mac OSX (Any CPU)
|
|
|
|
if (IsRunningOnUnix ()) {
|
|
|
|
DotNetBuild ("./tests/SkiaSharp.Desktop.Tests/SkiaSharp.Desktop.Tests.sln", c => {
|
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
2016-06-03 16:33:14 +03:00
|
|
|
RunTests("./tests/SkiaSharp.Desktop.Tests/bin/AnyCPU/Release/SkiaSharp.Desktop.Tests.dll");
|
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 ();
|
2016-06-15 09:36:03 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
if (IsRunningOnUnix ()) {
|
2016-10-04 18:42:06 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.MacSample/SkiaSharpSample.MacSample.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.MacSample/SkiaSharpSample.MacSample.sln", c => {
|
2016-02-23 00:14:48 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
2016-09-19 01:05:58 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.FormsSample/SkiaSharpSample.FormsSample.Mac.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.FormsSample/SkiaSharpSample.FormsSample.Mac.sln", c => {
|
2016-02-23 00:14:48 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "iPhone" };
|
|
|
|
});
|
2016-09-19 01:05:58 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.TvSample/SkiaSharpSample.TvSample.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.TvSample/SkiaSharpSample.TvSample.sln", c => {
|
2016-06-09 18:07:25 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "iPhoneSimulator" };
|
|
|
|
});
|
2016-02-23 00:14:48 +03:00
|
|
|
}
|
|
|
|
|
2016-06-03 18:32:14 +03:00
|
|
|
if (IsRunningOnWindows ()) {
|
2016-10-04 18:42:06 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.WPFSample/SkiaSharpSample.WPFSample.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.WPFSample/SkiaSharpSample.WPFSample.sln", c => {
|
2016-08-12 12:21:36 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "x86" };
|
|
|
|
});
|
2016-10-04 18:42:06 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.UWPSample/SkiaSharpSample.UWPSample.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.UWPSample/SkiaSharpSample.UWPSample.sln", c => {
|
2016-06-03 18:32:14 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
2016-09-19 01:05:58 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.FormsSample/SkiaSharpSample.FormsSample.Windows.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.FormsSample/SkiaSharpSample.FormsSample.Windows.sln", c => {
|
2016-06-03 18:32:14 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
});
|
2016-10-04 18:42:06 +03:00
|
|
|
RunNuGetRestore ("./samples/SkiaSharpSample.WindowsSample/SkiaSharpSample.WindowsSample.sln");
|
|
|
|
DotNetBuild ("./samples/SkiaSharpSample.WindowsSample/SkiaSharpSample.WindowsSample.sln", c => {
|
2016-08-19 04:28:30 +03:00
|
|
|
c.Configuration = "Release";
|
|
|
|
c.Properties ["Platform"] = new [] { "x86" };
|
|
|
|
});
|
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")
|
2016-09-16 00:03:29 +03:00
|
|
|
.IsDependentOn ("set-versions")
|
2016-02-23 13:57:08 +03:00
|
|
|
.IsDependentOn ("externals-genapi")
|
|
|
|
.Does (() =>
|
|
|
|
{
|
|
|
|
RunMdocUpdate ("./binding/SkiaSharp.Generic/bin/Release/SkiaSharp.dll", "./docs/en/");
|
2016-05-05 04:24:31 +03:00
|
|
|
|
|
|
|
if (!DirectoryExists ("./output/docs/msxml/")) CreateDirectory ("./output/docs/msxml/");
|
|
|
|
RunMdocMSXml ("./docs/en/", "./output/docs/msxml/SkiaSharp.xml");
|
|
|
|
|
|
|
|
if (!DirectoryExists ("./output/docs/mdoc/")) CreateDirectory ("./output/docs/mdoc/");
|
|
|
|
RunMdocAssemble ("./docs/en/", "./output/docs/mdoc/SkiaSharp");
|
2016-02-23 13:57:08 +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
|
|
|
|
if (TARGET == "CI") {
|
2016-05-05 04:24:31 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.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/");
|
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Windows.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Forms.Windows.nuspec", "./output/");
|
|
|
|
}
|
|
|
|
if (IsRunningOnUnix ()) {
|
2016-09-19 01:05:58 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Mac.nuspec", "./output/");
|
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Mac.nuspec", "./output/");
|
2016-09-15 10:25:05 +03:00
|
|
|
PackageNuGet ("./nuget/SkiaSharp.Views.Forms.Mac.nuspec", "./output/");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
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
|
|
|
|
2016-02-23 01:18:12 +03:00
|
|
|
// if (!DirectoryExists ("./output/")) {
|
|
|
|
// CreateDirectory ("./output/");
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 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}";
|
|
|
|
}
|
|
|
|
|
|
|
|
// the versions
|
|
|
|
var version = "1.54.0.0";
|
|
|
|
var fileVersion = "1.54.1.0";
|
|
|
|
var versions = new Dictionary<string, string> {
|
|
|
|
{ "SkiaSharp", "1.54.1" },
|
|
|
|
{ "SkiaSharp.Views", "1.54.1-beta1" },
|
|
|
|
{ "SkiaSharp.Views.Forms", "1.54.1-beta1" },
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
add ("./samples/**/packages.config");
|
|
|
|
add ("./samples/**/project.json");
|
|
|
|
// sample project files
|
|
|
|
add ("./samples/**/*.nuget.targets");
|
|
|
|
add ("./samples/**/*.csproj");
|
|
|
|
// update
|
|
|
|
foreach (var file in files) {
|
|
|
|
UpdateSkiaSharpVersion (file, versions);
|
|
|
|
}
|
|
|
|
|
|
|
|
// assembly infos
|
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./binding/Binding/Properties/SkiaSharpAssemblyInfo.cs",
|
2016-09-16 00:03:29 +03:00
|
|
|
version, fileVersion, sha);
|
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./source/SkiaSharp.Views/SkiaSharp.Views.Shared/Properties/SkiaSharpViewsAssemblyInfo.cs",
|
2016-09-16 00:03:29 +03:00
|
|
|
version, fileVersion, sha);
|
|
|
|
UpdateAssemblyInfo (
|
2016-09-20 01:37:31 +03:00
|
|
|
"./source/SkiaSharp.Views.Forms/SkiaSharp.Views.Forms.Shared/Properties/SkiaSharpViewsFormsAssemblyInfo.cs",
|
2016-09-16 00:03:29 +03:00
|
|
|
version, fileVersion, sha);
|
|
|
|
});
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
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");
|
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");
|
2016-01-15 03:18:32 +03:00
|
|
|
|
2016-09-15 05:08:30 +03:00
|
|
|
CleanDirectories ("./source/*/*/bin");
|
|
|
|
CleanDirectories ("./source/*/*/obj");
|
|
|
|
CleanDirectories ("./source/*/*/Generated Files");
|
2016-09-19 01:05:58 +03:00
|
|
|
CleanDirectories ("./source/packages");
|
2016-09-09 05:40:29 +03:00
|
|
|
|
|
|
|
CleanDirectories ("./samples/BasicSamples/*/bin");
|
|
|
|
CleanDirectories ("./samples/BasicSamples/*/obj");
|
|
|
|
CleanDirectories ("./samples/BasicSamples/*/packages");
|
|
|
|
|
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");
|
|
|
|
|
2016-05-05 04:24:31 +03:00
|
|
|
Task ("Windows-CI")
|
|
|
|
.IsDependentOn ("externals")
|
|
|
|
.IsDependentOn ("libs")
|
2016-06-15 12:02:09 +03:00
|
|
|
.IsDependentOn ("docs")
|
|
|
|
.IsDependentOn ("nuget")
|
|
|
|
.IsDependentOn ("component")
|
2016-05-05 04:24:31 +03:00
|
|
|
.IsDependentOn ("tests")
|
|
|
|
.IsDependentOn ("samples");
|
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// BUILD NOW
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
Information ("Cake.exe ToolPath: {0}", CakeToolPath);
|
|
|
|
Information ("Cake.exe NUnitConsoleToolPath: {0}", NUnitConsoleToolPath);
|
|
|
|
Information ("NuGet.exe ToolPath: {0}", NugetToolPath);
|
|
|
|
Information ("Xamarin-Component.exe ToolPath: {0}", XamarinComponentToolPath);
|
|
|
|
Information ("genapi.exe ToolPath: {0}", GenApiToolPath);
|
2016-01-14 07:42:16 +03:00
|
|
|
|
2016-02-23 00:14:48 +03:00
|
|
|
ListEnvironmentVariables ();
|
2016-01-14 07:42:16 +03:00
|
|
|
|
|
|
|
RunTarget (TARGET);
|