Browse Source

Merge pull request #5481 from rstm-sf/infra/artifacts_controlcatalog

Use ControlCatalog.NetCore as an artifact
Max Katz 4 years ago
parent
commit
bcd2464859

+ 11 - 6
nukebuild/Build.cs

@@ -301,14 +301,19 @@ partial class Build : NukeBuild
         .Executes(() =>
         {
             var data = Parameters;
+            var pathToProjectSource = RootDirectory / "samples" / "ControlCatalog.NetCore";
+            var pathToPublish = pathToProjectSource / "bin" / data.Configuration / "publish";
+
+            DotNetPublish(c => c
+                .SetProject(pathToProjectSource / "ControlCatalog.NetCore.csproj")
+                .EnableNoBuild()
+                .SetConfiguration(data.Configuration)
+                .AddProperty("PackageVersion", data.Version)
+                .AddProperty("PublishDir", pathToPublish));
+
             Zip(data.ZipCoreArtifacts, data.BinRoot);
             Zip(data.ZipNuGetArtifacts, data.NugetRoot);
-            Zip(data.ZipTargetControlCatalogDesktopDir,
-                GlobFiles(data.ZipSourceControlCatalogDesktopDir, "*.dll").Concat(
-                    GlobFiles(data.ZipSourceControlCatalogDesktopDir, "*.config")).Concat(
-                    GlobFiles(data.ZipSourceControlCatalogDesktopDir, "*.so")).Concat(
-                    GlobFiles(data.ZipSourceControlCatalogDesktopDir, "*.dylib")).Concat(
-                    GlobFiles(data.ZipSourceControlCatalogDesktopDir, "*.exe")));
+            Zip(data.ZipTargetControlCatalogNetCoreDir, pathToPublish);
         });
 
     Target CreateIntermediateNugetPackages => _ => _

+ 2 - 5
nukebuild/BuildParameters.cs

@@ -58,8 +58,7 @@ public partial class Build
         public string FileZipSuffix { get; }
         public AbsolutePath ZipCoreArtifacts { get; }
         public AbsolutePath ZipNuGetArtifacts { get; }
-        public AbsolutePath ZipSourceControlCatalogDesktopDir { get; }
-        public AbsolutePath ZipTargetControlCatalogDesktopDir { get; }
+        public AbsolutePath ZipTargetControlCatalogNetCoreDir { get; }
 
 
         public BuildParameters(Build b)
@@ -129,9 +128,7 @@ public partial class Build
             FileZipSuffix = Version + ".zip";
             ZipCoreArtifacts = ZipRoot / ("Avalonia-" + FileZipSuffix);
             ZipNuGetArtifacts = ZipRoot / ("Avalonia-NuGet-" + FileZipSuffix);
-            ZipSourceControlCatalogDesktopDir =
-                RootDirectory / ("samples/ControlCatalog.Desktop/bin/" + DirSuffix + "/net461");
-            ZipTargetControlCatalogDesktopDir = ZipRoot / ("ControlCatalog.Desktop-" + FileZipSuffix);
+            ZipTargetControlCatalogNetCoreDir = ZipRoot / ("ControlCatalog.NetCore-" + FileZipSuffix);
         }
 
         string GetVersion()

+ 5 - 1
samples/ControlCatalog.NetCore/ControlCatalog.NetCore.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <OutputType>Exe</OutputType>
+    <OutputType>WinExe</OutputType>
     <TargetFramework>netcoreapp3.1</TargetFramework>
     <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
   </PropertyGroup>
@@ -15,6 +15,10 @@
     <PackageReference Include="Avalonia.Angle.Windows.Natives" Version="2.1.0.2020091801" />
   </ItemGroup>
 
+  <PropertyGroup>
+    <!-- For Microsoft.CodeAnalysis -->
+    <SatelliteResourceLanguages>en</SatelliteResourceLanguages>
+  </PropertyGroup>
 
   <Import Project="..\..\build\SampleApp.props" />
   <Import Project="..\..\build\ReferenceCoreLibraries.props" />

+ 1 - 1
samples/ControlCatalog/ControlCatalog.csproj

@@ -27,6 +27,6 @@
     <ProjectReference Include="..\..\src\Avalonia.Controls.DataGrid\Avalonia.Controls.DataGrid.csproj" />
     <ProjectReference Include="..\MiniMvvm\MiniMvvm.csproj" />
   </ItemGroup>
-  
+
   <Import Project="..\..\build\BuildTargets.targets" />
 </Project>