Sparkdo.Compiler 2.0.0-preview.2

This is a prerelease version of Sparkdo.Compiler.
dotnet add package Sparkdo.Compiler --version 2.0.0-preview.2
                    
NuGet\Install-Package Sparkdo.Compiler -Version 2.0.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sparkdo.Compiler" Version="2.0.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sparkdo.Compiler" Version="2.0.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Sparkdo.Compiler" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Sparkdo.Compiler --version 2.0.0-preview.2
                    
#r "nuget: Sparkdo.Compiler, 2.0.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Sparkdo.Compiler@2.0.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Sparkdo.Compiler&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Sparkdo.Compiler&version=2.0.0-preview.2&prerelease
                    
Install as a Cake Tool

Sparkdo.Compiler

职责

Sparkdo.Compiler 是 Roslyn analyzer/incremental generator 入口。它发现当前 compilation 中的 manifest 与 target facts,读取 MSBuild 提供的 analyzer config 和 AdditionalFiles,调用 Sparkdo.Compilation,再生成静态 C# 产物。

不负责

本包不实现编译语义 core、不直接写 JSON 文件、不扫描 runtime assembly,也不 materialize、托管或执行应用。

关键入口与生成产物

  • SparkdoManifestGenerator:唯一 generator 入口。
  • SparkdoFragment.g.cs:当前项目的 fragment carrier。
  • ApplicationArtifacts.g.cs:压缩的 blueprint publish view 与 manifest report carrier。
  • Blueprint.g.cs:Application role 的 Sparkdo.Generated.Blueprint provider 与 document。
  • Blueprint.RuntimeActionPlan.g.csBlueprint 的 compiled runtime plan。
  • Blueprint.GeneratedRuntimeDelegates.g.csBlueprint 的 generated delegates。
  • ManifestRuntime.g.csSparkdo.Generated.ManifestRuntime bootstrap runtime。
  • SparkdoApplication.g.cs / SparkdoHostBuilderExtensions.g.csSparkdo 命名空间中的公共 façade 与 Generic Host 扩展;SparkdoGenerateManifestRuntimeBootstrap=false 关闭这组 bootstrap 入口。
  • InvocationBootstrap.g.cs / InvocationDecorators.g.cs:Invocation aggregate registry 与 factory index;每个 service contract decorator 单独输出为 InvocationDecorator_g<stable-id>.g.cs

所有 HintName 都是扁平文件名,不使用命名空间目录前缀;生成类型的命名空间由源码中的 file-scoped namespace 独立声明。

依赖与集成

项目文件 私有引用 Sparkdo.AbstractionsSparkdo.ManifestSparkdo.CompilationSparkdo.BlueprintMicrosoft.CodeAnalysis.CSharp,并把这些 analyzer 运行所需程序集打包到 analyzers/dotnet/cs/。fragment handoff 由 Sparkdo.Build 提供。

验证

Source generation 测试必须使用仓库的 Sparkdo.SourceGenerationTesting.SourceGenerationSpec

dotnet test src/polaris/test/Sparkdo.Compiler.Tests/Sparkdo.Compiler.Tests.csproj
There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sparkdo.Compiler:

Package Downloads
Sparkdo.App

提供编译与宿主支持的 Sparkdo 应用编写元包。

Sparkdo.Package

用于分发可复用 Sparkdo Manifest fragment 的包编写元包。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0-preview.2 55 7/20/2026
2.0.0-preview.1 58 7/18/2026