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

Deprecate 0.10 templates #250

Merged
merged 2 commits into from
Mar 11, 2024
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
50 changes: 4 additions & 46 deletions templates/csharp/app-mvvm/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net6.0",
"description": "Target net6.0"
},
{
"choice": "net7.0",
"description": "Target net7.0"
},
{
"choice": "net8.0",
"description": "Target net8.0"
Expand Down Expand Up @@ -71,10 +63,6 @@
"description": "The target version of Avalonia NuGet packages.",
"datatype": "choice",
"choices": [
{
"choice": "0.10.22",
"description": "Target 0.10.22"
},
{
"choice": "11.0.10",
"description": "Target 11.0.10 (Latest stable)"
Expand All @@ -83,10 +71,6 @@
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "11.0.10"
},
"AvaloniaStableChosen": {
"type": "computed",
"value": "(AvaloniaVersion == \"11.0.10\")"
},
"UseCompiledBindings": {
"type": "parameter",
"description": "Defines if CompiledBindings should be enabled by default in the project (only supported in 11.0 version and newer).",
Expand All @@ -111,48 +95,22 @@
{
"modifiers": [
{
"condition": "(RemoveViewLocator && AvaloniaStableChosen)",
"condition": "(RemoveViewLocator)",
"exclude": [
"App.axaml",
"App.v0.10.axaml",
"App.v0.10.RemoveViewLocator.axaml",
"ViewLocator.cs"
],
"rename": {
"App.RemoveViewLocator.axaml": "App.axaml"
}
},
{
"condition": "(!RemoveViewLocator && AvaloniaStableChosen)",
"condition": "(!RemoveViewLocator)",
"exclude": [
"App.v0.10.axaml",
"App.RemoveViewLocator.axaml",
"App.v0.10.RemoveViewLocator.axaml"
"App.RemoveViewLocator.axaml"
]
},
{
"condition": "(RemoveViewLocator && !AvaloniaStableChosen)",
"exclude": [
"App.axaml",
"App.v0.10.axaml",
"App.RemoveViewLocator.axaml",
"ViewLocator.cs"
],
"rename": {
"App.v0.10.RemoveViewLocator.axaml": "App.axaml"
}
},
{
"condition": "(!RemoveViewLocator && !AvaloniaStableChosen)",
"exclude": [
"App.axaml",
"App.RemoveViewLocator.axaml",
"App.v0.10.RemoveViewLocator.axaml"
],
"rename": {
"App.v0.10.axaml": "App.axaml"
}
}

]
}
],
Expand Down
4 changes: 0 additions & 4 deletions templates/csharp/app-mvvm/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ public override void OnFrameworkInitializationCompleted()
#if (CommunityToolkitChosen)
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
#if (AvaloniaStableChosen)
BindingPlugins.DataValidators.RemoveAt(0);
#else
ExpressionObserver.DataValidators.RemoveAll(x => x is DataAnnotationsValidationPlugin);
#endif
#endif
desktop.MainWindow = new MainWindow
{
Expand Down
8 changes: 0 additions & 8 deletions templates/csharp/app-mvvm/App.v0.10.RemoveViewLocator.axaml

This file was deleted.

13 changes: 0 additions & 13 deletions templates/csharp/app-mvvm/App.v0.10.axaml

This file was deleted.

11 changes: 0 additions & 11 deletions templates/csharp/app-mvvm/AvaloniaAppTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,17 @@
<AvaloniaResource Include="Assets\**" />
</ItemGroup>

<!--#if (!AvaloniaStableChosen) -->
<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.Themes.Fluent" />
</ItemGroup>
<!--#endif -->

<ItemGroup>
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Fonts.Inter" 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="AvaloniaVersionTemplateParameter" />
<!--#if (ReactiveUIToolkitChosen) -->
<PackageReference Include="Avalonia.ReactiveUI" Version="AvaloniaVersionTemplateParameter" />
<!--#elif (CommunityToolkitChosen)-->
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<!--#endif -->
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="XamlNameReferenceGenerator" Version="1.6.1" />
<!--#endif -->
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions templates/csharp/app-mvvm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ public static void Main(string[] args) => BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
#if (AvaloniaStableChosen)
.WithInterFont()
#endif
#if (ReactiveUIToolkitChosen)
.LogToTrace()
.UseReactiveUI();
Expand Down
5 changes: 1 addition & 4 deletions templates/csharp/app-mvvm/ViewLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ namespace AvaloniaAppTemplate;

public class ViewLocator : IDataTemplate
{
#if (AvaloniaStableChosen)

public Control? Build(object? data)
#else
public IControl Build(object data)
#endif
{
if (data is null)
return null;
Expand Down
37 changes: 0 additions & 37 deletions templates/csharp/app/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net6.0",
"description": "Target net6.0"
},
{
"choice": "net7.0",
"description": "Target net7.0"
},
{
"choice": "net8.0",
"description": "Target net8.0"
Expand All @@ -47,10 +39,6 @@
"description": "The target version of Avalonia NuGet packages.",
"datatype": "choice",
"choices": [
{
"choice": "0.10.22",
"description": "Target 0.10.22"
},
{
"choice": "11.0.10",
"description": "Target 11.0.10 (Latest stable)"
Expand All @@ -59,10 +47,6 @@
"replaces": "AvaloniaVersionTemplateParameter",
"defaultValue": "11.0.10"
},
"AvaloniaStableChosen": {
"type": "computed",
"value": "(AvaloniaVersion == \"11.0.10\")"
},
"UseCompiledBindings": {
"type": "parameter",
"description": "Defines if CompiledBindings should be enabled by default in the project (only supported in 11.0 version and newer).",
Expand All @@ -76,27 +60,6 @@
"binding": "HostIdentifier"
}
},
"sources": [
{
"modifiers": [
{
"condition": "(AvaloniaStableChosen)",
"exclude": [
"App.v0.10.axaml"
]
},
{
"condition": "(!AvaloniaStableChosen)",
"exclude": [
"App.axaml"
]
}
],
"rename": {
"App.v0.10.axaml": "App.axaml"
}
}
],
"primaryOutputs": [
{ "path": "AvaloniaAppTemplate.csproj" },
{
Expand Down
8 changes: 0 additions & 8 deletions templates/csharp/app/App.v0.10.axaml

This file was deleted.

11 changes: 0 additions & 11 deletions templates/csharp/app/AvaloniaAppTemplate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,12 @@
<!--#endif -->
</PropertyGroup>

<!--#if (!AvaloniaStableChosen) -->
<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.Themes.Fluent" />
</ItemGroup>
<!--#endif -->

<ItemGroup>
<PackageReference Include="Avalonia" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Desktop" Version="AvaloniaVersionTemplateParameter" />
<!--#if (AvaloniaStableChosen) -->
<PackageReference Include="Avalonia.Themes.Fluent" Version="AvaloniaVersionTemplateParameter" />
<PackageReference Include="Avalonia.Fonts.Inter" 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="AvaloniaVersionTemplateParameter" />
<!--#if (!AvaloniaStableChosen) -->
<PackageReference Include="XamlNameReferenceGenerator" Version="1.6.1" />
<!--#endif -->
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions templates/csharp/app/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public static void Main(string[] args) => BuildAvaloniaApp()
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
#if (AvaloniaStableChosen)
.WithInterFont()
#endif
.LogToTrace();
}
41 changes: 1 addition & 40 deletions templates/fsharp/app-mvvm/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net6.0",
"description": "Target net6.0"
},
{
"choice": "net7.0",
"description": "Target net7.0"
},
{
"choice": "net8.0",
"description": "Target net8.0"
Expand Down Expand Up @@ -71,10 +63,6 @@
"description": "The target version of Avalonia NuGet packages.",
"datatype": "choice",
"choices": [
{
"choice": "0.10.22",
"description": "Target 0.10.22"
},
{
"choice": "11.0.10",
"description": "Target 11.0.10 (Latest stable)"
Expand Down Expand Up @@ -114,8 +102,6 @@
"condition": "(RemoveViewLocator && AvaloniaStableChosen)",
"exclude": [
"App.axaml",
"App.v0.10.axaml",
"App.v0.10.RemoveViewLocator.axaml",
"ViewLocator.fs"
],
"rename": {
Expand All @@ -125,33 +111,8 @@
{
"condition": "(!RemoveViewLocator && AvaloniaStableChosen)",
"exclude": [
"App.v0.10.axaml",
"App.RemoveViewLocator.axaml",
"App.v0.10.RemoveViewLocator.axaml"
"App.RemoveViewLocator.axaml"
]
},
{
"condition": "(RemoveViewLocator && !AvaloniaStableChosen)",
"exclude": [
"App.axaml",
"App.v0.10.axaml",
"App.RemoveViewLocator.axaml",
"ViewLocator.fs"
],
"rename": {
"App.v0.10.RemoveViewLocator.axaml": "App.axaml"
}
},
{
"condition": "(!RemoveViewLocator && !AvaloniaStableChosen)",
"exclude": [
"App.axaml",
"App.RemoveViewLocator.axaml",
"App.v0.10.RemoveViewLocator.axaml"
],
"rename": {
"App.v0.10.axaml": "App.axaml"
}
}
]
}
Expand Down
4 changes: 0 additions & 4 deletions templates/fsharp/app-mvvm/App.axaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ type App() =
#if (CommunityToolkitChosen)
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
#if (AvaloniaStableChosen)
BindingPlugins.DataValidators.RemoveAt(0)
#else
ExpressionObserver.DataValidators.RemoveAll(fun x -> x :? DataAnnotationsValidationPlugin) |> ignore
#endif
#endif

match this.ApplicationLifetime with
Expand Down
8 changes: 0 additions & 8 deletions templates/fsharp/app-mvvm/App.v0.10.RemoveViewLocator.axaml

This file was deleted.

13 changes: 0 additions & 13 deletions templates/fsharp/app-mvvm/App.v0.10.axaml

This file was deleted.

Loading