Skip to content

Commit

Permalink
Merge pull request #287 from TimLariviere/55-wpf-macos-samples
Browse files Browse the repository at this point in the history
Added WPF/GTK/macOS nodes to all samples
  • Loading branch information
TimLariviere authored Jan 23, 2019
2 parents 5fe6790 + 0d532c9 commit 0f76787
Show file tree
Hide file tree
Showing 115 changed files with 2,430 additions and 13 deletions.
7 changes: 6 additions & 1 deletion .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@
<PaketRestoreRequired Condition=" '$(PaketRestoreLockFileHash)' == '' ">true</PaketRestoreRequired>
</PropertyGroup>

<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.174.2' ">
<!--
This value should match the version in the props generated by paket
If they differ, this means we need to do a restore in order to ensure correct dependencies
-->
<PropertyGroup Condition="'$(PaketPropsVersion)' != '5.185.3' ">
<PaketRestoreRequired>true</PaketRestoreRequired>
</PropertyGroup>

Expand Down Expand Up @@ -183,6 +187,7 @@
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' == '6' And %(PaketReferencesFileLinesInfo.CopyLocal) == 'false'">runtime</ExcludeAssets>
<ExcludeAssets Condition=" '%(PaketReferencesFileLinesInfo.Splits)' != '6' And %(PaketReferencesFileLinesInfo.AllPrivateAssets) == 'exclude'">runtime</ExcludeAssets>
<Publish Condition=" '$(PackAsTool)' == 'true' ">true</Publish>
<AllowExplicitVersion>true</AllowExplicitVersion>
</PackageReference>
</ItemGroup>

Expand Down
209 changes: 209 additions & 0 deletions Fabulous.sln

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ let buildDir = Path.getFullName "./build_output"
let removeIncompatiblePlatformProjects pattern =
if not Environment.isWindows then
pattern
-- "samples/AllControls/WPF/AllControls.WPF.fsproj"
-- "samples/**/*.WPF.fsproj"
elif not Environment.isMacOS then
pattern
-- "samples/**/*.MacOS.fsproj"
else
pattern

Expand Down
5 changes: 5 additions & 0 deletions install-xamarin-android-ios.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
XAMARIN_IOS_VERSION=11.10.1.178
XAMARIN_ANDROID_VERSION=8.3.0-19
XAMARIN_MAC_VERSION=4.5.0.280

