From 1a416f330533c33d4946ba46c46099ce9a3afa0d Mon Sep 17 00:00:00 2001
From: cra0zy <cra0zy@gmail.com>
Date: Sun, 29 Oct 2017 00:57:52 +0200
Subject: [PATCH] Move assembly list to a separate file

---
 CakeScripts/Settings.cs | 46 ++++++++++++++++++++++++++++++++++++++
 build.cake              | 49 ++---------------------------------------
 2 files changed, 48 insertions(+), 47 deletions(-)

diff --git a/CakeScripts/Settings.cs b/CakeScripts/Settings.cs
index 972436d03..48d72c531 100755
--- a/CakeScripts/Settings.cs
+++ b/CakeScripts/Settings.cs
@@ -4,4 +4,50 @@ class Settings
     public static ICakeContext Cake { get; set; }
     public static string BuildTarget { get; set; }
     public static string Assembly { get; set; }
+
+    public static List<GAssembly> AssemblyList = new List<GAssembly>()
+    {
+        new GAssembly("GLibSharp")
+        {
+            NativeDeps = new[] {
+                "libglib-2.0.so.0", "libglib-2.0-0",
+                "libgobject-2.0.so.0", "libgobject-2.0-0",
+                "libgthread-2.0.so.0", "libgthread-2.0-0"
+            }
+        },
+        new GAssembly("GioSharp")
+        {
+            Deps = new[] { "GLibSharp" },
+            NativeDeps = new[] { "libgio-2.0.so.0", "libgio-2.0-0" }
+        },
+        new GAssembly("AtkSharp")
+        {
+            Deps = new[] { "GLibSharp" },
+            NativeDeps = new[] { "libatk-1.0.so.0", "libatk-1.0-0" },
+            ExtraArgs = "--abi-cs-usings=Atk,GLib"
+        },
+        new GAssembly("CairoSharp")
+        {
+            NativeDeps = new[] { "libcairo.so.2", "libcairo-2" }
+        },
+        new GAssembly("PangoSharp")
+        {
+            Deps = new[] { "GLibSharp", "CairoSharp" },
+            NativeDeps = new[] { "libpango-1.0.so.0", "libpango-1.0-0" }
+        },
+        new GAssembly("GdkSharp")
+        {
+            Deps = new[] { "GLibSharp", "GioSharp", "CairoSharp", "PangoSharp" },
+            NativeDeps = new[] {
+                "libgdk-3.so.0", "libgdk-3-0",
+                "libgdk_pixbuf-2.0.so.0", "libgdk_pixbuf-2.0-0"
+            }
+        },
+        new GAssembly("GtkSharp")
+        {
+            Deps = new[] { "GLibSharp", "GioSharp", "AtkSharp", "CairoSharp", "PangoSharp", "GdkSharp" },
+            NativeDeps = new[] { "libgtk-3.so.0", "libgtk-3-0" },
+            ExtraArgs = "--abi-cs-usings=Gtk,GLib"
+        }
+    };
 }
\ No newline at end of file
diff --git a/build.cake b/build.cake
index bc8306d52..f26b65253 100755
--- a/build.cake
+++ b/build.cake
@@ -11,51 +11,6 @@ Settings.Assembly = Argument("Assembly", "");
 
 var msbuildsettings = new DotNetCoreMSBuildSettings();
 var list = new List<GAssembly>();
-var glist = new List<GAssembly>()
-{
-    new GAssembly("GLibSharp")
-    {
-        NativeDeps = new[] {
-            "libglib-2.0.so.0", "libglib-2.0-0",
-            "libgobject-2.0.so.0", "libgobject-2.0-0",
-            "libgthread-2.0.so.0", "libgthread-2.0-0"
-        }
-    },
-    new GAssembly("GioSharp")
-    {
-        Deps = new[] { "GLibSharp" },
-        NativeDeps = new[] { "libgio-2.0.so.0", "libgio-2.0-0" }
-    },
-    new GAssembly("AtkSharp")
-    {
-        Deps = new[] { "GLibSharp" },
-        NativeDeps = new[] { "libatk-1.0.so.0", "libatk-1.0-0" },
-        ExtraArgs = "--abi-cs-usings=Atk,GLib"
-    },
-    new GAssembly("CairoSharp")
-    {
-        NativeDeps = new[] { "libcairo.so.2", "libcairo-2" }
-    },
-    new GAssembly("PangoSharp")
-    {
-        Deps = new[] { "GLibSharp", "CairoSharp" },
-        NativeDeps = new[] { "libpango-1.0.so.0", "libpango-1.0-0" }
-    },
-    new GAssembly("GdkSharp")
-    {
-        Deps = new[] { "GLibSharp", "GioSharp", "CairoSharp", "PangoSharp" },
-        NativeDeps = new[] {
-            "libgdk-3.so.0", "libgdk-3-0",
-            "libgdk_pixbuf-2.0.so.0", "libgdk_pixbuf-2.0-0"
-        }
-    },
-    new GAssembly("GtkSharp")
-    {
-        Deps = new[] { "GLibSharp", "GioSharp", "AtkSharp", "CairoSharp", "PangoSharp", "GdkSharp" },
-        NativeDeps = new[] { "libgtk-3.so.0", "libgtk-3-0" },
-        ExtraArgs = "--abi-cs-usings=Gtk,GLib"
-    }
-};
 
 // TASKS
 
@@ -67,7 +22,7 @@ Task("Init")
     msbuildsettings = msbuildsettings.WithProperty("Authors", "'GLibSharp Team'");
 
     // Add stuff to list
-    foreach(var gassembly in glist)
+    foreach(var gassembly in Settings.AssemblyList)
         if(string.IsNullOrEmpty(Settings.Assembly) || Settings.Assembly == gassembly.Name)
             list.Add(gassembly);
 });
@@ -125,7 +80,7 @@ Task("Build")
         MSBuildSettings = msbuildsettings
     };
 
-    if (list.Count == glist.Count)
+    if (list.Count == Settings.AssemblyList.Count)
         DotNetCoreBuild("Source/Libs/GtkSharp.sln", settings);
     else
     {