-
Notifications
You must be signed in to change notification settings - Fork 511
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
[RGen] First inclusion of a roslyn generator for the bindings. #21389
Conversation
We are doing the following: 1. Adding the rgen directory with the following solutions: * Analyzer: Analyzer that will catch errors in the bindings. At the moment it provides a single error when the BindingTypeAttribute is used in a nont partial type. * Analyzer Tests: Allows tests for the analyzer. * Analyzer Sample: Sample project to test the analyzer. * Code Generator: A code generator that adds the BindingTypeAttribute to the compilcation. * Code Generator Tests: Allows tests for the generator. * Code Sample: Sample project for the code generator. 2. Make rule to build the roslyn code generator. 3. Makefile changes to add the code generator as part as the second compilation of the bindings. This changes add the starting gounds to move to roslyn.
|
protected CSharpGeneratorDriver _driver; | ||
protected PortableExecutableReference [] _references; | ||
// HACK: this is a hack to get the runtime dll for the attributes | ||
const string RuntimeDll = "/Users/mandel/Xamarin/xamarin-macios/xamarin-macios/src/build/dotnet/ios/64/Microsoft.iOS.dll"; |
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.
Ugh, I need to fix this for the tests. @haritha-mohan can you do the same trick you do with adr here?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
The tests should be executed when the generator/bgen tests are executed in xharness as well.
...n/Microsoft.Macios.Bindings.Analyzer.Sample/Microsoft.Macios.Bindings.Analyzer.Sample.csproj
Outdated
Show resolved
Hide resolved
...gen/Microsoft.Macios.Bindings.Analyzer.Tests/Microsoft.Macios.Bindings.Analyzer.Tests.csproj
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,26 @@ | |||
/* |
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.
Either remove or uncomment/fix.
@@ -0,0 +1,32 @@ | |||
/* |
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.
Either remove or uncomment/fix.
/// A sample code fix provider that renames classes with the company name in their definition. | ||
/// All code fixes must be linked to specific analyzers. |
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.
This comment is out of date.
src/rgen/Microsoft.Macios.Generator.Tests/Microsoft.Macios.Generator.Tests.csproj
Outdated
Show resolved
Hide resolved
src/rgen/Microsoft.Macios.Generator.Tests/BindingSourceGeneratorTests.cs
Outdated
Show resolved
Hide resolved
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.
The tests should be executed when the generator/bgen tests are executed in xharness as well.
src/rgen/Microsoft.Macios.Generator.Sample/Microsoft.Macios.Generator.Sample.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build] Build failed 🔥Build failed for the job 'Build packages' Pipeline on Agent |
1. Allow the tests to use the compiled dlls for dotnet. 2. Added an example test for the code generator. 3. Added an example test for the analyzer. 4. Included the new test projects in xharness.
…arin-macios into dev/mandel/rgen-init-project
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…arin-macios into dev/mandel/rgen-init-project
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
✅ API diff for current PR / commit.NET (No breaking changes)✅ API diff vs stable.NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 1 tests failed, 100 tests passed. Failures❌ dotnettests tests (macOS)
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
We are doing the following: 1. Adding the rgen directory with the following solutions: * Analyzer: Analyzer that will catch errors in the bindings. At the moment it provides a single error when the BindingTypeAttribute is used in a nont partial type. * Analyzer Tests: Allows tests for the analyzer. * Analyzer Sample: Sample project to test the analyzer. * Code Generator: A code generator that adds the BindingTypeAttribute to the compilcation. * Code Generator Tests: Allows tests for the generator. * Code Sample: Sample project for the code generator. 2. Make rule to build the roslyn code generator. 3. Makefile changes to add the code generator as part as the second compilation of the bindings. This changes add the starting gounds to move to roslyn. --------- Co-authored-by: GitHub Actions Autoformatter <[email protected]> Co-authored-by: Rolf Bjarne Kvinge <[email protected]> Co-authored-by: Alex Soto <[email protected]>
We are doing the following:
This changes add the starting gounds to move to roslyn.