From 4710fa1d067f0e2bbbb83604bb6d13621e090513 Mon Sep 17 00:00:00 2001
From: Harry <harry.cpp@outlook.com>
Date: Wed, 26 Jan 2022 21:15:32 +0100
Subject: [PATCH] Upgrade CAKE build system (#325)

* Upgrade CAKE build system

* fix paths
---
 .DS_Store                                     | Bin 0 -> 8196 bytes
 Source/Templates/Directory.Build.props        |  16 ++++++
 .../GtkSharp.Template.CSharp.csproj           |  17 ++++++
 .../GtkSharp.Template.CSharp.nuspec           |  20 -------
 .../GtkSharp.Template.FSharp.csproj           |  17 ++++++
 .../GtkSharp.Template.FSharp.nuspec           |  20 -------
 .../GtkSharp.Template.VBNet.csproj            |  17 ++++++
 .../GtkSharp.Template.VBNet.nuspec            |  20 -------
 build.cake                                    |  49 ++++++++----------
 9 files changed, 89 insertions(+), 87 deletions(-)
 create mode 100644 .DS_Store
 create mode 100644 Source/Templates/Directory.Build.props
 create mode 100644 Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.csproj
 delete mode 100644 Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec
 create mode 100644 Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.csproj
 delete mode 100644 Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.nuspec
 create mode 100644 Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.csproj
 delete mode 100644 Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec

diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..43d893b9e912fee6481f6ab87e40f57adb18f579
GIT binary patch
literal 8196
zcmeHM&ubGw6n>MY&4wUEu}}}fTCYJ9OH08^OygN_MG=*lZDO)?vlFtL=1>B`t39c=
zdh#N86Y)^=QUr@Pz36|SpdjK&@Zy^vO=dS;bE=BYz|7ms``*kq-%MwAwg5m%-C6-)
z4gd_y%w{uK?30+E<*}5IHS=f*#sk#dM!{O8t@apJS7-&a0$KsBfL1^&@OLPHXEsYl
z%(*YTy3`721^!C~*#2N*X0|BpKv=$YV8O2dXp>mY6F%cTfXA597Ns2s%R{kEaeE*#
zl*lUv5#i`J860g<+JUel9Eb=9B6}wChC+Dn7-w=gkfN}<)Cy<?#ub>ys%ba{t5Ait
z$o>8B=F_mZMayN|r8d?YSGWA#&u?Cyiy~?h5bdV&h2RMPYfbU~DR^)T9B4$oAw0nz
zA_$eo+u7`K$zu#P;u4Pv@e!L(68SWcNuV-Gyt?-YnGAg@hua^%ef%P{Q2e9b_w%d$
zCf?_<X+BEcFEpVGw%R-Hw4cTiDu=nHkPb>aEjnTnk5c)_J)G&e4nD383bn}Efb;{&
zM?t83PHaEE|4e8SX-DM~j|%hQ`edMlx;Wq>n+y09K%13z&u`0Bxox*y#}D%PcO)^D
zoSsP;DI;Utu$r`I1=XPIm#Up>?AIkqU3>4jYF~Ehy-N1z3iX1j<JCJnz^T;{a{Y?q
z)o8CoyI#%bv6gTcX(L_99^2ShSX|1P3ul)5Idh|s&oAW6#X`Q{PaCr*PoKS5S#w(+
zy~E}gPbGPJ!6ET`SZ?A|%<#g?;Ky=2Qk8$}`Q7hwNyfCRPQzq$XgU(VnvQj=<GIvp
zAWt^h46KN)1uR@h9h|;4PMjYeRkj$9R7aHxhKoF=U3FBG(V<a+i6meKc~V?f9b_B&
zoJl%6J5j&N?cob^S1$Na8!DqXjLL(&{>pghq!l<|1*Sy%bL{?qKK}dv0khD}YX!6d
ze^LRGEL-IgGT3`NiIQP=Z4>iN%q%h7Kv*7v1%t49ejP_U{D&bvo6=X5b|5TzF#Y}y
b0m@s5dhSY|p|e|kOVQ^)pD$hf8w&gcZ2^n$

literal 0
HcmV?d00001

diff --git a/Source/Templates/Directory.Build.props b/Source/Templates/Directory.Build.props
new file mode 100644
index 000000000..7ec9ecabb
--- /dev/null
+++ b/Source/Templates/Directory.Build.props
@@ -0,0 +1,16 @@
+<Project>
+  <PropertyGroup>
+    <PackageType>Template</PackageType>
+    <TargetFramework>netstandard2.0</TargetFramework>
+    <PackageIcon>Icon.png</PackageIcon>
+    <Authors>GtkSharp Contributors</Authors>
+    <PackageProjectUrl>https://github.com/GtkSharp/GtkSharp</PackageProjectUrl>
+    <RepositoryUrl>https://github.com/GtkSharp/GtkSharp</RepositoryUrl>
+    <OutputPath>..\..\..\BuildOutput\$(Configuration)</OutputPath>
+    <IncludeContentInPack>true</IncludeContentInPack>
+    <IncludeBuildOutput>false</IncludeBuildOutput>
+    <ContentTargetFolders>content</ContentTargetFolders>
+    <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
+    <NoWarn>NU5128</NoWarn>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
diff --git a/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.csproj b/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.csproj
new file mode 100644
index 000000000..a5fa3035f
--- /dev/null
+++ b/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.csproj
@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Title>Gtk templates for CSharp</Title>
+    <PackageId>GtkSharp.Template.CSharp</PackageId>
+    <Description>A set of C# templates for your .Net Gtk Application.</Description>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Content Include="content/**/*" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Include="$(MSBuildThisFileDirectory)../../Libs/GtkSharp/Icon.png" Pack="true" PackagePath="\" />
+  </ItemGroup>
+
+</Project>
\ No newline at end of file
diff --git a/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec b/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec
deleted file mode 100644
index 70efccdc2..000000000
--- a/Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package>
-  <metadata>
-    <id>GtkSharp.Template.CSharp</id>
-    <version>3.0.0</version>
-    <title>Gtk templates for CSharp</title>
-    <iconUrl>https://raw.githubusercontent.com/GtkSharp/GtkSharp/develop/Source/Libs/GtkSharp/Icon.png</iconUrl>
-    <summary>A set of C# templates for your .Net Core Gtk Application.</summary>
-    <description>A set of C# templates for your .Net Core Gtk Application.</description>
-    <authors>GtkSharp Contributors</authors>
-    <owners>GtkSharp Contributors</owners>
-    <projectUrl>https://github.com/GtkSharp/GtkSharp</projectUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <releaseNotes></releaseNotes>
-    <tags>gtk gtksharp gtk-sharp app dotnet new template c# csharp</tags>
-    <packageTypes>
-      <packageType name="Template" />
-    </packageTypes>
-  </metadata>
-</package>
diff --git a/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.csproj b/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.csproj
new file mode 100644
index 000000000..a0ae7d1c7
--- /dev/null
+++ b/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.csproj
@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Title>Gtk templates for FSharp</Title>
+    <PackageId>GtkSharp.Template.FSharp</PackageId>
+    <Description>A set of F# templates for your .Net Gtk Application.</Description>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Content Include="content/**/*" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Include="$(MSBuildThisFileDirectory)../../Libs/GtkSharp/Icon.png" Pack="true" PackagePath="\" />
+  </ItemGroup>
+
+</Project>
\ No newline at end of file
diff --git a/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.nuspec b/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.nuspec
deleted file mode 100644
index 07b237949..000000000
--- a/Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.nuspec
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package>
-  <metadata>
-    <id>GtkSharp.Template.FSharp</id>
-    <version>3.0.0</version>
-    <title>Gtk templates for FSharp</title>
-    <iconUrl>https://raw.githubusercontent.com/GtkSharp/GtkSharp/develop/Source/Libs/GtkSharp/Icon.png</iconUrl>
-    <summary>A set of F# templates for your .Net Core Gtk Application.</summary>
-    <description>A set of F# templates for your .Net Core Gtk Application.</description>
-    <authors>GtkSharp Contributors</authors>
-    <owners>GtkSharp Contributors</owners>
-    <projectUrl>https://github.com/GtkSharp/GtkSharp</projectUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <releaseNotes></releaseNotes>
-    <tags>gtk gtksharp gtk-sharp app dotnet new template f# fsharp</tags>
-    <packageTypes>
-      <packageType name="Template" />
-    </packageTypes>
-  </metadata>
-</package>
diff --git a/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.csproj b/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.csproj
new file mode 100644
index 000000000..7b93a56ae
--- /dev/null
+++ b/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.csproj
@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <Title>Gtk templates for Visual Basic</Title>
+    <PackageId>GtkSharp.Template.VBNet</PackageId>
+    <Description>A set of Visual Basic templates for your .Net Gtk Application.</Description>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Content Include="content/**/*" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <None Include="$(MSBuildThisFileDirectory)../../Libs/GtkSharp/Icon.png" Pack="true" PackagePath="\" />
+  </ItemGroup>
+
+</Project>
\ No newline at end of file
diff --git a/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec b/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec
deleted file mode 100644
index 3470bd1f6..000000000
--- a/Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package>
-  <metadata>
-    <id>GtkSharp.Template.VBNet</id>
-    <version>3.0.0</version>
-    <title>Gtk templates for VBNet</title>
-    <iconUrl>https://raw.githubusercontent.com/GtkSharp/GtkSharp/develop/Source/Libs/GtkSharp/Icon.png</iconUrl>
-    <summary>A set of VB templates for your .Net Core Gtk Application.</summary>
-    <description>A set of VB templates for your .Net Core Gtk Application.</description>
-    <authors>GtkSharp Contributors</authors>
-    <owners>GtkSharp Contributors</owners>
-    <projectUrl>https://github.com/GtkSharp/GtkSharp</projectUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <releaseNotes></releaseNotes>
-    <tags>gtk gtksharp gtk-sharp app dotnet new template vbnet vb</tags>
-    <packageTypes>
-      <packageType name="Template" />
-    </packageTypes>
-  </metadata>
-</package>
diff --git a/build.cake b/build.cake
index b43b77565..0b9c6d7c9 100644
--- a/build.cake
+++ b/build.cake
@@ -11,7 +11,7 @@ Settings.BuildTarget = Argument("BuildTarget", "Default");
 Settings.Assembly = Argument("Assembly", "");
 var configuration = Argument("Configuration", "Release");
 
-var msbuildsettings = new DotNetCoreMSBuildSettings();
+var msbuildsettings = new DotNetMSBuildSettings();
 var list = new List<GAssembly>();
 
 // TASKS
@@ -46,19 +46,19 @@ Task("Prepare")
     .Does(() =>
 {
     // Build tools
-    DotNetCoreRestore("Source/Tools/Tools.sln");
-    DotNetCoreBuild("Source/Tools/Tools.sln", new DotNetCoreBuildSettings {
-        Verbosity = DotNetCoreVerbosity.Minimal,
+    DotNetRestore("Source/Tools/Tools.sln");
+    DotNetBuild("Source/Tools/Tools.sln", new DotNetBuildSettings {
+        Verbosity = DotNetVerbosity.Minimal,
         Configuration = configuration
     });
 
     // Generate code and prepare libs projects
     foreach(var gassembly in list)
         gassembly.Prepare();
-    DotNetCoreRestore("Source/GtkSharp.sln");
+    DotNetRestore("Source/GtkSharp.sln");
 
     // Addin
-    DotNetCoreRestore("Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln");
+    DotNetRestore("Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln");
 });
 
 Task("Clean")
@@ -83,18 +83,18 @@ Task("Build")
     .IsDependentOn("Prepare")
     .Does(() =>
 {
-    var settings = new DotNetCoreBuildSettings
+    var settings = new DotNetBuildSettings
     {
         Configuration = configuration,
         MSBuildSettings = msbuildsettings
     };
 
     if (list.Count == Settings.AssemblyList.Count)
-        DotNetCoreBuild("Source/GtkSharp.sln", settings);
+        DotNetBuild("Source/GtkSharp.sln", settings);
     else
     {
         foreach(var gassembly in list)
-            DotNetCoreBuild(gassembly.Csproj, settings);
+            DotNetBuild(gassembly.Csproj, settings);
     }
 });
 
@@ -102,51 +102,46 @@ Task("RunSamples")
     .IsDependentOn("Build")
     .Does(() =>
 {
-    var settings = new DotNetCoreBuildSettings
+    var settings = new DotNetBuildSettings
     {
         Configuration = configuration,
         MSBuildSettings = msbuildsettings
     };
 
-    DotNetCoreBuild("Source/Samples/Samples.csproj", settings);
-    DotNetCoreRun("Source/Samples/Samples.csproj");
+    DotNetBuild("Source/Samples/Samples.csproj", settings);
+    DotNetRun("Source/Samples/Samples.csproj");
 });
 
 Task("PackageNuGet")
     .IsDependentOn("Build")
     .Does(() =>
 {
-    var settings = new DotNetCorePackSettings
+    var settings = new DotNetPackSettings
     {
         MSBuildSettings = msbuildsettings,
         Configuration = configuration,
         OutputDirectory = "BuildOutput/NugetPackages",
-        NoBuild = true,
-
+        NoBuild = true
     };
 
     foreach(var gassembly in list)
-        DotNetCorePack(gassembly.Csproj, settings);
+        DotNetPack(gassembly.Csproj, settings);
 });
 
 Task("PackageTemplates")
     .IsDependentOn("Init")
     .Does(() =>
 {
-    var settings = new NuGetPackSettings
+    var settings = new DotNetPackSettings
     {
-        OutputDirectory = "BuildOutput/NugetPackages",
-        Version = Settings.Version
+        MSBuildSettings = msbuildsettings,
+        Configuration = configuration,
+        OutputDirectory = "BuildOutput/NugetPackages"
     };
 
-    settings.BasePath = "Source/Templates/GtkSharp.Template.CSharp";
-    NuGetPack("Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.nuspec", settings);
-
-    settings.BasePath = "Source/Templates/GtkSharp.Template.FSharp";
-    NuGetPack("Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.nuspec", settings);
-
-    settings.BasePath = "Source/Templates/GtkSharp.Template.VBNet";
-    NuGetPack("Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec", settings);
+    DotNetPack("Source/Templates/GtkSharp.Template.CSharp/GtkSharp.Template.CSharp.csproj", settings);
+    DotNetPack("Source/Templates/GtkSharp.Template.FSharp/GtkSharp.Template.FSharp.csproj", settings);
+    DotNetPack("Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.csproj", settings);
 });
 
 // TASK TARGETS