Skip to content

Commit 16198a1

Browse files
committed
Feat: Initial ingest from other repos
1 parent 12d929d commit 16198a1

16 files changed

+599
-97
lines changed

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ jobs:
1818
dotnet-version: '9.x'
1919

2020
- name: Restore dependencies
21-
run: dotnet restore TEMPLATE.sln
21+
run: dotnet restore CodeOfChaos.GeneratorTools.sln
2222

2323
- name: Build
24-
run: dotnet build TEMPLATE.sln --configuration Release --no-restore
24+
run: dotnet build CodeOfChaos.GeneratorTools.sln --configuration Release --no-restore
2525

2626
# Ensure that the tests must pass
2727
# The job will fail automatically if any test fails because `dotnet test` exits with a non-zero code
2828
- name: Run tests - Extensions
2929
run: dotnet run -c Release --no-restore --no-build
30-
working-directory: "tests/TEMPLATE"
30+
working-directory: "tests/Tests.CodeOfChaos.GeneratorTools"
3131

3232
- name: Publish to NuGet
3333
env:
3434
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
3535
run: |
36-
dotnet nuget push src/TEMPLATE/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
36+
dotnet nuget push src/CodeOfChaos.GeneratorTools/bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
+39-39
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
2-
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TEMPLATE", "src\TEMPLATE\TEMPLATE.csproj", "{64B26DED-68C3-47FF-B409-1C8FAD4F9176}"
4-
EndProject
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.TEMPLATE", "tests\Tests.TEMPLATE\Tests.TEMPLATE.csproj", "{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}"
6-
EndProject
7-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{197E72AD-DEAB-4350-AFC3-A3BB38720BF5}"
8-
EndProject
9-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}"
10-
EndProject
11-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{AF1A203C-6EF1-440E-BB3C-55B1DBFE9C19}"
12-
EndProject
13-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools.TEMPLATE", "src\Tools.TEMPLATE\Tools.TEMPLATE.csproj", "{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}"
14-
EndProject
15-
Global
16-
GlobalSection(SolutionConfigurationPlatforms) = preSolution
17-
Debug|Any CPU = Debug|Any CPU
18-
Release|Any CPU = Release|Any CPU
19-
EndGlobalSection
20-
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21-
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22-
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Debug|Any CPU.Build.0 = Debug|Any CPU
23-
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Release|Any CPU.ActiveCfg = Release|Any CPU
24-
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Release|Any CPU.Build.0 = Release|Any CPU
25-
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26-
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
27-
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
28-
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Release|Any CPU.Build.0 = Release|Any CPU
29-
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30-
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
31-
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
32-
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Release|Any CPU.Build.0 = Release|Any CPU
33-
EndGlobalSection
34-
GlobalSection(NestedProjects) = preSolution
35-
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
36-
{64B26DED-68C3-47FF-B409-1C8FAD4F9176} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
37-
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3} = {AF1A203C-6EF1-440E-BB3C-55B1DBFE9C19}
38-
EndGlobalSection
39-
EndGlobal
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeOfChaos.GeneratorTools", "src\CodeOfChaos.GeneratorTools\CodeOfChaos.GeneratorTools.csproj", "{64B26DED-68C3-47FF-B409-1C8FAD4F9176}"
4+
EndProject
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.CodeOfChaos.GeneratorTools", "tests\Tests.CodeOfChaos.GeneratorTools\Tests.CodeOfChaos.GeneratorTools.csproj", "{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}"
6+
EndProject
7+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{197E72AD-DEAB-4350-AFC3-A3BB38720BF5}"
8+
EndProject
9+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}"
10+
EndProject
11+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{AF1A203C-6EF1-440E-BB3C-55B1DBFE9C19}"
12+
EndProject
13+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tools.CodeOfChaos.GeneratorTools", "src\Tools.CodeOfChaos.GeneratorTools\Tools.CodeOfChaos.GeneratorTools.csproj", "{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}"
14+
EndProject
15+
Global
16+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
17+
Debug|Any CPU = Debug|Any CPU
18+
Release|Any CPU = Release|Any CPU
19+
EndGlobalSection
20+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21+
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22+
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Debug|Any CPU.Build.0 = Debug|Any CPU
23+
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Release|Any CPU.ActiveCfg = Release|Any CPU
24+
{64B26DED-68C3-47FF-B409-1C8FAD4F9176}.Release|Any CPU.Build.0 = Release|Any CPU
25+
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B}.Release|Any CPU.Build.0 = Release|Any CPU
29+
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
30+
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
31+
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
32+
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3}.Release|Any CPU.Build.0 = Release|Any CPU
33+
EndGlobalSection
34+
GlobalSection(NestedProjects) = preSolution
35+
{26284571-0E09-4BAF-8C2B-DF87DCC1BA0B} = {8DD280D4-1E14-4D5E-AFE6-58DD8F079DCC}
36+
{64B26DED-68C3-47FF-B409-1C8FAD4F9176} = {197E72AD-DEAB-4350-AFC3-A3BB38720BF5}
37+
{ADEADD97-0AFA-4D9E-970B-9FFB932949B3} = {AF1A203C-6EF1-440E-BB3C-55B1DBFE9C19}
38+
EndGlobalSection
39+
EndGlobal

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# CodeOfChaos.GeneratorTools

