Finish up MonoDevelop addin

This commit is contained in:
cra0zy 2018-02-28 18:55:16 +01:00
parent 99bcd09f68
commit 6b9f31f65f
25 changed files with 266 additions and 203 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
BuildOutput/ BuildOutput/
Generated/ Generated/
AddinInfo.Version.cs
## Ignore Visual Studio temporary files, build results, and ## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons. ## files generated by popular Visual Studio add-ons.

View File

@ -1,9 +1,4 @@
using System; using System.Diagnostics;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using DBus;
using MonoDevelop.Ide.Commands;
using MonoDevelop.Ide.Desktop; using MonoDevelop.Ide.Desktop;
namespace MonoDevelop.GtkSharp.Addin namespace MonoDevelop.GtkSharp.Addin
@ -19,35 +14,7 @@ namespace MonoDevelop.GtkSharp.Addin
public override void Launch(params string[] files) public override void Launch(params string[] files)
{ {
try Process.Start("glade", _filename);
{
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
{
var bus = Bus.Session.GetObject<IFlatpak>("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<UInt32, UnixFD> { },
new Dictionary<string, string> { },
0
);
return;
}
}
Process.Start(_filename);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
} }
} }
} }

View File

@ -1,4 +1,4 @@
using MonoDevelop.Core; using MonoDevelop.Core;
using MonoDevelop.Ide.Desktop; using MonoDevelop.Ide.Desktop;
using MonoDevelop.Ide.Gui; using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects; using MonoDevelop.Projects;

View File

@ -1,88 +1,88 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="packages\MonoDevelop.Addins.0.4.1\build\MonoDevelop.Addins.props" Condition="Exists('packages\MonoDevelop.Addins.0.4.1\build\MonoDevelop.Addins.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFramework>net461</TargetFramework>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <OutputPath>..\..\..\BuildOutput\Addins\MonoDevelop\</OutputPath>
<ProjectGuid>{52AC8491-F6B7-4631-92BA-D5E95A091B74}</ProjectGuid> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ProjectTypeGuids>{86F6BF2A-E449-4B3E-813B-9ACC37E5545F};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>MonoDevelop.GtkSharp.Addin</RootNamespace>
<AssemblyName>MonoDevelop.GtkSharp.Addin</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <PackageReference Include="MonoDevelop.Addins" Version="0.4.4" />
<Compile Include="Properties\AddinInfo.cs" />
<Compile Include="CheckMissing.cs" />
<Compile Include="GladeDisplayBindings.cs" />
<Compile Include="GladeDesktopApplication.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="Properties\Manifest.addin.xml" /> <None Remove="Templates\File\Dialog.CS.xft.xml" />
<None Remove="Templates\File\Widget.CS.xft.xml" />
<None Remove="Templates\File\Window.CS.xft.xml" />
<None Remove="Templates\File\Data\Dialog.glade" />
<None Remove="Templates\File\Data\Widget.glade" />
<None Remove="Templates\File\Data\Window.glade" />
<None Remove="Templates\GtkSharp.Template.CSharp.nupkg" />
<None Remove="Templates\GtkSharp.Template.VBNet.nupkg" />
<None Remove="Templates\GtkSharp.Template.FSharp.nupkg" />
<None Remove="Templates\File\Data\Dialog.fs" />
<None Remove="Templates\File\Data\Widget.fs" />
<None Remove="Templates\File\Data\Window.fs" />
<None Remove="Templates\File\Dialog.FS.xft.xml" />
<None Remove="Templates\File\Widget.FS.xft.xml" />
<None Remove="Templates\File\Window.FS.xft.xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Templates\File\Window.CS.xft.xml"> <Content Include="Templates\File\Dialog.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Window.glade"> <Content Include="Templates\File\Widget.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Window.cs"> <Content Include="Templates\File\Window.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Dialog.glade"> <Content Include="Templates\File\Data\Dialog.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Dialog.cs"> <Content Include="Templates\File\Data\Dialog.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Dialog.CS.xft.xml"> <Content Include="Templates\File\Data\Widget.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Widget.glade"> <Content Include="Templates\File\Data\Widget.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Data\Widget.cs"> <Content Include="Templates\File\Data\Window.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\File\Widget.CS.xft.xml"> <Content Include="Templates\File\Data\Window.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="packages.config" /> <Content Include="Templates\GtkSharp.Template.CSharp.nupkg">
<None Include="Templates\GtkSharp.Template.CSharp.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<None Include="Templates\GtkSharp.Template.VBNet.nupkg"> <Content Include="Templates\GtkSharp.Template.VBNet.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </Content>
<Content Include="Templates\GtkSharp.Template.FSharp.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Dialog.fs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Widget.fs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Window.fs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Dialog.FS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Widget.FS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Window.FS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Templates\" /> <Compile Remove="Templates\File\Data\Dialog.cs" />
<Folder Include="Templates\File\" /> <Compile Remove="Templates\File\Data\Widget.cs" />
<Folder Include="Templates\File\Data\" /> <Compile Remove="Templates\File\Data\Window.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="dbus-sharp">
<HintPath>References\dbus-sharp.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\MonoDevelop.Addins.0.3.3\build\net40\MonoDevelop.Addins.targets" Condition="Exists('..\packages\MonoDevelop.Addins.0.3.3\build\net40\MonoDevelop.Addins.targets')" />
<Import Project="packages\MonoDevelop.Addins.0.4.1\build\MonoDevelop.Addins.targets" Condition="Exists('packages\MonoDevelop.Addins.0.4.1\build\MonoDevelop.Addins.targets')" />
</Project> </Project>

