Skip to content

Commit

Permalink
Merge pull request #135 from Mrxx99/feature/avalonia-version-for-mvvm
Browse files Browse the repository at this point in the history
Avalonia version choice for MVVM templates
  • Loading branch information
Takoooooo authored Dec 7, 2022
2 parents 3b43d58 + b20a183 commit 6be16ee
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 30 deletions.
20 changes: 20 additions & 0 deletions templates/csharp/app-mvvm/.template.config/ide.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "http://json.schemastore.org/ide.host",
"icon": "icon.png",
"symbolInfo": [
{
"id": "AvaloniaVersion",
"name": {
"text": "Avalonia Version"
},
"isVisible": true
},
{
"id": "MVVMToolkit",
"name": {
"text": "MVVM Toolkit"
},
"isVisible": true
}
]
}
21 changes: 21 additions & 0 deletions templates/csharp/app-mvvm/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@
"ReactiveUIToolkitChosen": {
"type": "computed",
"value": "(MVVMToolkit == \"ReactiveUI\")"
},
"AvaloniaVersion": {
"type": "parameter",
"description": "The target version of Avalonia NuGet packages.",
"datatype": "choice",
"choices": [
{
"choice": "0.10.18",
"description": "Target 0.10.18 (Latest stable)."
},
{
"choice": "11.0.0-preview4",
"description": "Target 11.0.0-preview4"
}
],
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "0.10.18"
},
"AvaloniaStableChosen": {
"type": "computed",
"value": "(AvaloniaVersion == \"0.10.18\")"
}
},
"sources": [
Expand Down
11 changes: 7 additions & 4 deletions templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<!--#endif -->
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="AvaloniaVersionTemplateParameter" />
<!--#if (ReactiveUIToolkitChosen) -->
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="AvaloniaVersionTemplateParameter" />
<!--#else-->
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<!--#endif -->
Expand Down
1 change: 1 addition & 0 deletions templates/csharp/app/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"description": "Target 11.0.0-preview4"
}
],
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "0.10.18"
},
"AvaloniaStableChosen": {
Expand Down
17 changes: 6 additions & 11 deletions templates/csharp/app/AvaloniaAppTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@
</ItemGroup>

<ItemGroup>
<!--#if (AvaloniaStableChosen) -->
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<!--#endif -->
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<!--#else-->
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview4" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />
<!--#endif -->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.5.1" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions templates/fsharp/app-mvvm/.template.config/ide.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "http://json.schemastore.org/ide.host",
"icon": "icon.png",
"symbolInfo": [
{
"id": "AvaloniaVersion",
"name": {
"text": "Avalonia Version"
},
"isVisible": true
}
]
}
36 changes: 36 additions & 0 deletions templates/fsharp/app-mvvm/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,41 @@
"tags": {
"language": "F#",
"type": "project"
},
"symbols": {
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net6.0",
"description": "Target net6.0"
}
],
"replaces": "net6.0",
"defaultValue": "net6.0"
},
"AvaloniaVersion": {
"type": "parameter",
"description": "The target version of Avalonia NuGet packages.",
"datatype": "choice",
"choices": [
{
"choice": "0.10.18",
"description": "Target 0.10.18 (Latest stable)."
},
{
"choice": "11.0.0-preview4",
"description": "Target 11.0.0-preview4"
}
],
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "0.10.18"
},
"AvaloniaStableChosen": {
"type": "computed",
"value": "(AvaloniaVersion == \"0.10.18\")"
}
}
}
12 changes: 8 additions & 4 deletions templates/fsharp/app-mvvm/AvaloniaAppTemplate.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<!--#endif -->
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.ReactiveUI" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions templates/fsharp/app/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"description": "Target 11.0.0-preview4"
}
],
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "0.10.18"
},
"AvaloniaStableChosen": {
Expand Down
18 changes: 7 additions & 11 deletions templates/fsharp/app/AvaloniaAppTemplate.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@
</ItemGroup>

<ItemGroup>
<!--#if (AvaloniaStableChosen) -->
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<!--#endif -->
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" />
<!--#else-->
<PackageReference Include="Avalonia" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview4" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.0-preview4" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview4" />
<!--#endif -->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
</Project>

0 comments on commit 6be16ee

Please sign in to comment.