assets/icon.png

17.3 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netstandard2.0;net9</TargetFrameworks>
5+
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
9+
<!-- Main package name -->
10+
<PackageId>CodeOfChaos.Generatortools</PackageId>
11+
<Version>0.1.0-preview.0</Version>
12+
<Authors>Anna Sas</Authors>
13+
<Description>A library to help you create code generators more easily</Description>
14+
<PackageProjectUrl>https://github.com/code-of-chaos/cs-code_of_chaos-generator_tools/</PackageProjectUrl>
15+
<PackageTags>roslyn code-generator generator source-generator source</PackageTags>
16+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
17+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
18+
<IncludeSymbols>true</IncludeSymbols>
19+
<DebugType>embedded</DebugType>
20+
<PackageLicenseFile>LICENSE</PackageLicenseFile>
21+
<PackageReadmeFile>README.md</PackageReadmeFile>
22+
<PackageIcon>icon.png</PackageIcon>
23+
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
27+
<None Include="..\..\README.md" Pack="true" PackagePath="" />
28+
<None Include="../../assets/icon.png" Pack="true" PackagePath="" />
29+
</ItemGroup>
30+
31+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2+
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=stringbuilders/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
// This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
5+
// and updated to have the scope of the attributes be public.
6+
7+
// Anna's note:
8+
// yes this is a copy instead of just a nice import of a package.
9+
// I have searched far and wide for a better solution, but here we are...
10+
// It isn't the perfect solution, but at least this way we don't have a complaining IDE / compiler anymore
11+
12+
// ReSharper disable once CheckNamespace
13+
// ReSharper disable UnusedAutoPropertyAccessor.Global
14+
// ReSharper disable UnusedType.Global
15+
namespace System.Diagnostics.CodeAnalysis;
16+
#if !NETCOREAPP
17+
18+
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
19+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
20+
public sealed class AllowNullAttribute : Attribute;
21+
22+
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
23+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property)]
24+
public sealed class DisallowNullAttribute : Attribute;
25+
26+
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
27+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
28+
public sealed class MaybeNullAttribute : Attribute;
29+
30+
/// <summary>Specifies that an output will not be null even if the corresponding type allows it.</summary>
31+
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue)]
32+
public sealed class NotNullAttribute : Attribute;
33+
34+
/// <summary>
35+
/// Specifies that when a method returns <see cref="ReturnValue" />, the parameter may be null even if the
36+
/// corresponding type disallows it.
37+
/// </summary>
38+
[AttributeUsage(AttributeTargets.Parameter)]
39+
public sealed class MaybeNullWhenAttribute : Attribute {
40+
/// <summary>Initializes the attribute with the specified return value condition.</summary>
41+
/// <param name="returnValue">
42+
/// The return value condition. If the method returns this value, the associated parameter may be null.
43+
/// </param>
44+
public MaybeNullWhenAttribute(bool returnValue) {
45+
ReturnValue = returnValue;
46+
}
47+
48+
/// <summary> Gets the return value condition.</summary>
49+
public bool ReturnValue { get; }
50+
}
51+
52+
/// <summary>
53+
/// Specifies that when a method returns <see cref="ReturnValue" />, the parameter will not be null even if the
54+
/// corresponding type allows it.
55+
/// </summary>
56+
[AttributeUsage(AttributeTargets.Parameter)]
57+
public sealed class NotNullWhenAttribute : Attribute {
58+
/// <summary>Initializes the attribute with the specified return value condition.</summary>
59+
/// <param name="returnValue">
60+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
61+
/// </param>
62+
public NotNullWhenAttribute(bool returnValue) {
63+
ReturnValue = returnValue;
64+
}
65+
66+
/// <summary>Gets the return value condition.</summary>
67+
public bool ReturnValue { get; }
68+
}
69+
70+
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
71+
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true)]
72+
public sealed class NotNullIfNotNullAttribute : Attribute {
73+
/// <summary>Initializes the attribute with the associated parameter name.</summary>
74+
/// <param name="parameterName">
75+
/// The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
76+
/// </param>
77+
public NotNullIfNotNullAttribute(string parameterName) {
78+
ParameterName = parameterName;
79+
}
80+
81+
/// <summary>Gets the associated parameter name.</summary>
82+
public string ParameterName { get; }
83+
}
84+
85+
/// <summary>Applied to a method that will never return under any circumstance.</summary>
86+
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
87+
public sealed class DoesNotReturnAttribute : Attribute;
88+
89+
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
90+
[AttributeUsage(AttributeTargets.Parameter)]
91+
public sealed class DoesNotReturnIfAttribute : Attribute {
92+
/// <summary>Initializes the attribute with the specified parameter value.</summary>
93+
/// <param name="parameterValue">
94+
/// The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument
95+
/// to
96+
/// the associated parameter matches this value.
97+
/// </param>
98+
public DoesNotReturnIfAttribute(bool parameterValue) {
99+
ParameterValue = parameterValue;
100+
}
101+
102+
/// <summary>Gets the condition parameter value.</summary>
103+
public bool ParameterValue { get; }
104+
}
105+
106+
#endif
107+
108+
#if !NETCOREAPP
109+
110+
/// <summary>
111+
/// Specifies that the method or property will ensure that the listed field and property members have not-null
112+
/// values.
113+
/// </summary>
114+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
115+
public sealed class MemberNotNullAttribute : Attribute {
116+
/// <summary>Initializes the attribute with a field or property member.</summary>
117+
/// <param name="member">
118+
/// The field or property member that is promised to be not-null.
119+
/// </param>
120+
public MemberNotNullAttribute(string member) {
121+
Members = [member];
122+
}
123+
124+
/// <summary>Initializes the attribute with the list of field and property members.</summary>
125+
/// <param name="members">
126+
/// The list of field and property members that are promised to be not-null.
127+
/// </param>
128+
public MemberNotNullAttribute(params string[] members) {
129+
Members = members;
130+
}
131+
132+
/// <summary>Gets field or property member names.</summary>
133+
public string[] Members { get; }
134+
}
135+
136+
/// <summary>
137+
/// Specifies that the method or property will ensure that the listed field and property members have not-null
138+
/// values when returning with the specified return value condition.
139+
/// </summary>
140+
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
141+
public sealed class MemberNotNullWhenAttribute : Attribute {
142+
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
143+
/// <param name="returnValue">
144+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
145+
/// </param>
146+
/// <param name="member">
147+
/// The field or property member that is promised to be not-null.
148+
/// </param>
149+
public MemberNotNullWhenAttribute(bool returnValue, string member) {
150+
ReturnValue = returnValue;
151+
Members = [member];
152+
}
153+
154+
/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
155+
/// <param name="returnValue">
156+
/// The return value condition. If the method returns this value, the associated parameter will not be null.
157+
/// </param>
158+
/// <param name="members">
159+
/// The list of field and property members that are promised to be not-null.
160+
/// </param>
161+
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) {
162+
ReturnValue = returnValue;
163+
Members = members;
164+
}
165+
166+
/// <summary>Gets the return value condition.</summary>
167+
public bool ReturnValue { get; }
168+
169+
/// <summary>Gets field or property member names.</summary>
170+
public string[] Members { get; }
171+
}
172+
173+
#endif

0 commit comments

Comments
 (0)