Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GTK as target template #268

Merged
merged 7 commits into from
Jan 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion templates/content/blank/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"condition": "Android",
"path": "NewApp.Android\\NewApp.Android.fsproj"
},
{
"condition": "GTK",
"path": "NewApp.Gtk\\NewApp.Gtk.fsproj"
},
{
"condition": "WPF",
"path": "NewApp.WPF\\NewApp.WPF.fsproj"
Expand All @@ -44,7 +48,8 @@
"91D74A40-E440-42AD-B51F-C2D641C49384",
"B445DF73-AC9E-4276-9FBA-7CB5AD5D2518",
"3EA9E612-E717-4E55-9034-DE653429FEFD",
"3EA9E612-E717-4E55-9034-C415CD62AF9A"
"3EA9E612-E717-4E55-9034-C415CD62AF9A",
"E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D"
],
"symbols": {
"kind": {
Expand Down Expand Up @@ -178,6 +183,11 @@
"dataType": "bool",
"defaultValue": "false"
},
"GTK": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"WPF": {
"type": "parameter",
"dataType": "bool",
Expand Down Expand Up @@ -216,6 +226,12 @@
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.Gtk/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
Expand Down Expand Up @@ -246,6 +262,12 @@
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.Gtk/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
Expand Down
20 changes: 20 additions & 0 deletions templates/content/blank/NewApp.Gtk/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NewApp.Gtk
open System.Reflection
open System.Runtime.CompilerServices

[<assembly: AssemblyTitle("NewApp.Gtk")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyProduct("")>]
[<assembly: AssemblyCopyright("")>]
[<assembly: AssemblyTrademark("")>]

// The assembly version has the format {Major}.{Minor}.{Build}.{Revision}

[<assembly: AssemblyVersion("1.0.0.0")>]

//[<assembly: AssemblyDelaySign(false)>]
//[<assembly: AssemblyKeyFile("")>]

()
20 changes: 20 additions & 0 deletions templates/content/blank/NewApp.Gtk/Main.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace NewApp.Gtk

open System
open Xamarin.Forms
open Xamarin.Forms.Platform.GTK

module Main =
[<EntryPoint>]
let Main(args) =
Gtk.Application.Init()
Forms.Init()

let app = new NewApp.App()
let window = new FormsWindow()
window.LoadApplication(app)
window.SetApplicationTitle("Hello Fabulous GTK#")
window.Show();

Gtk.Application.Run()
0
111 changes: 111 additions & 0 deletions templates/content/blank/NewApp.Gtk/NewApp.Gtk.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C6A6BA94-897C-48B5-8046-3DF33897BA94}</ProjectGuid>
<UseStandardResourceNames>true</UseStandardResourceNames>
<OutputType>WinExe</OutputType>
<RootNamespace>NewApp.Gtk</RootNamespace>
<AssemblyName>NewApp.Gtk</AssemblyName>
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<DefineConstants></DefineConstants>
<ErrorReport>prompt</ErrorReport>
<GenerateTailCalls>true</GenerateTailCalls>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '10.0' OR '$(VisualStudioVersion)' == '11.0'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glib-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="atk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>gtk-sharp-2.0</Package>
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="OpenTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\OpenTK.dll</HintPath>
</Reference>
<Reference Include="webkit-sharp">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\webkit-sharp.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\packages\Xamarin.Forms.Platform.GTK.XamarinFormsSdk\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\packages\FSharp.Core.FSharpCorePkgVersion\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\packages\Xamarin.Forms.XamarinFormsSdk\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Fabulous.Core">
<HintPath>..\packages\Fabulous.Core.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.Core.dll</HintPath>
</Reference>
<Reference Include="Fabulous.CustomControls">
<HintPath>..\packages\Fabulous.CustomControls.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.CustomControls.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.NewtonsoftJsonPkg\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Main.fs" />
<None Include="packages.config" />
<None Include="webkit-sharp.dll.config" />
<None Include="OpenTK.dll.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NewApp\NewApp.fsproj">
<Project>{99E19497-29A6-4B77-B773-BEC55F9B55DC}</Project>
<Name>NewApp</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" />
<Import Project="..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.XamarinFormsSdk\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>
25 changes: 25 additions & 0 deletions templates/content/blank/NewApp.Gtk/OpenTK.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
9 changes: 9 additions & 0 deletions templates/content/blank/NewApp.Gtk/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Fabulous.Core" version="FabulousPkgsVersion" />
<package id="Fabulous.CustomControls" version="FabulousPkgsVersion" />
<package id="FSharp.Core" version="FSharpCorePkgVersion" />
<package id="Newtonsoft.Json" version="NewtonsoftJsonPkg" />
<package id="Xamarin.Forms" version="XamarinFormsSdk" />
<package id="Xamarin.Forms.Platform.GTK" version="XamarinFormsSdk" />
</packages>
3 changes: 3 additions & 0 deletions templates/content/blank/NewApp.Gtk/webkit-sharp.dll.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<configuration>
<dllmap dll="webkit-1.0" target="/usr/lib/x86_64-linux-gnu/libwebkitgtk-1.0.so"/>
</configuration>
53 changes: 53 additions & 0 deletions templates/content/blank/NewApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.Android", "NewApp.An
EndProject
#//#endif

#//#if (GTK)
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.Gtk", "NewApp.Gtk\NewApp.Gtk.fsproj", "{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}"
EndProject
#//#endif

#//#if (iOS)
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "NewApp.iOS", "NewApp.iOS\NewApp.iOS.fsproj", "{91D74A40-E440-42AD-B51F-C2D641C49384}"
EndProject
Expand Down Expand Up @@ -346,6 +351,54 @@ Global
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x64.Build.0 = Release|Any CPU
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x86.ActiveCfg = Release|Any CPU
{8D9F8CF0-E178-402D-8D40-A88B7B5F3D42}.Release|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Ad-Hoc|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.AppStore|x86.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|ARM.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhone.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x64.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x64.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x86.ActiveCfg = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Debug|x86.Build.0 = Debug|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|Any CPU.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|ARM.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|ARM.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhone.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhone.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x64.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x64.Build.0 = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x86.ActiveCfg = Release|Any CPU
{E9A5BEFA-0E53-40B7-B2F8-DDB8369E644D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down