-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nhibernate_source_generator'
- Loading branch information
Showing
21 changed files
with
532 additions
and
18 deletions.
There are no files selected for viewing
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
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
2 changes: 1 addition & 1 deletion
2
CoreSharp.NHibernate.SQLServer.Tests/CoreSharp.NHibernate.SQLServer.Tests.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
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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Xml.Serialization; | ||
|
||
namespace CoreSharp.NHibernate.SourceGenerator | ||
{ | ||
[XmlRoot("Analyzers")] | ||
public class AnalyzersConfig | ||
{ | ||
private static AnalyzersConfig _instance; | ||
|
||
public VirtualModifierAnalyzer VirtualModifierAnalyzer { get; set; } = new VirtualModifierAnalyzer(); | ||
public PropertyOrderAnalyzer PropertyOrderAnalyzer { get; set; } = new PropertyOrderAnalyzer(); | ||
|
||
[XmlArray("ValidTypes")] | ||
[XmlArrayItem("ValidType")] | ||
public ValidTypes ValidTypes { get; set; } = new ValidTypes() { "CoreSharp.DataAccess.IEntity", "CoreSharp.DataAccess.ICodeList" }; | ||
|
||
public List<string> VirtualModifierAnalyzerValidTypes => new List<string>().Concat(ValidTypes ?? new List<string>()).Concat(VirtualModifierAnalyzer?.ValidTypes ?? new List<string>()).Distinct().ToList(); | ||
public List<string> PropertyOrderAnalyzerValidTypes => new List<string>().Concat(ValidTypes ?? new List<string>()).Concat(PropertyOrderAnalyzer?.ValidTypes ?? new List<string>()).Distinct().ToList(); | ||
|
||
[DebuggerStepThrough] | ||
public static AnalyzersConfig Deserialize(string content) | ||
{ | ||
try | ||
{ | ||
var xs = new XmlSerializer(typeof(AnalyzersConfig)); | ||
var sr = new StringReader(content); | ||
|
||
return (AnalyzersConfig)xs.Deserialize(sr); | ||
} | ||
catch (Exception) | ||
{ | ||
return _instance ?? (_instance = new AnalyzersConfig()); | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
CoreSharp.NHibernate.SourceGenerator/CoreSharp.NHibernate.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,43 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<LangVersion>9</LangVersion> | ||
|
||
<PackageId>CoreSharp.NHibernate.SourceGenerator</PackageId> | ||
|
||
<Authors>cime</Authors> | ||
<Description>.NET standard NHibernate extensions, convetions</Description> | ||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance> | ||
<Copyright>Copyright 2021 (c) cime. All rights reserved.</Copyright> | ||
<PackageTags>Core# nhibernate dataaccess db</PackageTags> | ||
<PackageProjectUrl>https://github.com/cime/CoreSharp</PackageProjectUrl> | ||
<PackageLicense>https://github.com/cime/CoreSharp/blob/master/LICENSE</PackageLicense> | ||
<RepositoryUrl>https://github.com/cime/CoreSharp</RepositoryUrl> | ||
<NullableContextOptions>enable</NullableContextOptions> | ||
<Version>0.1.1</Version> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> <!-- Generates a package at build --> | ||
<IncludeBuildOutput>false</IncludeBuildOutput> <!-- Do not include the generator as a lib dependency --> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0" /> | ||
<PackageReference Include="Humanizer.Core" Version="2.8.26" GeneratePathProperty="true" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- Package the generator in the analyzer directory of the nuget package --> | ||
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" /> | ||
|
||
<!-- Package the Newtonsoft.Json dependency alongside the generator assembly --> | ||
<None Include="$(PkgHumanizer_Core)\lib\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.