Skip to content

Commit

Permalink
build: Pack Haiku API as standalone package
Browse files Browse the repository at this point in the history
This package would be useful for users who do not wish to install
the full workload.
  • Loading branch information
trungnt2910 committed Jul 22, 2023
1 parent ce1ec1e commit a352d23
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 15 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,36 @@ Task("GenerateBindings")
DotNetRun($"generator/HaikuApiGenerator/HaikuApiGenerator.csproj", runSettings);
});

Task("BuildCoreLibraries")
Task("BuildAndPackCoreLibraries")
.IsDependentOn("GenerateBindings")
.Does(() =>
{
var settings = new DotNetBuildSettings
var buildSettings = new DotNetBuildSettings
{
Configuration = configuration,
MSBuildSettings = msbuildsettings,
NoRestore = true
};
var packSettings = new DotNetPackSettings
{
Configuration = configuration,
MSBuildSettings = msbuildsettings,
OutputDirectory = "out/nuget",
NoRestore = true,
NoBuild = true,
NoDependencies = true
};
foreach (var name in coreLibraryNames)
{
DotNetBuild($"src/{name}/{name}.csproj", settings);
DotNetBuild($"src/{name}/{name}.csproj", buildSettings);
DotNetPack($"src/{name}/{name}.csproj", packSettings);
}
});

Task("BuildAndPackageWorkload")
.IsDependentOn("BuildCoreLibraries")
.IsDependentOn("BuildAndPackCoreLibraries")
.Does(() =>
{
var buildSettings = new DotNetBuildSettings
Expand Down
6 changes: 6 additions & 0 deletions src/Haiku/Haiku.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<Compile Include="$(_HaikuRootDirectory)/external/CppSharp/src/Runtime/*.cs" />
</ItemGroup>

<ItemGroup>
<None Include="$(_HaikuRootDirectory)/out/generated/libHaikuGlue.so"
CopyToOutputDirectory="PreserveNewest" Link="runtimes/haiku-x64/native/libHaikuGlue.so"
Pack="true" PackagePath="runtimes/haiku-x64/native/libHaikuGlue.so" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(_HaikuRootDirectory)/generator/HaikuApiGenerator.PostProcessing/HaikuApiGenerator.PostProcessing.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>
Expand Down

0 comments on commit a352d23

Please sign in to comment.