Skip to content

Commit

Permalink
Added empty projects for the KWin version, to simplify upcoming merges
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingpie committed Jul 14, 2024
1 parent 4a77d31 commit ef34a48
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ jobs:
with:
name: win-x64_framework-dependent.zip
path: _output/artifacts/win-x64_framework-dependent.zip
- name: 'Publish: linux-x64_self-contained.zip'
uses: actions/upload-artifact@v3
with:
name: linux-x64_self-contained.zip
path: _output/artifacts/linux-x64_self-contained.zip
- name: 'Publish: linux-x64_framework-dependent.zip'
uses: actions/upload-artifact@v3
with:
name: linux-x64_framework-dependent.zip
path: _output/artifacts/linux-x64_framework-dependent.zip
6 changes: 6 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
"CreateScoopManifest",
"CreateWinGetManifest",
"PublishDebug",
"PublishLinux64Aot",
"PublishLinux64FrameworkDependent",
"PublishLinux64SelfContained",
"PublishRelease",
"PublishWin64Aot",
"PublishWin64FrameworkDependent",
Expand All @@ -104,6 +107,9 @@
"CreateScoopManifest",
"CreateWinGetManifest",
"PublishDebug",
"PublishLinux64Aot",
"PublishLinux64FrameworkDependent",
"PublishLinux64SelfContained",
"PublishRelease",
"PublishWin64Aot",
"PublishWin64FrameworkDependent",
Expand Down
91 changes: 91 additions & 0 deletions src/01-Build/NukeBuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public sealed class Build : NukeBuild
[Solution(GenerateProjects = true, SuppressBuildProjectCheck = true)]
private readonly Solution Solution;

private AbsolutePath PathToLinux64AotZip => ArtifactsDirectory / $"linux-x64_aot.zip";

private AbsolutePath PathToLinux64FrameworkDependentZip => ArtifactsDirectory / $"linux-x64_framework-dependent.zip";

private AbsolutePath PathToLinux64SelfContainedZip => ArtifactsDirectory / $"linux-x64_self-contained.zip";

private AbsolutePath PathToWin64AotZip => ArtifactsDirectory / $"win-x64_aot.zip";

private AbsolutePath PathToWin64FrameworkDependentZip => ArtifactsDirectory / $"win-x64_framework-dependent.zip";
Expand Down Expand Up @@ -96,6 +102,87 @@ public sealed class Build : NukeBuild
OutputDirectory.CreateOrCleanDirectory();
});

/// <summary>
/// Linux x64 AOT.
/// </summary>
private Target PublishLinux64Aot => _ => _
.DependsOn(Clean)
.Produces(PathToLinux64AotZip)
.Executes(() =>
{
var staging = StagingDirectory / "linux-x64_aot";
DotNetPublish(_ => _
.SetAssemblyVersion(AssemblyVersion)
.SetInformationalVersion(InformationalVersion)
.SetConfiguration(Configuration)
.SetProject(Solution._0_Host.Wtq_Host_Linux)
.SetOutput(staging)
.SetProperty("PublishAot", true)
.SetProperty("InvariantGlobalization", true)
.SetRuntime("linux-x64"));
staging.ZipTo(
PathToLinux64AotZip,
filter: x => x.HasExtension(".exe", ".jsonc"),
compressionLevel: CompressionLevel.SmallestSize,
fileMode: System.IO.FileMode.CreateNew);
});

/// <summary>
/// Linux x64 framework dependent.
/// </summary>
private Target PublishLinux64FrameworkDependent => _ => _
.DependsOn(Clean)
.Produces(PathToLinux64FrameworkDependentZip)
.Executes(() =>
{
var st = StagingDirectory / "linux-x64_framework-dependent";
DotNetPublish(_ => _
.SetAssemblyVersion(AssemblyVersion)
.SetInformationalVersion(InformationalVersion)
.SetConfiguration(Configuration)
.SetProject(Solution._0_Host.Wtq_Host_Linux)
.SetOutput(st)
.SetPublishSingleFile(true)
.SetRuntime("linux-x64")
.SetSelfContained(false));
st.ZipTo(
PathToLinux64FrameworkDependentZip,
filter: x => x.HasExtension(".exe", ".jsonc"),
compressionLevel: CompressionLevel.SmallestSize,
fileMode: System.IO.FileMode.CreateNew);
});

/// <summary>
/// Windows x64 self contained.
/// </summary>
private Target PublishLinux64SelfContained => _ => _
.DependsOn(Clean)
.Produces(PathToLinux64SelfContainedZip)
.Executes(() =>
{
var staging = StagingDirectory / "linux-x64_self-contained";
DotNetPublish(_ => _
.SetAssemblyVersion(AssemblyVersion)
.SetInformationalVersion(InformationalVersion)
.SetConfiguration(Configuration)
.SetProject(Solution._0_Host.Wtq_Host_Linux)
.SetOutput(staging)
.SetPublishSingleFile(true)
.SetRuntime("linux-x64")
.SetSelfContained(true));
staging.ZipTo(
PathToLinux64SelfContainedZip,
filter: x => x.HasExtension(".exe", ".jsonc"),
compressionLevel: CompressionLevel.SmallestSize,
fileMode: System.IO.FileMode.CreateNew);
});