View File

@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # 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 EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -9,9 +9,9 @@ Global
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{52AC8491-F6B7-4631-92BA-D5E95A091B74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F58399F1-E539-4625-873D-90045BDB519E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{52AC8491-F6B7-4631-92BA-D5E95A091B74}.Debug|Any CPU.Build.0 = Debug|Any CPU {F58399F1-E539-4625-873D-90045BDB519E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{52AC8491-F6B7-4631-92BA-D5E95A091B74}.Release|Any CPU.ActiveCfg = Release|Any CPU {F58399F1-E539-4625-873D-90045BDB519E}.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}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -1,12 +1,10 @@
using Mono.Addins; using Mono.Addins;
using Mono.Addins.Description; using Mono.Addins.Description;
[assembly: Addin("MonoDevelop.GtkSharp.Addin", Version="1.0")] [assembly: AddinName("GtkSharp Addin")]
[assembly: AddinName("Gtk# Addin")]
[assembly: AddinCategory("IDE extensions")] [assembly: AddinCategory("IDE extensions")]
[assembly: AddinDescription("Provides modern Gtk# file / project templates and glade file integration.")] [assembly: AddinDescription("Provides modern Gtk project and file templates, as well as glade file integration.")]
[assembly: AddinAuthor("cra0zy")] [assembly: AddinAuthor("GtkSharp Contributors")]
[assembly: AddinUrl("https://github.com/GtkSharp/GtkSharp")] [assembly: AddinUrl("https://github.com/GtkSharp/GtkSharp")]
[assembly: AddinDependency("MonoDevelop.Core", MonoDevelop.BuildInfo.Version)] [assembly: AddinDependency("MonoDevelop.Core", MonoDevelop.BuildInfo.Version)]

View File

@ -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("")]

View File

