Browse Source

housekeeping: Rename to Avalonia.NameGenerator (#16)

pull/10407/head
Artyom V. Gorchakov 5 years ago
committed by GitHub
parent
commit
ecc9677a23
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/ci-build.yml
  2. 2
      LICENSE
  3. 10
      README.md
  4. 2
      src/Avalonia.NameGenerator.Sandbox/App.xaml
  5. 7
      src/Avalonia.NameGenerator.Sandbox/App.xaml.cs
  6. 4
      src/Avalonia.NameGenerator.Sandbox/Avalonia.NameGenerator.Sandbox.csproj
  7. 2
      src/Avalonia.NameGenerator.Sandbox/Controls/CustomTextBox.cs
  8. 5
      src/Avalonia.NameGenerator.Sandbox/Program.cs
  9. 4
      src/Avalonia.NameGenerator.Sandbox/Views/SignUpView.xaml
  10. 5
      src/Avalonia.NameGenerator.Sandbox/Views/SignUpView.xaml.cs
  11. 2
      src/Avalonia.NameGenerator.Tests/Avalonia.NameGenerator.Tests.csproj
  12. 4
      src/Avalonia.NameGenerator.Tests/MiniCompilerTests.cs
  13. 4
      src/Avalonia.NameGenerator.Tests/NameResolverTests.cs
  14. 0
      src/Avalonia.NameGenerator.Tests/Views/AttachedProps.xml
  15. 0
      src/Avalonia.NameGenerator.Tests/Views/CustomControls.xml
  16. 0
      src/Avalonia.NameGenerator.Tests/Views/DataTemplates.xml
  17. 0
      src/Avalonia.NameGenerator.Tests/Views/NamedControl.xml
  18. 0
      src/Avalonia.NameGenerator.Tests/Views/NamedControls.xml
  19. 0
      src/Avalonia.NameGenerator.Tests/Views/NoNamedControls.xml
  20. 0
      src/Avalonia.NameGenerator.Tests/Views/SignUpView.xml
  21. 0
      src/Avalonia.NameGenerator.Tests/Views/xNamedControl.xml
  22. 0
      src/Avalonia.NameGenerator.Tests/Views/xNamedControls.xml
  23. 6
      src/Avalonia.NameGenerator.sln
  24. 0
      src/Avalonia.NameGenerator/Avalonia.NameGenerator.csproj
  25. 2
      src/Avalonia.NameGenerator/Infrastructure/DataTemplateTransformer.cs
  26. 2
      src/Avalonia.NameGenerator/Infrastructure/INameResolver.cs
  27. 2
      src/Avalonia.NameGenerator/Infrastructure/MiniCompiler.cs
  28. 2
      src/Avalonia.NameGenerator/Infrastructure/NameDirectiveTransformer.cs
  29. 2
      src/Avalonia.NameGenerator/Infrastructure/NameReceiver.cs
  30. 2
      src/Avalonia.NameGenerator/Infrastructure/NameResolver.cs
  31. 2
      src/Avalonia.NameGenerator/Infrastructure/RoslynTypeSystem.cs
  32. 6
      src/Avalonia.NameGenerator/NameReferenceGenerator.cs
  33. 2
      src/Avalonia.NameGenerator/NameReferenceSyntaxReceiver.cs
  34. 8
      src/Directory.build.props

2
.github/workflows/ci-build.yml

@ -9,7 +9,7 @@ on:
env:
configuration: Release
productNamespacePrefix: "XamlNameReferenceGenerator"
productNamespacePrefix: "Avalonia.NameGenerator"
jobs:
build:

2
LICENSE

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Artyom V. Gorchakov and Contributors
Copyright (c) .NET Foundation and Contributors All Rights Reserved
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

10
README.md

@ -1,4 +1,4 @@
[![NuGet Stats](https://img.shields.io/nuget/v/XamlNameReferenceGenerator.svg)](https://www.nuget.org/packages/XamlNameReferenceGenerator) [![downloads](https://img.shields.io/nuget/dt/XamlNameReferenceGenerator)](https://www.nuget.org/packages/XamlNameReferenceGenerator) ![Build](https://github.com/worldbeater/XamlNameReferenceGenerator/workflows/Build/badge.svg) ![License](https://img.shields.io/github/license/worldbeater/XamlNameReferenceGenerator.svg) ![Size](https://img.shields.io/github/repo-size/worldbeater/XamlNameReferenceGenerator.svg)
[![NuGet Stats](https://img.shields.io/nuget/v/Avalonia.NameGenerator.svg)](https://www.nuget.org/packages/Avalonia.NameGenerator) [![downloads](https://img.shields.io/nuget/dt/Avalonia.NameGenerator)](https://www.nuget.org/packages/Avalonia.NameGenerator) ![Build](https://github.com/avaloniaui/Avalonia.NameGenerator/workflows/Build/badge.svg) ![License](https://img.shields.io/github/license/avaloniaui/Avalonia.NameGenerator.svg) ![Size](https://img.shields.io/github/repo-size/avaloniaui/Avalonia.NameGenerator.svg)
> **Warning** This tool hasn't been extensively tested, so use at your own risk.
@ -27,14 +27,14 @@ So in your project file you write the following code:
And then you reference the source generator by installing a NuGet package:
```
dotnet add package XamlNameReferenceGenerator
dotnet add package Avalonia.NameGenerator
```
Or, if you are using submodules, reference the generator as such:
```xml
<ItemGroup>
<ProjectReference Include="../XamlNameReferenceGenerator/XamlNameReferenceGenerator.csproj"
<ProjectReference Include="..\Avalonia.NameGenerator\Avalonia.NameGenerator.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
@ -58,7 +58,7 @@ public partial class SignUpView : Window
### What do the generated sources look like?
For the [`SignUpView` view class](https://github.com/worldbeater/XamlNameReferenceGenerator/blob/main/src/XamlNameReferenceGenerator.Sandbox/Views/SignUpView.xaml) from [the sandbox project](https://github.com/worldbeater/XamlNameReferenceGenerator/tree/main/XamlNameReferenceGenerator.Sandbox), we get the following generated output:
For the [`SignUpView` view class](https://github.com/avaloniaui/Avalonia.NameGenerator/blob/main/src/Avalonia.NameGenerator.Sandbox/Views/SignUpView.xaml) from [the sandbox project](https://github.com/avaloniaui/Avalonia.NameGenerator/tree/main/Avalonia.NameGenerator.Sandbox), we get the following generated output:
```cs
// <auto-generated />
@ -69,7 +69,7 @@ namespace Your.View.Namespace
{
partial class SignUpView
{
internal global::XamlNameReferenceGenerator.Sandbox.Controls.CustomTextBox UserNameTextBox => this.FindControl<global::XamlNameReferenceGenerator.Sandbox.Controls.CustomTextBox>("UserNameTextBox");
internal global::Avalonia.NameGenerator.Sandbox.Controls.CustomTextBox UserNameTextBox => this.FindControl<global::Avalonia.NameGenerator.Sandbox.Controls.CustomTextBox>("UserNameTextBox");
internal global::Avalonia.Controls.TextBlock UserNameValidation => this.FindControl<global::Avalonia.Controls.TextBlock>("UserNameValidation");
internal global::Avalonia.Controls.TextBox PasswordTextBox => this.FindControl<global::Avalonia.Controls.TextBox>("PasswordTextBox");
internal global::Avalonia.Controls.TextBlock PasswordValidation => this.FindControl<global::Avalonia.Controls.TextBlock>("PasswordValidation");

2
src/XamlNameReferenceGenerator.Sandbox/App.xaml → src/Avalonia.NameGenerator.Sandbox/App.xaml

@ -1,6 +1,6 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="XamlNameReferenceGenerator.Sandbox.App">
x:Class="Avalonia.NameGenerator.Sandbox.App">
<Application.Styles>
<StyleInclude Source="avares://Citrus.Avalonia/Citrus.xaml" />
</Application.Styles>

7
src/XamlNameReferenceGenerator.Sandbox/App.xaml.cs → src/Avalonia.NameGenerator.Sandbox/App.xaml.cs

@ -1,8 +1,7 @@
using Avalonia;
using Avalonia.Markup.Xaml;
using XamlNameReferenceGenerator.Sandbox.Views;
using Avalonia.Markup.Xaml;
using Avalonia.NameGenerator.Sandbox.Views;
namespace XamlNameReferenceGenerator.Sandbox
namespace Avalonia.NameGenerator.Sandbox
{
public class App : Application
{

4
src/XamlNameReferenceGenerator.Sandbox/XamlNameReferenceGenerator.Sandbox.csproj → src/Avalonia.NameGenerator.Sandbox/Avalonia.NameGenerator.Sandbox.csproj

@ -21,6 +21,8 @@
<AdditionalFiles Include="**\*.xaml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../XamlNameReferenceGenerator/XamlNameReferenceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\Avalonia.NameGenerator\Avalonia.NameGenerator.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false" />
</ItemGroup>
</Project>

2
src/XamlNameReferenceGenerator.Sandbox/Controls/CustomTextBox.cs → src/Avalonia.NameGenerator.Sandbox/Controls/CustomTextBox.cs

@ -1,6 +1,6 @@
using Avalonia.Controls;
namespace XamlNameReferenceGenerator.Sandbox.Controls
namespace Avalonia.NameGenerator.Sandbox.Controls
{
public class CustomTextBox : TextBox { }
}

5
src/XamlNameReferenceGenerator.Sandbox/Program.cs → src/Avalonia.NameGenerator.Sandbox/Program.cs

@ -1,7 +1,6 @@
using Avalonia;
using Avalonia.ReactiveUI;
using Avalonia.ReactiveUI;
namespace XamlNameReferenceGenerator.Sandbox
namespace Avalonia.NameGenerator.Sandbox
{
internal static class Program
{

4
src/XamlNameReferenceGenerator.Sandbox/Views/SignUpView.xaml → src/Avalonia.NameGenerator.Sandbox/Views/SignUpView.xaml

@ -1,7 +1,7 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:XamlNameReferenceGenerator.Sandbox.Controls"
x:Class="XamlNameReferenceGenerator.Sandbox.Views.SignUpView">
xmlns:controls="clr-namespace:Avalonia.NameGenerator.Sandbox.Controls"
x:Class="Avalonia.NameGenerator.Sandbox.Views.SignUpView">
<StackPanel>
<!-- Regular name directives. -->
<controls:CustomTextBox Margin="0 10 0 0"

5
src/XamlNameReferenceGenerator.Sandbox/Views/SignUpView.xaml.cs → src/Avalonia.NameGenerator.Sandbox/Views/SignUpView.xaml.cs

@ -1,7 +1,8 @@
using Avalonia.Controls;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace XamlNameReferenceGenerator.Sandbox.Views
namespace Avalonia.NameGenerator.Sandbox.Views
{
/// <summary>
/// This is a sample view class with typed x:Name references generated at compile-time using

2
src/XamlNameReferenceGenerator.Tests/XamlNameReferenceGenerator.Tests.csproj → src/Avalonia.NameGenerator.Tests/Avalonia.NameGenerator.Tests.csproj

@ -19,6 +19,6 @@
<EmbeddedResource Include="Views/*.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../XamlNameReferenceGenerator/XamlNameReferenceGenerator.csproj" />
<ProjectReference Include="..\Avalonia.NameGenerator\Avalonia.NameGenerator.csproj" />
</ItemGroup>
</Project>

4
src/XamlNameReferenceGenerator.Tests/MiniCompilerTests.cs → src/Avalonia.NameGenerator.Tests/MiniCompilerTests.cs

@ -3,12 +3,12 @@ using System.ComponentModel;
using Avalonia.Controls;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using XamlNameReferenceGenerator.Infrastructure;
using Avalonia.NameGenerator.Infrastructure;
using XamlX;
using XamlX.Parsers;
using Xunit;
namespace XamlNameReferenceGenerator.Tests
namespace Avalonia.NameGenerator.Tests
{
public class MiniCompilerTests
{

4
src/XamlNameReferenceGenerator.Tests/NameResolverTests.cs → src/Avalonia.NameGenerator.Tests/NameResolverTests.cs

@ -7,10 +7,10 @@ using Avalonia.Controls;
using Avalonia.ReactiveUI;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using XamlNameReferenceGenerator.Infrastructure;
using Avalonia.NameGenerator.Infrastructure;
using Xunit;
namespace XamlNameReferenceGenerator.Tests
namespace Avalonia.NameGenerator.Tests
{
public class NameResolverTests
{

0
src/XamlNameReferenceGenerator.Tests/Views/AttachedProps.xml → src/Avalonia.NameGenerator.Tests/Views/AttachedProps.xml

0
src/XamlNameReferenceGenerator.Tests/Views/CustomControls.xml → src/Avalonia.NameGenerator.Tests/Views/CustomControls.xml

0
src/XamlNameReferenceGenerator.Tests/Views/DataTemplates.xml → src/Avalonia.NameGenerator.Tests/Views/DataTemplates.xml

0
src/XamlNameReferenceGenerator.Tests/Views/NamedControl.xml → src/Avalonia.NameGenerator.Tests/Views/NamedControl.xml

0
src/XamlNameReferenceGenerator.Tests/Views/NamedControls.xml → src/Avalonia.NameGenerator.Tests/Views/NamedControls.xml

0
src/XamlNameReferenceGenerator.Tests/Views/NoNamedControls.xml → src/Avalonia.NameGenerator.Tests/Views/NoNamedControls.xml

0
src/XamlNameReferenceGenerator.Tests/Views/SignUpView.xml → src/Avalonia.NameGenerator.Tests/Views/SignUpView.xml

0
src/XamlNameReferenceGenerator.Tests/Views/xNamedControl.xml → src/Avalonia.NameGenerator.Tests/Views/xNamedControl.xml

0
src/XamlNameReferenceGenerator.Tests/Views/xNamedControls.xml → src/Avalonia.NameGenerator.Tests/Views/xNamedControls.xml

6
src/XamlNameReferenceGenerator.sln → src/Avalonia.NameGenerator.sln

@ -1,10 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlNameReferenceGenerator", "XamlNameReferenceGenerator\XamlNameReferenceGenerator.csproj", "{684ADF3B-8DFC-4F4A-93AD-F856561FCC39}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.NameGenerator", "Avalonia.NameGenerator\Avalonia.NameGenerator.csproj", "{684ADF3B-8DFC-4F4A-93AD-F856561FCC39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlNameReferenceGenerator.Sandbox", "XamlNameReferenceGenerator.Sandbox\XamlNameReferenceGenerator.Sandbox.csproj", "{C90BB1C6-5C33-494A-96FA-FEE7B34CA83C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.NameGenerator.Sandbox", "Avalonia.NameGenerator.Sandbox\Avalonia.NameGenerator.Sandbox.csproj", "{C90BB1C6-5C33-494A-96FA-FEE7B34CA83C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlNameReferenceGenerator.Tests", "XamlNameReferenceGenerator.Tests\XamlNameReferenceGenerator.Tests.csproj", "{B13A0A44-85BC-49A7-970F-6C9BF8BDFD54}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.NameGenerator.Tests", "Avalonia.NameGenerator.Tests\Avalonia.NameGenerator.Tests.csproj", "{B13A0A44-85BC-49A7-970F-6C9BF8BDFD54}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0
src/XamlNameReferenceGenerator/XamlNameReferenceGenerator.csproj → src/Avalonia.NameGenerator/Avalonia.NameGenerator.csproj

2
src/XamlNameReferenceGenerator/Infrastructure/DataTemplateTransformer.cs → src/Avalonia.NameGenerator/Infrastructure/DataTemplateTransformer.cs

@ -1,7 +1,7 @@
using XamlX.Ast;
using XamlX.Transform;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal class DataTemplateTransformer : IXamlAstTransformer
{

2
src/XamlNameReferenceGenerator/Infrastructure/INameResolver.cs → src/Avalonia.NameGenerator/Infrastructure/INameResolver.cs

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal interface INameResolver
{

2
src/XamlNameReferenceGenerator/Infrastructure/MiniCompiler.cs → src/Avalonia.NameGenerator/Infrastructure/MiniCompiler.cs

@ -6,7 +6,7 @@ using XamlX.Transform;
using XamlX.Transform.Transformers;
using XamlX.TypeSystem;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal sealed class MiniCompiler : XamlCompiler<object, IXamlEmitResult>
{

2
src/XamlNameReferenceGenerator/Infrastructure/NameDirectiveTransformer.cs → src/Avalonia.NameGenerator/Infrastructure/NameDirectiveTransformer.cs

@ -2,7 +2,7 @@
using XamlX.Ast;
using XamlX.Transform;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal class NameDirectiveTransformer : IXamlAstTransformer
{

2
src/XamlNameReferenceGenerator/Infrastructure/NameReceiver.cs → src/Avalonia.NameGenerator/Infrastructure/NameReceiver.cs

@ -2,7 +2,7 @@
using System.Linq;
using XamlX.Ast;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal sealed class NameReceiver : IXamlAstVisitor
{

2
src/XamlNameReferenceGenerator/Infrastructure/NameResolver.cs → src/Avalonia.NameGenerator/Infrastructure/NameResolver.cs

@ -3,7 +3,7 @@ using Microsoft.CodeAnalysis.CSharp;
using XamlX;
using XamlX.Parsers;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
internal class NameResolver : INameResolver
{

2
src/XamlNameReferenceGenerator/Infrastructure/RoslynTypeSystem.cs → src/Avalonia.NameGenerator/Infrastructure/RoslynTypeSystem.cs

@ -4,7 +4,7 @@ using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using XamlX.TypeSystem;
namespace XamlNameReferenceGenerator.Infrastructure
namespace Avalonia.NameGenerator.Infrastructure
{
public class RoslynTypeSystem : IXamlTypeSystem
{

6
src/XamlNameReferenceGenerator/NameReferenceGenerator.cs → src/Avalonia.NameGenerator/NameReferenceGenerator.cs

@ -5,12 +5,12 @@ using System.Runtime.CompilerServices;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Text;
using System.Text;
using Avalonia.NameGenerator.Infrastructure;
using Microsoft.CodeAnalysis.CSharp;
using XamlNameReferenceGenerator.Infrastructure;
[assembly: InternalsVisibleTo("XamlNameReferenceGenerator.Tests")]
[assembly: InternalsVisibleTo("Avalonia.NameGenerator.Tests")]
namespace XamlNameReferenceGenerator
namespace Avalonia.NameGenerator
{
[Generator]
public class NameReferenceGenerator : ISourceGenerator

2
src/XamlNameReferenceGenerator/NameReferenceSyntaxReceiver.cs → src/Avalonia.NameGenerator/NameReferenceSyntaxReceiver.cs

@ -3,7 +3,7 @@ using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace XamlNameReferenceGenerator
namespace Avalonia.NameGenerator
{
internal class NameReferenceSyntaxReceiver : ISyntaxReceiver
{

8
src/Directory.build.props

@ -1,11 +1,11 @@
<Project>
<PropertyGroup>
<Product>XamlNameReferenceGenerator</Product>
<Product>Avalonia.NameGenerator</Product>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/worldbeater/XamlNameReferenceGenerator/</PackageProjectUrl>
<PackageProjectUrl>https://github.com/avaloniaui/Avalonia.NameGenerator/</PackageProjectUrl>
<Description>Generates typed x:Name references to Avalonia controls declared in XAML.</Description>
<PackageReleaseNotes>https://github.com/worldbeater/XamlNameReferenceGenerator/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/worldbeater/XamlNameReferenceGenerator</RepositoryUrl>
<PackageReleaseNotes>https://github.com/avaloniaui/Avalonia.NameGenerator/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/avaloniaui/Avalonia.NameGenerator</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

Loading…
Cancel
Save