/// <summary>
/// Windows x64 AOT.
/// </summary>
Expand Down Expand Up @@ -288,6 +375,8 @@ await GitHubTasks

private Target PublishDebug => _ => _
.DependsOn(Clean)
.DependsOn(PublishLinux64FrameworkDependent)
.DependsOn(PublishLinux64SelfContained)
.DependsOn(PublishWin64FrameworkDependent)
.DependsOn(PublishWin64SelfContained)
.Triggers(CreateScoopManifest)
Expand All @@ -297,6 +386,8 @@ await GitHubTasks
[SuppressMessage("Major Code Smell", "S1144:Unused private types or members should be removed", Justification = "MvdO: Invoked manually.")]
private Target PublishRelease => _ => _
.DependsOn(Clean)
.DependsOn(PublishLinux64FrameworkDependent)
.DependsOn(PublishLinux64SelfContained)
.DependsOn(PublishWin64FrameworkDependent)
.DependsOn(PublishWin64SelfContained)
.Triggers(CreateScoopManifest)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Wtq.Services.KWin.UnitTest</AssemblyName>
<RootNamespace>Wtq.Services.KWin.UnitTest</RootNamespace>

<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Wtq.Services.KWin\Wtq.Services.KWin.csproj" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions src/20-Services/Wtq.Services.KWin/Wtq.Services.KWin.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Wtq.Services.KWin</AssemblyName>
<RootNamespace>Wtq.Services.KWin</RootNamespace>

<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\10-Core\Wtq\Wtq.csproj" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions src/30-Host/Wtq.Host.Linux/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
global using Ardalis.GuardClauses;
global using System;
global using System.IO;
global using System.Threading.Tasks;
9 changes: 9 additions & 0 deletions src/30-Host/Wtq.Host.Linux/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Wtq.Host.Linux;

public static class Program
{
public static async Task Main(string[] args)
{
Utils.Log.Configure();
}
}
28 changes: 28 additions & 0 deletions src/30-Host/Wtq.Host.Linux/Wtq.Host.Linux.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>wtq</AssemblyName>
<RootNamespace>Wtq.Host.Linux</RootNamespace>

<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>

<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\..\schema\wtq.schema.2.json" Link="wtq.schema.2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<None Include="..\..\wtq.jsonc" Link="wtq.jsonc">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\10-Core\Wtq\Wtq.csproj" />
<ProjectReference Include="..\..\20-Services\Wtq.Services.KWin\Wtq.Services.KWin.csproj" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions src/Wtq.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "01-Build", "01-Build", "{39
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NukeBuild", "01-Build\NukeBuild\NukeBuild.csproj", "{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Host.Linux", "30-Host\Wtq.Host.Linux\Wtq.Host.Linux.csproj", "{8C172C6A-9D45-4307-9043-9CA89B4501A6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Services.KWin", "20-Services\Wtq.Services.KWin\Wtq.Services.KWin.csproj", "{EA8DF436-748C-4A33-8FED-8546B77F65E2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wtq.Services.KWin.UnitTest", "20-Services\Wtq.Services.KWin.UnitTest\Wtq.Services.KWin.UnitTest.csproj", "{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -64,6 +70,18 @@ Global
{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC}.Release|Any CPU.Build.0 = Release|Any CPU
{8C172C6A-9D45-4307-9043-9CA89B4501A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C172C6A-9D45-4307-9043-9CA89B4501A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C172C6A-9D45-4307-9043-9CA89B4501A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C172C6A-9D45-4307-9043-9CA89B4501A6}.Release|Any CPU.Build.0 = Release|Any CPU
{EA8DF436-748C-4A33-8FED-8546B77F65E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA8DF436-748C-4A33-8FED-8546B77F65E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA8DF436-748C-4A33-8FED-8546B77F65E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA8DF436-748C-4A33-8FED-8546B77F65E2}.Release|Any CPU.Build.0 = Release|Any CPU
{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36162B19-1E6F-4DC8-BF04-B0939BC21B8C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -74,6 +92,9 @@ Global
{A806FD73-3CF4-43AF-A9EF-C6258465DB17} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D}
{565A845F-3999-4BBD-9D7D-85A4165E30DD} = {F414F7B7-3276-46DE-B47E-9DA69D56736F}
{F7AFBA04-0770-460B-9FE4-DF120FAAF2EC} = {391579FD-F1D3-4DCB-AC66-AEB9BA845C0D}
{8C172C6A-9D45-4307-9043-9CA89B4501A6} = {F414F7B7-3276-46DE-B47E-9DA69D56736F}
{EA8DF436-748C-4A33-8FED-8546B77F65E2} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D}
{36162B19-1E6F-4DC8-BF04-B0939BC21B8C} = {0818E9B2-260C-40E6-8FE1-96EC3A42B98D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {65349C7B-F6B3-49A8-9935-4ABF9B6D3D70}
Expand Down

0 comments on commit ef34a48

Please sign in to comment.