@ -1,20 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ExtensionModel> <ExtensionModel>
<Runtime> <Runtime>
<!-- Project Templates --> <!-- Project Templates -->
<Import file="Templates/GtkSharp.Template.CSharp.nupkg" /> <Import file="Templates/GtkSharp.Template.CSharp.nupkg" />
<Import file="Templates/GtkSharp.Template.VBNet.nupkg" /> <Import file="Templates/GtkSharp.Template.FSharp.nupkg" />
<!-- File Templates --> <!-- File Templates -->
<Import file="Templates/File/Data/Dialog.cs" />
<Import file="Templates/File/Data/Dialog.glade" /> <Import file="Templates/File/Data/Dialog.glade" />
<Import file="Templates/File/Data/Widget.cs" />
<Import file="Templates/File/Data/Widget.glade" /> <Import file="Templates/File/Data/Widget.glade" />
<Import file="Templates/File/Data/Window.cs" />
<Import file="Templates/File/Data/Window.glade" /> <Import file="Templates/File/Data/Window.glade" />
<Import file="Templates/File/Data/Dialog.cs" />
<Import file="Templates/File/Data/Widget.cs" />
<Import file="Templates/File/Data/Window.cs" />
<Import file="Templates/File/Dialog.CS.xft.xml" /> <Import file="Templates/File/Dialog.CS.xft.xml" />
<Import file="Templates/File/Widget.CS.xft.xml" /> <Import file="Templates/File/Widget.CS.xft.xml" />
<Import file="Templates/File/Window.CS.xft.xml" /> <Import file="Templates/File/Window.CS.xft.xml" />
<Import file="Templates/File/Data/Dialog.fs" />
<Import file="Templates/File/Data/Widget.fs" />
<Import file="Templates/File/Data/Window.fs" />
<Import file="Templates/File/Dialog.FS.xft.xml" />
<Import file="Templates/File/Widget.FS.xft.xml" />
<Import file="Templates/File/Window.FS.xft.xml" />
</Runtime> </Runtime>
<ConditionType id="CheckMissing" type="MonoDevelop.GtkSharp.Addin.CheckMissing" /> <ConditionType id="CheckMissing" type="MonoDevelop.GtkSharp.Addin.CheckMissing" />
@ -35,22 +43,24 @@
path="Templates/GtkSharp.Template.CSharp.nupkg" path="Templates/GtkSharp.Template.CSharp.nupkg"
category="multiplat/app/gtk" category="multiplat/app/gtk"
icon="md-gui-project" icon="md-gui-project"
imageId="md-gui-project" imageId="md-gui-project" />
defaultParameters="targetframework=net471" />
<Template <Template
id="GtkSharp.Application.VBNet" id="GtkSharp.Application.FSharp"
_overrideDescription="Creates a new Gtk multiplatform application." _overrideDescription="Creates a new Gtk multiplatform application."
path="Templates/GtkSharp.Template.VBNet.nupkg" path="Templates/GtkSharp.Template.FSharp.nupkg"
category="multiplat/app/gtk" category="multiplat/app/gtk"
icon="md-gui-project" icon="md-gui-project"
imageId="md-gui-project" imageId="md-gui-project" />
defaultParameters="targetframework=net471" />
</Extension> </Extension>
<Extension path="/MonoDevelop/Ide/FileTemplates"> <Extension path="/MonoDevelop/Ide/FileTemplates">
<FileTemplate id="gtk.cs.dialog" file="Templates/File/Dialog.CS.xft.xml" /> <FileTemplate id="gtk.cs.dialog" file="Templates/File/Dialog.CS.xft.xml" />
<FileTemplate id="gtk.cs.widget" file="Templates/File/Widget.CS.xft.xml" /> <FileTemplate id="gtk.cs.widget" file="Templates/File/Widget.CS.xft.xml" />
<FileTemplate id="gtk.cs.window" file="Templates/File/Window.CS.xft.xml" /> <FileTemplate id="gtk.cs.window" file="Templates/File/Window.CS.xft.xml" />
<FileTemplate id="gtk.fs.dialog" file="Templates/File/Dialog.FS.xft.xml" />
<FileTemplate id="gtk.fs.widget" file="Templates/File/Widget.FS.xft.xml" />
<FileTemplate id="gtk.fs.window" file="Templates/File/Window.FS.xft.xml" />
</Extension> </Extension>
<Extension path="/MonoDevelop/Ide/DisplayBindings"> <Extension path="/MonoDevelop/Ide/DisplayBindings">

View File

@ -10,6 +10,7 @@ namespace ${Namespace}
private MyDialog(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle) private MyDialog(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle)
{ {
builder.Autoconnect(this);
DefaultResponse = ResponseType.Cancel; DefaultResponse = ResponseType.Cancel;
Response += OnResponse; Response += OnResponse;

View File

@ -0,0 +1,13 @@
namespace ${Namespace}
open Gtk
type ${EscapedIdentifier} (builder : Builder) as this =
inherit Dialog(builder.GetObject("${EscapedIdentifier}").Handle)
do
this.DefaultResponse <- ResponseType.Cancel;
this.Response.Add(fun _ ->
this.Hide();
)
new() = new ${EscapedIdentifier}(new Builder("${Namespace}.${EscapedIdentifier}.glade"))

View File

@ -10,7 +10,7 @@ namespace ${Namespace}
private ${EscapedIdentifier}(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle) private ${EscapedIdentifier}(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle)
{ {
builder.Autoconnect(this);
} }
} }
} }

