-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK: Implement Cesium MSBuild Project SDK #561
Merged
Merged
Conversation
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
Introduced a "DryRun" boolean to the CesiumCompile class. This option, when set to true, prevents the compiler process from actually starting. This can be used for testing purposes or to verify command line arguments without performing a full compilation.
- Skip ref asm copying - Generate .runtimeconfig.json - Fix missing .dll extension - Fix OutputType in test data
Including netfx tests
- Add docs about MSBuild SDK - Add info about SDK tests - Use NUKE in tests docs - Rename compiler pack -> compiler bundle - Introduce CI-friendly single pack and publish compiler bundle targets
ForNeVeR
approved these changes
Apr 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I have some comments and small questions, but this is great work and I approve it.
ForNeVeR
approved these changes
Apr 21, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #80
This PR adds basic MSBuild functionality that allows to use of the Cesium compiler via the MSBuild project facade.
What is done:
<Compile>
items support<TargetFramework>
property support (only for compiler-supported TFMs)<OutputType>
property supportMore details in
docs/msbuild-sdk.md
.Compiler bundles
SDK needs to somehow distribute/obtain the compiler to call it when all necessary command line arguments are collected. This implementation creates bundles as special kinds of NuGet packages with self-contained platform-specific compiler binaries packed into the
tools/
folder. That package is then referenced by the SDK.Global artifacts folder
To drastically simplify custom pack & publish targets I've switched the solution to use the global
artifacts/
folder. Also adapted tests after that.Cesium.Solution.Metadata
In some tests, we need to obtain proper context about the Cesium solution. For that reason there is a special build-only project
Cesium.Solution.Metadata
that stores some MSBuild properties inside the assembly attribute, wrapped by a helperSolutionMetadata
static class. It can be used for any test project that referencesCesium.TestFramework
.Tests
SDK tests detailed description was added to
docs/tests.md
.Also, edited a bit of test documentation to reflect the use of NUKE instead of
dotnet test
.NUKE
SDK pack & publish introduces a new level of complexity for Cesium design-time infrastructure. So I decided to implement it in NUKE instead of plain MSBuild tasks. For existing stuff almost nothing was changed, except for CI and tests - the
dotnet test
will fail without preparing a compiler bundle in the artifacts folder so it can only be used for specific test projects. Or via prepared NUKE targets.CodeGen
Some type references didn't work with ref assemblies coming with .NET SDK using
GetType
, so instead I'm usingTypeReference
with CorLibTypeSystem
, which is compatible with .NET SDK assemblies.TODO
This PR is almost ready, things to be done:
Cesium.TestFramework
inCesium.Sdk.Tests
Roadmap
So there is a bunch of stuff that I'm planning to do next in upcoming PRs:
Acknowledgments
Big thanks to @ForNeVeR for Pascal.ABC MSBuild SDK and @kant2002 for F* MSBuild SDK for great examples and motivation!
TODO [~F]
**/*.c
and**/*.h
— they are already supposed to work, but we should consider enabling them implicitly at the SDK level: SDK: include all the.c
files by default? #574