Skip to content

A Swiss Army knife for developers.

Fixed plugin deployment in CI

Etienne Baudoux34c947b86fcf
diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json
index 40579afa5..b11ef725a 100644
--- a/.nuke/build.schema.json
+++ b/.nuke/build.schema.json
@@ -71,7 +71,7 @@
"enum": [
"CLI",
"Linux",
- "MacCatalyst",
+ "MacOS",
"Wasm",
"Windows"
]
diff --git a/src/app/dev/DevToys.Blazor/DevToys.Blazor.csproj b/src/app/dev/DevToys.Blazor/DevToys.Blazor.csproj
index 9d81829eb..36db0125a 100644
--- a/src/app/dev/DevToys.Blazor/DevToys.Blazor.csproj
+++ b/src/app/dev/DevToys.Blazor/DevToys.Blazor.csproj
@@ -47,7 +47,6 @@
<ItemGroup>
<EmbeddedResource Include="Assets\fonts\FluentSystemIcons-Regular.ttf">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
- <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</EmbeddedResource>
<EmbeddedResource Include="Assets\samples\json-sample.json" />
<EmbeddedResource Update="BuiltInTools\ExtensionsManager\ExtensionsManager.resx">
diff --git a/src/app/dev/platforms/desktop/DevToys.CLI/DevToys.CLI.csproj b/src/app/dev/platforms/desktop/DevToys.CLI/DevToys.CLI.csproj
index 0b2233d0b..30ca5bd18 100644
--- a/src/app/dev/platforms/desktop/DevToys.CLI/DevToys.CLI.csproj
+++ b/src/app/dev/platforms/desktop/DevToys.CLI/DevToys.CLI.csproj
@@ -4,6 +4,9 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCore)</TargetFramework>
<UseAppHost>True</UseAppHost>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="$(_IsPublishing) == ''">
<PluginsInstallationFolder>$(OutputPath)\$(TargetFramework)\Plugins</PluginsInstallationFolder>
</PropertyGroup>
diff --git a/src/app/dev/platforms/desktop/DevToys.Linux/DevToys.Linux.csproj b/src/app/dev/platforms/desktop/DevToys.Linux/DevToys.Linux.csproj
index 4e09aaadd..827d98512 100644
--- a/src/app/dev/platforms/desktop/DevToys.Linux/DevToys.Linux.csproj
+++ b/src/app/dev/platforms/desktop/DevToys.Linux/DevToys.Linux.csproj
@@ -3,6 +3,9 @@
<TargetFramework>$(NetCore)</TargetFramework>
<OutputType>Exe</OutputType>
<DefineConstants>$(DefineConstants);__LINUX__</DefineConstants>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="$(_IsPublishing) == ''">
<PluginsInstallationFolder>$(OutputPath)\$(TargetFramework)\Plugins</PluginsInstallationFolder>
</PropertyGroup>
diff --git a/src/app/dev/platforms/desktop/DevToys.MacOS/DevToys.MacOS.csproj b/src/app/dev/platforms/desktop/DevToys.MacOS/DevToys.MacOS.csproj
index b9d90e977..4437daa38 100644
--- a/src/app/dev/platforms/desktop/DevToys.MacOS/DevToys.MacOS.csproj
+++ b/src/app/dev/platforms/desktop/DevToys.MacOS/DevToys.MacOS.csproj
@@ -7,7 +7,6 @@
<RootNamespace>DevToys.MacOS</RootNamespace>
<EnableDefaultCssItems>false</EnableDefaultCssItems>
<DefineConstants>$(DefineConstants);__MACOS__</DefineConstants>
- <PluginsInstallationFolder>$(OutputPath)\$(TargetFramework)\Plugins</PluginsInstallationFolder>
<!-- The default runtime is osx-x64, except in Release config, in which case the default is osx-x64;osx-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifer>.
@@ -23,6 +22,10 @@
<ApplicationId>com.devtoys</ApplicationId>
</PropertyGroup>
+ <PropertyGroup Condition="$(_IsPublishing) == ''">
+ <PluginsInstallationFolder>$(OutputPath)\$(TargetFramework)\Plugins</PluginsInstallationFolder>
+ </PropertyGroup>
+
<!-- Notes about the values set below:
1. For macOS it's possible to sign both the app bundle (EnableCodesigning=true) and the package (*.pkg) (EnablePackageSigning=true),
and these are signed separately and with different certificates.
diff --git a/src/app/dev/platforms/desktop/DevToys.Windows/DevToys.Windows.csproj b/src/app/dev/platforms/desktop/DevToys.Windows/DevToys.Windows.csproj
index 914e94740..195e68bf0 100644
--- a/src/app/dev/platforms/desktop/DevToys.Windows/DevToys.Windows.csproj
+++ b/src/app/dev/platforms/desktop/DevToys.Windows/DevToys.Windows.csproj
@@ -9,6 +9,9 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
+ </PropertyGroup>
+
+ <PropertyGroup Condition="$(_IsPublishing) == ''">
<PluginsInstallationFolder>$(OutputPath)\$(TargetFramework)\Plugins</PluginsInstallationFolder>
</PropertyGroup>
diff --git a/src/app/dev/platforms/desktop/Directory.Build.props b/src/app/dev/platforms/desktop/Directory.Build.props
index 17b73bfe1..0d618414d 100644
--- a/src/app/dev/platforms/desktop/Directory.Build.props
+++ b/src/app/dev/platforms/desktop/Directory.Build.props
@@ -1,18 +1,13 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
+ <PropertyGroup Condition="$(_IsPublishing) == 'true'">
+ <PluginsInstallationFolder>$(PublishDir)\Plugins</PluginsInstallationFolder>
+ </PropertyGroup>
+
<ItemGroup>
<!-- HACK: This force MSBuild to check whether we rebuilt a plugin. If yes, then it forces to rebuild the current
project and unpack the nupkg so we can debug a change we made to an extension. -->
<UpToDateCheckInput Include="$(PluginNupkgPath)\**\*.nupkg" />
</ItemGroup>
-
- <!-- Include DevToys.Tools and other plugins to the output -->
- <!--<ItemGroup>
- <Content Include="$(RepoRoot)bin\$(Configuration)\Plugins\**\*"
- Exclude="$(RepoRoot)bin\$(Configuration)\Plugins\**\*.nupkg"
- Link="Plugins\%(RecursiveDir)%(Filename)%(Extension)">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>-->
</Project>
\ No newline at end of file
diff --git a/src/app/dev/platforms/desktop/Directory.Build.targets b/src/app/dev/platforms/desktop/Directory.Build.targets
index a5f3f02ee..775e40aa5 100644
--- a/src/app/dev/platforms/desktop/Directory.Build.targets
+++ b/src/app/dev/platforms/desktop/Directory.Build.targets
@@ -1,7 +1,7 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
- <Target Name="ImportPluginOnBuild" BeforeTargets="CheckForDuplicateItems">
+ <Target Name="ImportPluginOnBuild" BeforeTargets="CheckForDuplicateItems" Condition="$(_IsPublishing) == ''">
<CallTarget Targets="ImportPlugins" />
</Target>
diff --git a/src/build/Build.cs b/src/build/Build.cs
index e1bf80cac..70eab9ad4 100644
--- a/src/build/Build.cs
+++ b/src/build/Build.cs
@@ -60,11 +60,11 @@ class Build : NukeBuild
if (PlatformTargets.Contains(PlatformTarget.Windows) && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 0, 0))
{
- Assert.Fail("To build Windows WASDK app, you need to run on Windows 10 or later.");
+ Assert.Fail("To build Windows app, you need to run on Windows 10 or later.");
return;
}
- if (PlatformTargets.Contains(PlatformTarget.MacCatalyst) && !OperatingSystem.IsMacOS())
+ if (PlatformTargets.Contains(PlatformTarget.MacOS) && !OperatingSystem.IsMacOS())
{
Assert.Fail("To build macOS app, you need to run on macOS Ventura 13.1 or later.");
return;
@@ -191,7 +191,7 @@ class Build : NukeBuild
PublishWindowsApp();
}
- if (PlatformTargets!.Contains(PlatformTarget.MacCatalyst))
+ if (PlatformTargets!.Contains(PlatformTarget.MacOS))
{
PublishMacApp();
}
@@ -324,14 +324,14 @@ class Build : NukeBuild
project = WindowsSolution!.GetAllProjects(publishProject).Single();
foreach (string targetFramework in project.GetTargetFrameworks())
{
- yield return new DotnetParameters(project.Path, "win10-x64", targetFramework, portable: false);
- yield return new DotnetParameters(project.Path, "win10-x64", targetFramework, portable: true);
+ yield return new DotnetParameters(project.Path, "win-x64", targetFramework, portable: false);
+ yield return new DotnetParameters(project.Path, "win-x64", targetFramework, portable: true);
- yield return new DotnetParameters(project.Path, "win10-arm64", targetFramework, portable: false);
- yield return new DotnetParameters(project.Path, "win10-arm64", targetFramework, portable: true);
+ yield return new DotnetParameters(project.Path, "win-arm64", targetFramework, portable: false);
+ yield return new DotnetParameters(project.Path, "win-arm64", targetFramework, portable: true);
- yield return new DotnetParameters(project.Path, "win10-x86", targetFramework, portable: false);
- yield return new DotnetParameters(project.Path, "win10-x86", targetFramework, portable: true);
+ yield return new DotnetParameters(project.Path, "win-x86", targetFramework, portable: false);
+ yield return new DotnetParameters(project.Path, "win-x86", targetFramework, portable: true);
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
@@ -351,13 +351,13 @@ class Build : NukeBuild
project = WindowsSolution!.GetAllProjects(publishProject).Single();
foreach (string targetFramework in project.GetTargetFrameworks())
{
- yield return new DotnetParameters(project.Path, "win10-arm64", targetFramework, portable: false, platform: "arm64");
- yield return new DotnetParameters(project.Path, "win10-x64", targetFramework, portable: false, platform: "x64");
- yield return new DotnetParameters(project.Path, "win10-x86", targetFramework, portable: false, platform: "x86");
+ yield return new DotnetParameters(project.Path, "win-arm64", targetFramework, portable: false, platform: "arm64");
+ yield return new DotnetParameters(project.Path, "win-x64", targetFramework, portable: false, platform: "x64");
+ yield return new DotnetParameters(project.Path, "win-x86", targetFramework, portable: false, platform: "x86");
- yield return new DotnetParameters(project.Path, "win10-arm64", targetFramework, portable: true, platform: "arm64");
- yield return new DotnetParameters(project.Path, "win10-x64", targetFramework, portable: true, platform: "x64");
- yield return new DotnetParameters(project.Path, "win10-x86", targetFramework, portable: true, platform: "x86");
+ yield return new DotnetParameters(project.Path, "win-arm64", targetFramework, portable: true, platform: "arm64");
+ yield return new DotnetParameters(project.Path, "win-x64", targetFramework, portable: true, platform: "x64");
+ yield return new DotnetParameters(project.Path, "win-x86", targetFramework, portable: true, platform: "x86");
}
}
else
diff --git a/src/build/PlatformTarget.cs b/src/build/PlatformTarget.cs
index f40322a65..4b30f8c2d 100644
--- a/src/build/PlatformTarget.cs
+++ b/src/build/PlatformTarget.cs
@@ -1,7 +1,7 @@
enum PlatformTarget
{
Windows,
- MacCatalyst,
+ MacOS,
CLI,
Wasm,
Linux // TODO: https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/#prerequisites