View File

@ -0,0 +1,8 @@
namespace ${Namespace}
open Gtk
type ${EscapedIdentifier} (builder : Builder) =
inherit Box(builder.GetObject("${EscapedIdentifier}").Handle)
new() = new ${EscapedIdentifier}(new Builder("${Namespace}.${EscapedIdentifier}.glade"))

View File

@ -11,13 +11,6 @@ namespace ${Namespace}
private ${EscapedIdentifier}(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle) private ${EscapedIdentifier}(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle)
{ {
builder.Autoconnect(this); builder.Autoconnect(this);
DeleteEvent += OnDeleteEvent;
}
private void OnDeleteEvent(object sender, DeleteEventArgs a)
{
Application.Quit();
} }
} }
} }

View File

@ -0,0 +1,8 @@
namespace ${Namespace}
open Gtk
type ${EscapedIdentifier} (builder : Builder) =
inherit Window(builder.GetObject("${EscapedIdentifier}").Handle)
new() = new ${EscapedIdentifier}(new Builder("${Namespace}.${EscapedIdentifier}.glade"))

View File

@ -3,14 +3,14 @@
<TemplateConfiguration> <TemplateConfiguration>
<_Name>Dialog</_Name> <_Name>Dialog</_Name>
<Icon>md-gui-file</Icon> <Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category> <_Category>Gtk</_Category>
<LanguageName>C#</LanguageName> <LanguageName>C#</LanguageName>
<DefaultFilename>MyDialog</DefaultFilename> <DefaultFilename>MyDialog</DefaultFilename>
<_Description>Creates a new Gtk# dialog.</_Description> <_Description>Creates a new Gtk dialog.</_Description>
</TemplateConfiguration> </TemplateConfiguration>
<TemplateFiles> <TemplateFiles>
<File name="${Name}.glade" src="Data/Dialog.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" /> <File name="${Name}.glade" src="Data/Dialog.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.cs" src="Data/Dialog.cs" DependsOn="${Name}.glade" /> <File name="${Name}.cs" src="Data/Dialog.cs" />
</TemplateFiles> </TemplateFiles>
</Template> </Template>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Template>
<TemplateConfiguration>
<_Name>Dialog</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk</_Category>
<LanguageName>F#</LanguageName>
<DefaultFilename>MyDialog</DefaultFilename>
<_Description>Creates a new Gtk dialog.</_Description>
</TemplateConfiguration>
<TemplateFiles>
<File name="${Name}.glade" src="Data/Dialog.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.fs" src="Data/Dialog.fs" />
</TemplateFiles>
</Template>

View File

@ -3,14 +3,14 @@
<TemplateConfiguration> <TemplateConfiguration>
<_Name>Widget</_Name> <_Name>Widget</_Name>
<Icon>md-gui-file</Icon> <Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category> <_Category>Gtk</_Category>
<LanguageName>C#</LanguageName> <LanguageName>C#</LanguageName>
<DefaultFilename>MyWidget</DefaultFilename> <DefaultFilename>MyWidget</DefaultFilename>
<_Description>Creates a new Gtk# custom widget.</_Description> <_Description>Creates a new Gtk custom widget.</_Description>
</TemplateConfiguration> </TemplateConfiguration>
<TemplateFiles> <TemplateFiles>
<File name="${Name}.glade" src="Data/Widget.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" /> <File name="${Name}.glade" src="Data/Widget.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.cs" src="Data/Widget.cs" DependsOn="${Name}.glade" /> <File name="${Name}.cs" src="Data/Widget.cs" />
</TemplateFiles> </TemplateFiles>
</Template> </Template>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Template>
<TemplateConfiguration>
<_Name>Widget</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk</_Category>
<LanguageName>F#</LanguageName>
<DefaultFilename>MyWidget</DefaultFilename>
<_Description>Creates a new Gtk custom widget.</_Description>
</TemplateConfiguration>
<TemplateFiles>
<File name="${Name}.glade" src="Data/Widget.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.fs" src="Data/Widget.fs" />
</TemplateFiles>
</Template>

View File

