Skip to content

Commit

Permalink
Merge pull request #48 from TimLariviere/fix-templates
Browse files Browse the repository at this point in the history
Make sure blank templates can install from GitHub Packages
  • Loading branch information
TimLariviere authored Jan 16, 2022
2 parents b410d57 + 2c38bef commit c614570
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 235 deletions.
1 change: 1 addition & 0 deletions templates/Fabulous.XamarinForms.Templates.proj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<!-- https://github.com/dotnet/templating/issues/2350#issuecomment-610431461 -->
<NoDefaultExcludes>true</NoDefaultExcludes>
<VersionPrefix>2.0.0</VersionPrefix>
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromPackage>
Expand Down
213 changes: 2 additions & 211 deletions templates/content/blank/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Elmish",
"Cross-platform"
],
"name": "Fabulous for Xamarin.Forms App v2.0.0-nightly-1234",
"name": "Fabulous for Xamarin.Forms App vFABULOUS_PKG_VERSION",
"groupIdentity": "Fabulous.XamarinForms.App",
"identity": "Fabulous.XamarinForms.FSharp",
"shortName": "fabulous-xf-app",
Expand All @@ -20,29 +20,9 @@
{
"path": "NewApp\\NewApp.fs"
},
{
"condition": "Android",
"path": "NewApp.Android\\NewApp.Android.fsproj"
},
{
"condition": "GTK",
"path": "NewApp.Gtk\\NewApp.Gtk.fsproj"
},
{
"condition": "WPF",
"path": "NewApp.WPF\\NewApp.WPF.fsproj"
},
{
"condition": "iOS",
"path": "NewApp.iOS\\NewApp.iOS.fsproj"
},
{
"condition": "macOS",
"path": "NewApp.macOS\\NewApp.macOS.fsproj"
},
{
"condition": "UWP",
"path": "NewApp.UWP\\NewApp.UWP.csproj"
}
],
"defaultName": "App",
Expand All @@ -54,42 +34,17 @@
"1069F96F-A42B-4CD8-8FA1-7F047C726B88"
],
"symbols": {
"kind": {
"type": "parameter",
"datatype": "choice",
"defaultValue": "blank",
"choices": [
{
"choice": "blank",
"description": "An empty Fabulous Xamarin.Forms app"
}
]
},
"AppIdentifier": {
"type": "parameter",
"description": "Overrides the Info.plist's CFBundleIdentifier",
"datatype": "string",
"defaultValue": "com.companyname"
},
"AndroidAppIdentifier": {
"type": "parameter",
"description": "Overrides the package name in the AndroidManifest.xml",
"datatype": "string"
},
"iOSAppIdentifier": {
"type": "parameter",
"description": "Overrides the Info.plist's CFBundleIdentifier",
"datatype": "string"
},
"AndroidAppIdentifierReplacer": {
"type": "generated",
"generator": "coalesce",
"parameters": {
"sourceVariableName": "AndroidAppIdentifier",
"fallbackVariableName": "AppIdentifier"
},
"replaces": "com.companyname.NewApp.Android"
},
"iOSAppIdentifierReplacer": {
"type": "generated",
"generator": "coalesce",
Expand All @@ -99,37 +54,6 @@
},
"replaces": "com.companyname.NewApp.iOS"
},
"WindowsSdk": {
"type": "parameter",
"description": "Windows SDK Target Version. Minimum Version is Fall Creator's Update (10.0.16299).",
"dataType": "string",
"replaces": "WindowsSdk",
"defaultValue": "10.0.17763.0"
},
"MicrosoftNETCoreUniversalWindowsPlatformPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "MicrosoftNETCoreUniversalWindowsPlatformPkgVersion",
"defaultValue": "6.2.10"
},
"AndroidSDKVersion": {
"type": "parameter",
"datatype": "string",
"replaces": "AndroidSDKVersion",
"defaultValue": "v11.0"
},
"TargetAndroidAPI": {
"type": "parameter",
"datatype": "string",
"replaces": "TargetAndroidAPI",
"defaultValue": "30"
},
"MinAndroidAPI": {
"type": "parameter",
"datatype": "int",
"replaces": "MinAndroidAPI",
"defaultValue": "21"
},
"XamarinEssentialsSdk": {
"type": "parameter",
"dataType": "string",
Expand Down Expand Up @@ -159,139 +83,6 @@
"dataType": "string",
"replaces": "FSharpCorePkgVersion",
"defaultValue": "6.0.1"
},
"OpenTKPkgVersion": {
"type": "parameter",
"dataType": "string",
"replaces": "OpenTKPkgVersion",
"defaultValue": "3.1.0"
},
"ProjectID": {
"type": "generated",
"generator": "guid",
"replaces": "Project_ID"
},
"UserID": {
"type": "generated",
"generator": "guid",
"replaces": "User_ID"
},
"iOS": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "true"
},
"macOS": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"GTK": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"WPF": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"Android": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
},
"UWP": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false"
}
},
"sources": [
{
"modifiers": [
{
"condition": "(!iOS)",
"exclude": [
"NewApp.iOS/**/*"
]
},
{
"condition": "(!Android)",
"exclude": [
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.Gtk/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
"NewApp.WPF/**/*"
]
},
{
"condition": "(!macOS)",
"exclude": [
"NewApp.macOS/**/*"
]
},
{
"condition": "(!UWP)",
"exclude": [
"NewApp.UWP/**/*"
]
}
]
},
{
"source": "./",
"condition": "(kind == \"blank\")",
"modifiers": [
{
"condition": "(!iOS)",
"exclude": [
"NewApp.iOS/**/*"
]
},
{
"condition": "(!Android)",
"exclude": [
"NewApp.Android/**/*"
]
},
{
"condition": "(!GTK)",
"exclude": [
"NewApp.Gtk/**/*"
]
},
{
"condition": "(!WPF)",
"exclude": [
"NewApp.WPF/**/*"
]
},
{
"condition": "(!macOS)",
"exclude": [
"NewApp.macOS/**/*"
]
},
{
"condition": "(!UWP)",
"exclude": [
"NewApp.UWP/**/*"
]
}
],
"copyOnly": [
"**/*.targets"
]
}
]
}
}
2 changes: 1 addition & 1 deletion templates/content/blank/NewApp.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<key>CFBundleIdentifier</key>
<string>com.companyname.NewApp.iOS</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>CFBundleName</key>
Expand Down
4 changes: 2 additions & 2 deletions templates/content/blank/NewApp.iOS/NewApp.iOS.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@
<Private>True</Private>
</Reference>
<Reference Include="Fabulous">
<HintPath>..\packages\Fabulous.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.dll</HintPath>
<HintPath>..\packages\Fabulous.FabulousPkgsVersion\lib\netstandard2.1\Fabulous.dll</HintPath>
</Reference>
<Reference Include="Fabulous.XamarinForms">
<HintPath>..\packages\Fabulous.XamarinForms.FabulousPkgsVersion\lib\netstandard2.0\Fabulous.XamarinForms.dll</HintPath>
<HintPath>..\packages\Fabulous.XamarinForms.FabulousPkgsVersion\lib\netstandard2.1\Fabulous.XamarinForms.dll</HintPath>
</Reference>
<Reference Include="Xamarin.iOS" />
</ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions templates/content/blank/NewApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ Global
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|Any CPU.Build.0 = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.AppStore|iPhone.ActiveCfg = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.AppStore|iPhone.Build.0 = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Debug|iPhone.Build.0 = Debug|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|iPhone.ActiveCfg = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|iPhone.Build.0 = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{99E19497-29A6-4B77-B773-BEC55F9B55DC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
Expand All @@ -42,5 +54,11 @@ Global
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.AppStore|iPhone.Build.0 = AppStore|iPhone
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Debug|iPhoneSimulator.Deploy.0 = Debug|iPhoneSimulator
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Debug|Any CPU.Deploy.0 = Debug|iPhoneSimulator
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Debug|iPhone.Deploy.0 = Debug|iPhone
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Release|Any CPU.Deploy.0 = Release|iPhoneSimulator
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Release|iPhone.Deploy.0 = Release|iPhone
{1069F96F-A42B-4CD8-8FA1-7F047C726B88}.Release|iPhoneSimulator.Deploy.0 = Release|iPhoneSimulator
EndGlobalSection
EndGlobal
36 changes: 16 additions & 20 deletions templates/content/blank/NewApp/App.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace NewApp

open Xamarin.Forms
open Fabulous
open Fabulous.XamarinForms

open type Fabulous.XamarinForms.View
open type View

module App =
type Model = { Count: int }
Expand All @@ -23,24 +22,21 @@ module App =
let view model =
Application(
ContentPage(
VerticalStackLayout(
[ Label("Hello from Fabulous v2!")
.font(NamedSize.Title)
.centerTextHorizontally ()

VerticalStackLayout(
[

Label($"Count is {model.Count}")
.centerTextHorizontally ()

Button("Increment", Increment)
Button("Decrement", Decrement)

]
)
.centerVertically (expand = true) ]
)
"NewApp",
VerticalStackLayout() {
Label("Hello from Fabulous v2!")
.font(namedSize = NamedSize.Title)
.centerTextHorizontal ()

(VerticalStackLayout() {
Label($"Count is {model.Count}")
.centerTextHorizontal ()

Button("Increment", Increment)
Button("Decrement", Decrement)
})
.centerVertical (expand = true)
}
)
)

Expand Down
2 changes: 1 addition & 1 deletion templates/content/blank/NewApp/NewApp.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
</PropertyGroup>
Expand Down

0 comments on commit c614570

Please sign in to comment.