Skip to content
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
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ pipeline-tests *args:
echo "Running tests pipeline..."
"{{ pipeline_tool }}" --Build:RunTests=true --Release:Mode=None {{ args }}

# Run the pipeline through pack + validate (restore, build, lint, tests, pack, validate pack contents) without publishing/releasing
[group('Pipeline')]
pipeline-pack-validate *args:
just ensure-pipeline-tool
echo "Running pack + validate pipeline..."
"{{ pipeline_tool }}" --Build:RunPack=true --Build:ValidatePack=true --Release:Mode=None {{ args }}

# Build and test with the specified configuration, defaulting to "Debug"
[group('Build and Test')]
build *args:
Expand Down
14 changes: 12 additions & 2 deletions docs/wiki/Packaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,18 @@ arrangements is an error.
The framework assembly defines `System.Runtime.CompilerServices.IsExternalInit` **publicly** so the
framework's own bundled generators can emit `init`-based attribute types into any consumer
compilation, and so the merge step has a single marker definition to internalize. Consumers
(generator projects) must **not** declare their own `IsExternalInit`: doing so produces a duplicate
type definition against the framework reference.
(generator projects) should not declare their own `IsExternalInit`.

A generator-local marker gives calls to the framework's `init` setters a different required custom
modifier identity from the setter definitions. Older merge-tool versions passed both identities to
ILRepack, which could emit `Method reference is used with definition return type / parameter`
warnings while rewriting the component.

For compatibility with generators that still receive a local marker from legacy source or build
tooling, the merge tool normalizes those required modifiers to the framework marker in a temporary
copy before merging. The generator's bin output is not changed, and the shipped self-contained
analyzer contains one internalized `IsExternalInit` definition. Removing the redundant marker from
the generator project remains the preferred configuration.

### Generators embedded in another package

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "purview-sourcegenerator-framework",
"version": "1.0.0-prerelease.48",
"version": "1.0.0-prerelease.49",
"license": "MIT",
"author": {
"name": "Kieron Lanning",
Expand Down
44 changes: 25 additions & 19 deletions purview-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,45 @@
"RequireSymbolFiles": true,
"RequiredContent": {
"purview.sourcegeneratorframework": [
"lib/netstandard2.0/Purview.SourceGeneratorFramework.dll",
"analyzers/dotnet/cs/Purview.SourceGeneratorFramework.Generators.dll",
".agents/**/*",
"analyzers/dotnet/cs/Purview.SourceGeneratorFramework.Analyzers.dll",
"analyzers/dotnet/cs/Purview.SourceGeneratorFramework.CodeFixers.dll",
"analyzers/dotnet/cs/Purview.SourceGeneratorFramework.Generators.dll",
"build/Purview.SourceGeneratorFramework.props",
"build/Purview.SourceGeneratorFramework.targets",
"tools/net10.0/Purview.SourceGeneratorFramework.MergeTool.dll",
"lib/netstandard2.0/Purview.SourceGeneratorFramework.dll",
"lib/netstandard2.0/Purview.SourceGeneratorFramework.xml",
"purview-logo-light.png",
"README.md",
"LICENSE.md",
"purview-logo-light.png"
"tools/*/ILRepack.dll",
"tools/*/Mono.Cecil.dll",
"tools/*/Mono.Cecil.Mdb.dll",
"tools/*/Mono.Cecil.Pdb.dll",
"tools/*/Mono.Cecil.Rocks.dll",
"tools/*/Purview.SourceGeneratorFramework.MergeTool.deps.json",
"tools/*/Purview.SourceGeneratorFramework.MergeTool.dll",
"tools/*/Purview.SourceGeneratorFramework.MergeTool.runtimeconfig.json",
"tools/*/System.IO.Hashing.dll"
],
"purview.sourcegeneratorframework.testing": [
"lib/netstandard2.0/Purview.SourceGeneratorFramework.Testing.dll",
".agents/**/*",
"build/Purview.SourceGeneratorFramework.Testing.props",
"README.md",
"LICENSE.md",
"purview-logo-light.png"
"lib/*/Purview.SourceGeneratorFramework.Testing.dll",
"lib/*/Purview.SourceGeneratorFramework.Testing.xml",
"purview-logo-light.png",
"README.md"
],
"purview.sourcegeneratorframework.testing.tunit": [
"lib/netstandard2.0/Purview.SourceGeneratorFramework.Testing.TUnit.dll",
".agents/**/*",
"build/Purview.SourceGeneratorFramework.Testing.TUnit.props",
"README.md",
"LICENSE.md",
"purview-logo-light.png"
]
},
"ForbiddenContent": {
"*": [
"*.pdb"
"lib/*/Purview.SourceGeneratorFramework.Testing.TUnit.dll",
"lib/*/Purview.SourceGeneratorFramework.Testing.TUnit.xml",
"purview-logo-light.png",
"README.md"
]
}
},
"Release": {
"Mode": "None"
}
}
}
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<TestingTargetFrameworks>net8.0;net9.0;net10.0;</TestingTargetFrameworks>
<TargetFrameworks>netstandard2.1;$(TestingTargetFrameworks)</TargetFrameworks>
<MergeToolTFM>net10.0</MergeToolTFM>
<NamespacePrefix>Purview.SourceGeneratorFramework</NamespacePrefix>
<ExcludePurviewTelemetry>true</ExcludePurviewTelemetry>
<RepositoryUrl>https://github.com/purview-dev/sourcegenerator-framework</RepositoryUrl>
Expand Down Expand Up @@ -43,13 +44,12 @@
<PackageProjectUrl>$(PurviewProjectUrl)</PackageProjectUrl>
<RepositoryUrl>https://github.com/purview-dev/sourcegenerator-framework</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIcon>purview-logo-light.png</PackageIcon>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>

<ItemGroup Label="NuGet package assets" Condition="'$(IsPackable)' == 'true'">
<None Include="..\..\..\LICENSE.md" Link="Sdk\LICENSE.md" />
<None Include="..\..\..\assets/images/purview-logo-light.png" Link="Sdk\purview-logo-light.png" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/SourceGeneratorFramework.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
Id="006ab41c-5588-49d6-8d3f-5b14ae3e6396"
/>
<Project Path="tests/SourceGeneratorFramework.Generators.UnitTests/SourceGeneratorFramework.Generators.UnitTests.csproj" />
<Project Path="tests/SourceGeneratorFramework.MergeTool.UnitTests/SourceGeneratorFramework.MergeTool.UnitTests.csproj" />
<Project Path="tests/SourceGeneratorFramework.UnitTests/SourceGeneratorFramework.UnitTests.csproj" />
<Project Path="tests/SourceGeneratorShared.UnitTests/SourceGeneratorShared.UnitTests.csproj" />
</Folder>
Expand Down
Loading
Loading