diff --git a/.gitignore b/.gitignore index bc4577c78..321054749 100755 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ BuildOutput/ Generated/ +AddinInfo.Version.cs ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDesktopApplication.cs b/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDesktopApplication.cs index 411f7651a..fe30e6b6e 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDesktopApplication.cs +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDesktopApplication.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using DBus; -using MonoDevelop.Ide.Commands; +using System.Diagnostics; using MonoDevelop.Ide.Desktop; namespace MonoDevelop.GtkSharp.Addin @@ -19,35 +14,7 @@ namespace MonoDevelop.GtkSharp.Addin public override void Launch(params string[] files) { - try - { - if (Environment.OSVersion.Platform != PlatformID.Win32NT) - { - var bus = Bus.Session.GetObject("org.freedesktop.Flatpak", new ObjectPath("/org/freedesktop/Flatpak/Development")); - - if (bus != null) - { - var pid = bus.HostCommand( - new byte[0], - new byte[][] { - Encoding.ASCII.GetBytes ("xdg-open\0"), - Encoding.ASCII.GetBytes (_filename + "\0") - }, - new Dictionary { }, - new Dictionary { }, - 0 - ); - - return; - } - } - - Process.Start(_filename); - } - catch (Exception ex) - { - Console.WriteLine(ex); - } + Process.Start("glade", _filename); } } -} +} \ No newline at end of file diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDisplayBindings.cs b/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDisplayBindings.cs index 476dc36f0..462fef95d 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDisplayBindings.cs +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/GladeDisplayBindings.cs @@ -1,4 +1,4 @@ -using MonoDevelop.Core; +using MonoDevelop.Core; using MonoDevelop.Ide.Desktop; using MonoDevelop.Ide.Gui; using MonoDevelop.Projects; @@ -19,4 +19,4 @@ namespace MonoDevelop.GtkSharp.Addin return new GladeDesktopApplication(fileName.FullPath); } } -} +} \ No newline at end of file diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.csproj b/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.csproj index cabcbf834..d40329dd2 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.csproj +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.csproj @@ -1,88 +1,88 @@ - - - - - Debug - AnyCPU - {52AC8491-F6B7-4631-92BA-D5E95A091B74} - {86F6BF2A-E449-4B3E-813B-9ACC37E5545F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - MonoDevelop.GtkSharp.Addin - MonoDevelop.GtkSharp.Addin - v4.5 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - - - true - bin\Release - prompt - 4 - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - References\dbus-sharp.dll - - - - - - + + + net461 + ..\..\..\BuildOutput\Addins\MonoDevelop\ + false + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + + + + diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln b/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln index cf3f93e71..33aebb9b1 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GtkSharp.Addin", "MonoDevelop.GtkSharp.Addin.csproj", "{52AC8491-F6B7-4631-92BA-D5E95A091B74}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GtkSharp.Addin", "MonoDevelop.GtkSharp.Addin.csproj", "{F58399F1-E539-4625-873D-90045BDB519E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -9,9 +9,9 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52AC8491-F6B7-4631-92BA-D5E95A091B74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52AC8491-F6B7-4631-92BA-D5E95A091B74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52AC8491-F6B7-4631-92BA-D5E95A091B74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52AC8491-F6B7-4631-92BA-D5E95A091B74}.Release|Any CPU.Build.0 = Release|Any CPU + {F58399F1-E539-4625-873D-90045BDB519E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F58399F1-E539-4625-873D-90045BDB519E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F58399F1-E539-4625-873D-90045BDB519E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F58399F1-E539-4625-873D-90045BDB519E}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AddinInfo.cs b/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AddinInfo.cs index f20be4ebc..4a55ac8e4 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AddinInfo.cs +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AddinInfo.cs @@ -1,12 +1,10 @@ -using Mono.Addins; +using Mono.Addins; using Mono.Addins.Description; -[assembly: Addin("MonoDevelop.GtkSharp.Addin", Version="1.0")] - -[assembly: AddinName("Gtk# Addin")] +[assembly: AddinName("GtkSharp Addin")] [assembly: AddinCategory("IDE extensions")] -[assembly: AddinDescription("Provides modern Gtk# file / project templates and glade file integration.")] -[assembly: AddinAuthor("cra0zy")] +[assembly: AddinDescription("Provides modern Gtk project and file templates, as well as glade file integration.")] +[assembly: AddinAuthor("GtkSharp Contributors")] [assembly: AddinUrl("https://github.com/GtkSharp/GtkSharp")] [assembly: AddinDependency("MonoDevelop.Core", MonoDevelop.BuildInfo.Version)] diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AssemblyInfo.cs b/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AssemblyInfo.cs deleted file mode 100644 index 4de068b3d..000000000 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("MonoDevelop.GtkSharp.Addin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("${AuthorCopyright}")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/Manifest.addin.xml b/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/Manifest.addin.xml index 2d187ddda..28866853d 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/Manifest.addin.xml +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/Manifest.addin.xml @@ -1,20 +1,28 @@ - + - - + + - - - + + + + + + + + + + + @@ -28,32 +36,34 @@ - + diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Widget.FS.xft.xml b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Widget.FS.xft.xml new file mode 100644 index 000000000..8154d7f93 --- /dev/null +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Widget.FS.xft.xml @@ -0,0 +1,16 @@ + + diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.CS.xft.xml b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.CS.xft.xml index 833f54b59..108622e15 100644 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.CS.xft.xml +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.CS.xft.xml @@ -3,14 +3,14 @@ <_Name>Window md-gui-file - <_Category>Gtk# + <_Category>Gtk C# MyWindow - <_Description>Creates a new Gtk# window. + <_Description>Creates a new Gtk window. - + diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.FS.xft.xml b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.FS.xft.xml new file mode 100644 index 000000000..91c77e43f --- /dev/null +++ b/Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/File/Window.FS.xft.xml @@ -0,0 +1,16 @@ + + diff --git a/Source/Addins/MonoDevelop.GtkSharp.Addin/packages.config b/Source/Addins/MonoDevelop.GtkSharp.Addin/packages.config deleted file mode 100644 index 1c2ff2fd4..000000000 --- a/Source/Addins/MonoDevelop.GtkSharp.Addin/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Source/Templates/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/.template.config/template.json b/Source/Templates/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/.template.config/template.json index e9fcb437a..9f4a98439 100644 --- a/Source/Templates/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/.template.config/template.json +++ b/Source/Templates/GtkSharp.Template.CSharp/content/GtkSharp.Application.CSharp/.template.config/template.json @@ -21,5 +21,8 @@ "defaultValue": "netcoreapp2.0", "replaces": "netcoreapp2.0" } - } + }, + "primaryOutputs": [ + { "path": "GtkNamespace.csproj" } + ] } diff --git a/Source/Templates/GtkSharp.Template.FSharp/content/GtkSharp.Application.FSharp/.template.config/template.json b/Source/Templates/GtkSharp.Template.FSharp/content/GtkSharp.Application.FSharp/.template.config/template.json index 67b5b10da..dd7d589a9 100644 --- a/Source/Templates/GtkSharp.Template.FSharp/content/GtkSharp.Application.FSharp/.template.config/template.json +++ b/Source/Templates/GtkSharp.Template.FSharp/content/GtkSharp.Application.FSharp/.template.config/template.json @@ -21,5 +21,8 @@ "defaultValue": "netcoreapp2.0", "replaces": "netcoreapp2.0" } - } + }, + "primaryOutputs": [ + { "path": "GtkNamespace.fsproj" } + ] } diff --git a/Source/Templates/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json b/Source/Templates/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json index 2ebcccef1..bee173d46 100644 --- a/Source/Templates/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json +++ b/Source/Templates/GtkSharp.Template.VBNet/content/GtkSharp.Application.VBNet/.template.config/template.json @@ -21,5 +21,8 @@ "defaultValue": "netcoreapp2.0", "replaces": "netcoreapp2.0" } - } + }, + "primaryOutputs": [ + { "path": "GtkNamespace.vbproj" } + ] } diff --git a/build.cake b/build.cake index b2692adf8..be72b1080 100644 --- a/build.cake +++ b/build.cake @@ -19,7 +19,8 @@ Task("Init") .Does(() => { var version = System.Environment.GetEnvironmentVariable("TRAVIS_TAG"); - Information("Version detected: " + version); + if (!string.IsNullOrEmpty(version)) + Settings.Version = version; // Assign some common properties msbuildsettings = msbuildsettings.WithProperty("Version", Settings.Version); @@ -48,6 +49,9 @@ Task("Prepare") foreach(var gassembly in list) gassembly.Prepare(); DotNetCoreRestore("Source/GtkSharp.sln"); + + // Addin + DotNetCoreRestore("Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln"); }); Task("Clean") @@ -135,6 +139,38 @@ Task("PackageTemplates") NuGetPack("Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec", settings); }); +Task("PackageAddin") + .IsDependentOn("PackageTemplates") + .Does(() => +{ + // Copy the current version nuget templates + CopyFile( + "BuildOutput/NugetPackages/GtkSharp.Template.CSharp." + Settings.Version + ".nupkg", + "Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/GtkSharp.Template.CSharp.nupkg" + ); + CopyFile( + "BuildOutput/NugetPackages/GtkSharp.Template.FSharp." + Settings.Version + ".nupkg", + "Source/Addins/MonoDevelop.GtkSharp.Addin/Templates/GtkSharp.Template.FSharp.nupkg" + ); + + // Generate version code info + var versionline = "[assembly: Mono.Addins.Addin(\"MonoDevelop.GtkSharp.Addin\", Version = \"" + Settings.Version + "\")]"; + FileWriteText("Source/Addins/MonoDevelop.GtkSharp.Addin/Properties/AddinInfo.Version.cs", versionline); + + // Build MonoDevelop addin + var msbuildsettings = new MSBuildSettings + { + Configuration = "Release", + }; + msbuildsettings = msbuildsettings.WithProperty("Version", Settings.Version); + msbuildsettings = msbuildsettings.WithProperty("MDBinDir", "/opt/MonoDevelop/bin/"); + msbuildsettings = msbuildsettings.WithTarget("PackageAddin"); + + // We need monodevelop on the build system to build the addin + // lets wait for its packaging to be finished. + // MSBuild("Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln", msbuildsettings); +}); + // TASK TARGETS Task("Default") @@ -142,7 +178,8 @@ Task("Default") Task("FullBuild") .IsDependentOn("PackageNuGet") - .IsDependentOn("PackageTemplates"); + .IsDependentOn("PackageTemplates") + .IsDependentOn("PackageAddin"); // EXECUTION