@ -3,14 +3,14 @@
<TemplateConfiguration> <TemplateConfiguration>
<_Name>Window</_Name> <_Name>Window</_Name>
<Icon>md-gui-file</Icon> <Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category> <_Category>Gtk</_Category>
<LanguageName>C#</LanguageName> <LanguageName>C#</LanguageName>
<DefaultFilename>MyWindow</DefaultFilename> <DefaultFilename>MyWindow</DefaultFilename>
<_Description>Creates a new Gtk# window.</_Description> <_Description>Creates a new Gtk window.</_Description>
</TemplateConfiguration> </TemplateConfiguration>
<TemplateFiles> <TemplateFiles>
<File name="${Name}.glade" src="Data/Window.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" /> <File name="${Name}.glade" src="Data/Window.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.cs" src="Data/Window.cs" DependsOn="${Name}.glade" /> <File name="${Name}.cs" src="Data/Window.cs" />
</TemplateFiles> </TemplateFiles>
</Template> </Template>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Template>
<TemplateConfiguration>
<_Name>Window</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk</_Category>
<LanguageName>F#</LanguageName>
<DefaultFilename>MyWindow</DefaultFilename>
<_Description>Creates a new Gtk window.</_Description>
</TemplateConfiguration>
<TemplateFiles>
<File name="${Name}.glade" src="Data/Window.glade" BuildAction="EmbeddedResource" SuppressAutoOpen="True" />
<File name="${Name}.fs" src="Data/Window.fs" />
</TemplateFiles>
</Template>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MonoDevelop.Addins" version="0.4.1" targetFramework="net45" />
</packages>

View File

@ -21,5 +21,8 @@
"defaultValue": "netcoreapp2.0", "defaultValue": "netcoreapp2.0",
"replaces": "netcoreapp2.0" "replaces": "netcoreapp2.0"
} }
} },
"primaryOutputs": [
{ "path": "GtkNamespace.csproj" }
]
} }

View File

@ -21,5 +21,8 @@
"defaultValue": "netcoreapp2.0", "defaultValue": "netcoreapp2.0",
"replaces": "netcoreapp2.0" "replaces": "netcoreapp2.0"
} }
} },
"primaryOutputs": [
{ "path": "GtkNamespace.fsproj" }
]
} }

View File

@ -21,5 +21,8 @@
"defaultValue": "netcoreapp2.0", "defaultValue": "netcoreapp2.0",
"replaces": "netcoreapp2.0" "replaces": "netcoreapp2.0"
} }
} },
"primaryOutputs": [
{ "path": "GtkNamespace.vbproj" }
]
} }

View File

@ -19,7 +19,8 @@ Task("Init")
.Does(() => .Does(() =>
{ {
var version = System.Environment.GetEnvironmentVariable("TRAVIS_TAG"); var version = System.Environment.GetEnvironmentVariable("TRAVIS_TAG");
Information("Version detected: " + version); if (!string.IsNullOrEmpty(version))
Settings.Version = version;
// Assign some common properties // Assign some common properties
msbuildsettings = msbuildsettings.WithProperty("Version", Settings.Version); msbuildsettings = msbuildsettings.WithProperty("Version", Settings.Version);
@ -48,6 +49,9 @@ Task("Prepare")
foreach(var gassembly in list) foreach(var gassembly in list)
gassembly.Prepare(); gassembly.Prepare();
DotNetCoreRestore("Source/GtkSharp.sln"); DotNetCoreRestore("Source/GtkSharp.sln");
// Addin
DotNetCoreRestore("Source/Addins/MonoDevelop.GtkSharp.Addin/MonoDevelop.GtkSharp.Addin.sln");
}); });
Task("Clean") Task("Clean")
@ -135,6 +139,38 @@ Task("PackageTemplates")
NuGetPack("Source/Templates/GtkSharp.Template.VBNet/GtkSharp.Template.VBNet.nuspec", settings); 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 TARGETS
Task("Default") Task("Default")
@ -142,7 +178,8 @@ Task("Default")
Task("FullBuild") Task("FullBuild")
.IsDependentOn("PackageNuGet") .IsDependentOn("PackageNuGet")
.IsDependentOn("PackageTemplates"); .IsDependentOn("PackageTemplates")
.IsDependentOn("PackageAddin");
// EXECUTION // EXECUTION