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/
Generated/
AddinInfo.Version.cs
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

View file

@ -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<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);
}
Process.Start("glade", _filename);
}
}
}
}

View file

@ -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);
}
}
}
}

View file

@ -1,88 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<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>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{52AC8491-F6B7-4631-92BA-D5E95A091B74}</ProjectGuid>
<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>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\AddinInfo.cs" />
<Compile Include="CheckMissing.cs" />
<Compile Include="GladeDisplayBindings.cs" />
<Compile Include="GladeDesktopApplication.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Manifest.addin.xml" />
</ItemGroup>
<ItemGroup>
<None Include="Templates\File\Window.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Window.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Window.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Dialog.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Dialog.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Dialog.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Widget.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Data\Widget.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\File\Widget.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="Templates\GtkSharp.Template.CSharp.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Templates\GtkSharp.Template.VBNet.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Templates\" />
<Folder Include="Templates\File\" />
<Folder Include="Templates\File\Data\" />
</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 Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<OutputPath>..\..\..\BuildOutput\Addins\MonoDevelop\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MonoDevelop.Addins" Version="0.4.4" />
</ItemGroup>
<ItemGroup>
<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>
<Content Include="Templates\File\Dialog.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Widget.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Window.CS.xft.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Dialog.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Dialog.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Widget.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Widget.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Window.cs">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\File\Data\Window.glade">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\GtkSharp.Template.CSharp.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Templates\GtkSharp.Template.VBNet.nupkg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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>
<Compile Remove="Templates\File\Data\Dialog.cs" />
<Compile Remove="Templates\File\Data\Widget.cs" />
<Compile Remove="Templates\File\Data\Window.cs" />
</ItemGroup>
</Project>

View file

@ -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

View file

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

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>
<Runtime>
<!-- Project Templates -->
<Import file="Templates/GtkSharp.Template.CSharp.nupkg" />
<Import file="Templates/GtkSharp.Template.VBNet.nupkg" />
<Import file="Templates/GtkSharp.Template.FSharp.nupkg" />
<!-- File Templates -->
<Import file="Templates/File/Data/Dialog.cs" />
<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/Window.cs" />
<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/Widget.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>
<ConditionType id="CheckMissing" type="MonoDevelop.GtkSharp.Addin.CheckMissing" />
@ -28,32 +36,34 @@
<Category id="gtk" name="Gtk" />
</Extension>
<Extension path="/MonoDevelop/Ide/Templates">
<Extension path="/MonoDevelop/Ide/Templates">
<Template
id="GtkSharp.Application.CSharp"
_overrideDescription="Creates a new Gtk multiplatform application."
path="Templates/GtkSharp.Template.CSharp.nupkg"
category="multiplat/app/gtk"
icon="md-gui-project"
imageId="md-gui-project"
defaultParameters="targetframework=net471" />
imageId="md-gui-project" />
<Template
id="GtkSharp.Application.VBNet"
id="GtkSharp.Application.FSharp"
_overrideDescription="Creates a new Gtk multiplatform application."
path="Templates/GtkSharp.Template.VBNet.nupkg"
path="Templates/GtkSharp.Template.FSharp.nupkg"
category="multiplat/app/gtk"
icon="md-gui-project"
imageId="md-gui-project"
defaultParameters="targetframework=net471" />
imageId="md-gui-project" />
</Extension>
<Extension path="/MonoDevelop/Ide/FileTemplates">
<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.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 path="/MonoDevelop/Ide/DisplayBindings">
<DisplayBinding id="GladeApp" insertbefore="DefaultDisplayBinding" class="MonoDevelop.GtkSharp.Addin.GladeDisplayBinding" />
</Extension>
</ExtensionModel>
</ExtensionModel>

View file

@ -10,6 +10,7 @@ namespace ${Namespace}
private MyDialog(Builder builder) : base(builder.GetObject("${EscapedIdentifier}").Handle)
{
builder.Autoconnect(this);
DefaultResponse = ResponseType.Cancel;
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)
{
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)
{
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>
<_Name>Dialog</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category>
<_Category>Gtk</_Category>
<LanguageName>C#</LanguageName>
<DefaultFilename>MyDialog</DefaultFilename>
<_Description>Creates a new Gtk# dialog.</_Description>
<_Description>Creates a new Gtk dialog.</_Description>
</TemplateConfiguration>
<TemplateFiles>
<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>
</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>
<_Name>Widget</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category>
<_Category>Gtk</_Category>
<LanguageName>C#</LanguageName>
<DefaultFilename>MyWidget</DefaultFilename>
<_Description>Creates a new Gtk# custom widget.</_Description>
<_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}.cs" src="Data/Widget.cs" DependsOn="${Name}.glade" />
<File name="${Name}.cs" src="Data/Widget.cs" />
</TemplateFiles>
</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>
<_Name>Window</_Name>
<Icon>md-gui-file</Icon>
<_Category>Gtk#</_Category>
<_Category>Gtk</_Category>
<LanguageName>C#</LanguageName>
<DefaultFilename>MyWindow</DefaultFilename>
<_Description>Creates a new Gtk# window.</_Description>
<_Description>Creates a new Gtk window.</_Description>
</TemplateConfiguration>
<TemplateFiles>
<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>
</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",
"replaces": "netcoreapp2.0"
}
}
},
"primaryOutputs": [
{ "path": "GtkNamespace.csproj" }
]
}

View file

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

View file

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

View file

@ -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