installpkg() {
sudo installer -pkg $1 -target /
Expand All @@ -21,3 +22,7 @@ installpkg xamarin.ios-$XAMARIN_IOS_VERSION.pkg > installpkg.xamarin.ios.log
# install Xamarin.Android
wget https://dl.xamarin.com/MonoforAndroid/Mac/xamarin.android-$XAMARIN_ANDROID_VERSION.pkg
installpkg xamarin.android-$XAMARIN_ANDROID_VERSION.pkg > installpkg.xamarin.android.log

# install Xamarin.Mac
wget https://dl.xamarin.com/XamarinforMac/Mac/xamarin.mac-$XAMARIN_MAC_VERSION.pkg
installpkg xamarin.mac-$XAMARIN_MAC_VERSION.pkg > installpkg.xamarin.mac.log
12 changes: 10 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,25 @@ group iosapp
nuget Xamarin.Forms 3.4.0.1009999
nuget Newtonsoft.Json 11.0.2

group macos
group macosapp
framework: xamarinmac20
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.4.0.1009999
nuget Newtonsoft.Json 11.0.2

group wpfapp
framework: net461
framework: net472
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.4.0.1009999
nuget Newtonsoft.Json 11.0.2
nuget Xamarin.Forms.Platform.WPF 3.4.0.1009999

group gtkapp
framework: net471
source https://api.nuget.org/v3/index.json
nuget FSharp.Core 4.5.2
nuget Xamarin.Forms 3.4.0.1009999
nuget Newtonsoft.Json 11.0.2
nuget Xamarin.Forms.Platform.GTK 3.4.0.1009999
14 changes: 12 additions & 2 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ NUGET
Xamarin.Android.Support.Vector.Drawable (27.0.2.1)
Xamarin.Forms (3.4.0.1009999)

GROUP gtkapp
RESTRICTION: == net471
NUGET
remote: https://api.nuget.org/v3/index.json
FSharp.Core (4.5.2)
Newtonsoft.Json (11.0.2)
Xamarin.Forms (3.4.0.1009999)
Xamarin.Forms.Platform.GTK (3.4.0.1009999)
Xamarin.Forms (>= 3.4.0.1009999)

GROUP iosapp
RESTRICTION: == monotouch
NUGET
Expand Down Expand Up @@ -389,7 +399,7 @@ NUGET
System.Xml.XmlDocument (4.3)
Xamarin.Forms (3.4.0.1009999)

GROUP macos
GROUP macosapp
RESTRICTION: == xamarinmac
NUGET
remote: https://api.nuget.org/v3/index.json
Expand Down Expand Up @@ -545,7 +555,7 @@ NUGET
Xamarin.Forms (>= 2.3.3.180)

GROUP wpfapp
RESTRICTION: == net461
RESTRICTION: == net472
NUGET
remote: https://api.nuget.org/v3/index.json
FSharp.Core (4.5.2)
Expand Down
113 changes: 113 additions & 0 deletions samples/AllControls/Gtk/AllControls.Gtk.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\gtkapp\Xamarin.Forms\build\netstandard2.0\Xamarin.Forms.props" Condition="Exists('..\..\..\packages\gtkapp\Xamarin.Forms\build\netstandard2.0\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{035502bf-dcd6-409c-80f5-076ef6c97f17}</ProjectGuid>
<UseStandardResourceNames>true</UseStandardResourceNames>
<OutputType>WinExe</OutputType>
<RootNamespace>AllControls.Gtk</RootNamespace>
<AssemblyName>AllControls.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\gtkapp\Xamarin.Forms.Platform.GTK\lib\net45\OpenTK.dll</HintPath>
</Reference>
<Reference Include="webkit-sharp">
<HintPath>..\..\..\packages\gtkapp\Xamarin.Forms.Platform.GTK\lib\net45\webkit-sharp.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.GTK">
<HintPath>..\..\..\packages\gtkapp\Xamarin.Forms.Platform.GTK\lib\net45\Xamarin.Forms.Platform.GTK.dll</HintPath>
</Reference>
<Reference Include="FSharp.Core">
<HintPath>..\..\..\packages\gtkapp\FSharp.Core\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\..\packages\gtkapp\Xamarin.Forms\lib\netstandard2.0\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\..\packages\gtkapp\Xamarin.Forms\lib\netstandard2.0\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\..\packages\gtkapp\Xamarin.Forms\lib\netstandard2.0\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\..\packages\gtkapp\Newtonsoft.Json\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Main.fs" />
<None Include="webkit-sharp.dll.config" />
<None Include="OpenTK.dll.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\Fabulous.Core\Fabulous.Core.fsproj">
<Project>{B459AFAD-BB5B-43C3-BD86-609E8DB3E3FD}</Project>
<Name>Fabulous.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Fabulous.CustomControls\Fabulous.CustomControls.fsproj">
<Project>{7FF328BB-9318-4C11-8A9A-37DD98EAB35B}</Project>
<Name>Fabulous.CustomControls</Name>
</ProjectReference>
<ProjectReference Include="..\AllControls\AllControls.fsproj">
<Project>{13F140D6-2D21-41BE-AC90-4B14D8C16A47}</Project>
<Name>AllControls</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpTargetsPath)" Condition="Exists($(FSharpTargetsPath))" />
<Import Project="..\..\..\packages\gtkapp\Xamarin.Forms\build\netstandard2.0\Xamarin.Forms.targets" Condition="Exists('..\..\..\packages\gtkapp\Xamarin.Forms\build\netstandard2.0\Xamarin.Forms.targets')" />
</Project>
20 changes: 20 additions & 0 deletions samples/AllControls/Gtk/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace AllControls.Gtk
open System.Reflection
open System.Runtime.CompilerServices

[<assembly: AssemblyTitle("AllControls.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 samples/AllControls/Gtk/Main.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace AllControls.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 AllControls.App()
let window = new FormsWindow()
window.LoadApplication(app)
window.SetApplicationTitle("AllControls")
window.Show();

Gtk.Application.Run()
0
25 changes: 25 additions & 0 deletions samples/AllControls/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>
3 changes: 3 additions & 0 deletions samples/AllControls/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>
2 changes: 1 addition & 1 deletion samples/AllControls/WPF/AllControls.WPF.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="..\..\..\netfx.props" />
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net471</TargetFramework>
<TargetFramework>net472</TargetFramework>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 0f76787

Please sign in to comment.