mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-06-03 06:12:36 -06:00
68 lines
No EOL
2.2 KiB
C#
68 lines
No EOL
2.2 KiB
C#
using System.Threading.Tasks;
|
|
using static Bullseye.Targets;
|
|
using static Build.Buildary.Directory;
|
|
using static Build.Buildary.Path;
|
|
using static Build.Buildary.Shell;
|
|
using static Build.Buildary.Runner;
|
|
|
|
namespace Build
|
|
{
|
|
static class Program
|
|
{
|
|
static Task<int> Main(string[] args)
|
|
{
|
|
var options = ParseOptions<Options>(args);
|
|
|
|
var commandBuildArgs = $"--configuration {options.Configuration}";
|
|
|
|
Add("clean", () =>
|
|
{
|
|
CleanDirectory(ExpandPath("./output"));
|
|
});
|
|
|
|
Add("test", () =>
|
|
{
|
|
RunShell($"dotnet test src/net/Qt.NetCore.Tests/ {commandBuildArgs}");
|
|
});
|
|
|
|
Add("build", () =>
|
|
{
|
|
// Build the native stuff
|
|
RunShell("./src/native/build.sh");
|
|
// Build the .NETs stuff
|
|
RunShell($"dotnet build src/net/Qt.NetCore.sln {commandBuildArgs}");
|
|
});
|
|
|
|
Add("swig-run", () =>
|
|
{
|
|
var swigCommand = "swig3.0 -csharp -c++ " +
|
|
"-namespace Qt.NetCore " +
|
|
"-outfile Interop.cs " +
|
|
"-outdir src/interop " +
|
|
"-o src/native/QtNetCoreQml/swig.cpp " +
|
|
"-oh src/native/QtNetCoreQml/swig.h " +
|
|
"src/native/QtNetCoreQml/swig/QtNetCoreQml.i";
|
|
RunShell($"docker run -it -v {CurrentDirectory()}:/work net-core-qml-swig {swigCommand}");
|
|
});
|
|
|
|
Add("swig-build", () =>
|
|
{
|
|
RunShell("docker build ./build/docker -f ./build/docker/Dockerfile.swig -t net-core-qml-swig");
|
|
});
|
|
|
|
Add("default", DependsOn("clean", "build"));
|
|
|
|
Add("ci", DependsOn("build", "test"));
|
|
|
|
return Run(options);
|
|
}
|
|
|
|
// ReSharper disable ClassNeverInstantiated.Local
|
|
class Options : RunnerOptions
|
|
// ReSharper restore ClassNeverInstantiated.Local
|
|
{
|
|
[PowerArgs.ArgShortcut("config"), PowerArgs.ArgDefaultValue("Release")]
|
|
public string Configuration { get; set; }
|
|
}
|
|
}
|
|
} |