This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Source Generator project * Configure Source Generator project * Make sure that we will use it just in NETSTANDARD1_0 * removed old build and csproj clean up * fixed sample app * added SG dll into Libs folder * Added SourceGenerator project in all solutions * Reference the SG dll Co-authored-by: Brandon Minnick <[email protected]> Co-authored-by: Javier Suárez <[email protected]>
- Loading branch information
1 parent
9716d94
commit e981bea
Showing
12 changed files
with
109 additions
and
21 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/CommunityToolkit/Xamarin.CommunityToolkit/Helpers/XCT.shared.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace Xamarin.CommunityToolkit.Helpers | ||
{ | ||
public static partial class XCT | ||
{ | ||
/// <summary> | ||
/// Just a wrapper to solve VS xaml issues | ||
/// </summary> | ||
public static void Init() | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
src/CommunityToolkit/Xamarin.CommunityToolkit/build/PreserveXamarinCommunityToolkit.cs
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/CommunityToolkit/Xamarin.CommunityToolkit/build/Xamarin.CommunityToolkit.targets
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
src/SourceGenerator/Xamarin.CommunityToolkit.SourceGenerator/XCTGenerator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
using Microsoft.CodeAnalysis.Text; | ||
|
||
namespace Xamarin.CommunityToolkit.SourceGenerator | ||
{ | ||
[Generator] | ||
public class XCTGenerator : ISourceGenerator | ||
{ | ||
const string code = @" | ||
namespace Xamarin.CommunityToolkit.Initializer | ||
{ | ||
sealed class XCTInitCaller | ||
{ | ||
public void CallInit() | ||
{ | ||
Xamarin.CommunityToolkit.Helpers.XCT.Init(); | ||
} | ||
} | ||
}"; | ||
|
||
public void Execute(GeneratorExecutionContext context) | ||
{ | ||
context.AddSource("InitCaller.g.cs", SourceText.From(code, Encoding.UTF8)); | ||
} | ||
|
||
public void Initialize(GeneratorInitializationContext context) | ||
{ | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
.../Xamarin.CommunityToolkit.SourceGenerator/Xamarin.CommunityToolkit.SourceGenerator.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<LangVersion>latest</LangVersion> | ||
<IsRoslynComponent>true</IsRoslynComponent> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" PrivateAssets="all" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" /> | ||
</ItemGroup> | ||
</Project> |