2017-10-22 23:25:13 +00:00
|
|
|
#load CakeScripts\GAssembly.cs
|
|
|
|
#load CakeScripts\GapiFixup.cs
|
2017-10-25 23:42:57 +00:00
|
|
|
#load CakeScripts\Settings.cs
|
2017-10-22 23:25:13 +00:00
|
|
|
#addin "Cake.FileHelpers"
|
2017-10-25 23:42:57 +00:00
|
|
|
#addin "Cake.Incubator"
|
2017-10-22 23:25:13 +00:00
|
|
|
|
|
|
|
// VARS
|
|
|
|
|
2017-10-25 23:42:57 +00:00
|
|
|
Settings.Cake = Context;
|
|
|
|
Settings.BuildTarget = Argument("BuildTarget", "Default");
|
|
|
|
Settings.Assembly = Argument("Assembly", "");
|
2017-10-22 23:25:13 +00:00
|
|
|
|
|
|
|
var configuration = Argument("Configuration", "Release");
|
2017-10-25 23:42:57 +00:00
|
|
|
var list = new List<GAssembly>();
|
2017-10-22 23:25:13 +00:00
|
|
|
var glist = new List<GAssembly>()
|
|
|
|
{
|
|
|
|
new GAssembly("GLibSharp"),
|
|
|
|
new GAssembly("GioSharp")
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
Deps = new[] { "GLibSharp" }
|
2017-10-22 23:25:13 +00:00
|
|
|
},
|
|
|
|
new GAssembly("AtkSharp")
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
Deps = new[] { "GLibSharp" },
|
2017-10-22 23:25:13 +00:00
|
|
|
ExtraArgs = "--abi-cs-usings=Atk,GLib"
|
|
|
|
},
|
|
|
|
new GAssembly("CairoSharp"),
|
|
|
|
new GAssembly("PangoSharp")
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
Deps = new[] { "GLibSharp", "CairoSharp" }
|
2017-10-22 23:25:13 +00:00
|
|
|
},
|
|
|
|
new GAssembly("GdkSharp")
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
Deps = new[] { "GLibSharp", "GioSharp", "CairoSharp", "PangoSharp" }
|
2017-10-22 23:25:13 +00:00
|
|
|
},
|
|
|
|
new GAssembly("GtkSharp")
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
Deps = new[] { "GLibSharp", "GioSharp", "AtkSharp", "CairoSharp", "PangoSharp", "GdkSharp" },
|
2017-10-22 23:25:13 +00:00
|
|
|
ExtraArgs = "--abi-cs-usings=Gtk,GLib"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// TASKS
|
|
|
|
|
2017-10-25 23:42:57 +00:00
|
|
|
Task("Init")
|
|
|
|
.Does(() =>
|
|
|
|
{
|
|
|
|
// Add stuff to list
|
|
|
|
foreach(var gassembly in glist)
|
|
|
|
if(string.IsNullOrEmpty(Settings.Assembly) || Settings.Assembly == gassembly.Name)
|
|
|
|
list.Add(gassembly);
|
|
|
|
});
|
|
|
|
|
2017-10-22 23:25:13 +00:00
|
|
|
Task("Prepare")
|
2017-10-25 23:42:57 +00:00
|
|
|
.IsDependentOn("Clean")
|
2017-10-22 23:25:13 +00:00
|
|
|
.Does(() =>
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
// Build Tools
|
|
|
|
DotNetCoreRestore("Source/Tools/GapiCodegen/GapiCodegen.csproj");
|
2017-10-22 23:25:13 +00:00
|
|
|
MSBuild("Source/Tools/GapiCodegen/GapiCodegen.csproj", new MSBuildSettings {
|
|
|
|
Verbosity = Verbosity.Minimal,
|
|
|
|
Configuration = "Release",
|
|
|
|
});
|
|
|
|
|
2017-10-25 23:42:57 +00:00
|
|
|
// Generate code and prepare libs projects
|
|
|
|
foreach(var gassembly in list)
|
2017-10-22 23:25:13 +00:00
|
|
|
gassembly.Prepare();
|
2017-10-25 23:42:57 +00:00
|
|
|
DotNetCoreRestore("Source/Libs/GLibSharp.sln");
|
|
|
|
});
|
|
|
|
|
|
|
|
Task("Test")
|
|
|
|
.Does(() =>
|
|
|
|
{
|
|
|
|
|
2017-10-22 23:25:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
Task("Clean")
|
2017-10-25 23:42:57 +00:00
|
|
|
.IsDependentOn("Init")
|
2017-10-22 23:25:13 +00:00
|
|
|
.Does(() =>
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
foreach(var gassembly in list)
|
2017-10-22 23:25:13 +00:00
|
|
|
gassembly.Clean();
|
|
|
|
});
|
|
|
|
|
2017-10-25 23:42:57 +00:00
|
|
|
Task("FullClean")
|
|
|
|
.IsDependentOn("Clean")
|
|
|
|
.Does(() =>
|
|
|
|
{
|
|
|
|
DeleteDirectory("BuildOutput", true);
|
|
|
|
});
|
|
|
|
|
2017-10-22 23:25:13 +00:00
|
|
|
Task("Build")
|
|
|
|
.IsDependentOn("Prepare")
|
|
|
|
.Does(() =>
|
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
if (list.Count == glist.Count)
|
2017-10-22 23:25:13 +00:00
|
|
|
{
|
2017-10-25 23:42:57 +00:00
|
|
|
MSBuild("Source/Libs/GLibSharp.sln", new MSBuildSettings {
|
2017-10-22 23:25:13 +00:00
|
|
|
Verbosity = Verbosity.Minimal,
|
|
|
|
Configuration = "Release",
|
|
|
|
});
|
|
|
|
}
|
2017-10-25 23:42:57 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
foreach(var gassembly in list)
|
|
|
|
{
|
|
|
|
MSBuild(gassembly.Csproj, new MSBuildSettings {
|
|
|
|
Verbosity = Verbosity.Minimal,
|
|
|
|
Configuration = "Release",
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
Task("PackageNuGet")
|
|
|
|
.IsDependentOn("Build")
|
|
|
|
.Does(() =>
|
|
|
|
{
|
|
|
|
var settings = new DotNetCorePackSettings
|
|
|
|
{
|
|
|
|
Configuration = "Release",
|
|
|
|
OutputDirectory = "BuildOutput/NugetPackages",
|
|
|
|
NoBuild = true
|
|
|
|
};
|
|
|
|
|
|
|
|
foreach(var gassembly in list)
|
|
|
|
DotNetCorePack(gassembly.Csproj, settings);
|
2017-10-22 23:25:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// TASK TARGETS
|
|
|
|
|
|
|
|
Task("Default")
|
|
|
|
.IsDependentOn("Build");
|
|
|
|
|
|
|
|
// EXECUTION
|
|
|
|
|
2017-10-25 23:42:57 +00:00
|
|
|
RunTarget(Settings.BuildTarget);
|