Skip to content

Conversation

dalexsoto
Copy link
Member

No description provided.

mandel-macaque and others added 25 commits August 19, 2025 10:45
Add the baseic checks to ensue that a user did not use any of the fields
of the ExportAttribute<T> that are only allowed with
ExportAttribute<Method>.
1. Make sure that the native prefix/suffix does not have white spaces.
2. Make sure that the async method name does not have white spaces.
3. Make sure that the different type names do not have white spaces.

Tests got added for all the new strategies.
Passing the RootContext will allow to provide the compilation
information such as the target platform of the current compilation this
can be used to make better decisions.
… and a set of validators.

Move the analyzer to use the Validator approach, this removes the need
to add some code duplication to parse the AST. This new approach re-uses
the data model of rgen to parse the AST and uses a validator to ensure
that the data struct is correct.

The SmartEnumsAnalyzer will be remove in later commits as soon as we
have the SmartEnumValidator implemented with the same checks.
This commit implements the validation of SmartEnums. There are some
changes in how we generate the enums since we now can relay on the
analyzer to raise errors and be just let the struct parse the
ast/semantic model.

The analyzer checks for the following errors:

1. A SmartEnum must have at least ONE memeber that points to a native
   value. We allow to have other memebers without it to allow things
   such as "FIRST = LAST".
2. All fields should be unique. We cannot have two fields pointing to
   the same native value.
3. The fields are a valid identifier.
4. The library paths are set when in a custom namespace.
5. The library paths should not be set when working with a Apple
   framework.
6. Ensure that if a enum or enum value is present in the compilation,
   that the platform is marked as supported.
The validator makes sure that:

1. The selector is not null.
2. The selector has no white spaces.
3. No flgas that will be ignored are used. If they are we raise a
   warning.
4. Fields are partial.
5. Fields are static.
6. If a field or any of its accessors was marked as unsupported but is
   present in the compilation platform, we raise an error.

This class will later be used to validate fields on a class.
Do not allow selectors to be null or empty.
Changes in this commit:

1. Added a generic array validator that will validate an array using an
   inner validator.
2. Added a property validator that validates the following from a
   property:
   - Export<Property> attribute is valid.
   - Must be declared partial.
   - Supported platforms shoul be correct for the accessors.
   - Validate each of the accessor selectors if they have been added.

Extra changes:

1. While test the property validator I found out that we were
   duplicating errors in nested valiators. There is no need to add a new
   strategy when adding a nested validator.
2. Updated some of the error messages in the FieldValidator since we got
   one of the descriptors wrong.
3. Added a new string strategy to ensure that the number of ':' is a
   selector matches the number of arguments in a method (this includes
   getters and setters in properties).
Both properties and fields are represented by the same struct. We add a
validator that based on the struct properties will validate a property
of a field.

The tests have been refactored so that we can share them with the new
vlaidator and the individual ones.
)

Changes in this commit:

1. Added a generic array validator that will validate an array using an
inner validator.
2. Added a property validator that validates the following from a
property:
   - Export<Property> attribute is valid.
   - Must be declared partial.
   - Supported platforms shoul be correct for the accessors.
   - Validate each of the accessor selectors if they have been added.

Extra changes:

1. While test the property validator I found out that we were
duplicating errors in nested valiators. There is no need to add a new
strategy when adding a nested validator.
2. Updated some of the error messages in the FieldValidator since we got
one of the descriptors wrong.
3. Added a new string strategy to ensure that the number of ':' is a
selector matches the number of arguments in a method (this includes
getters and setters in properties).
…1: Build ID 12317343 (#23736)

This is the pull request automatically created by the OneLocBuild task in the build process to check-in localized files generated based upon translation source files (.lcl files) handed-back from the downstream localization pipeline. If there are issues in translations, visit https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is https://aka.ms/onelocbuild and the localization process in general is documented at https://aka.ms/AllAboutLoc.

---------
Both properties and fields are represented by the same struct. We add a
validator that based on the struct properties will validate a property
of a field.

The tests have been refactored so that we can share them with the new
vlaidator and the individual ones.
…1: Build ID 12321123 (#23742)

This is the pull request automatically created by the OneLocBuild task in the build process to check-in localized files generated based upon translation source files (.lcl files) handed-back from the downstream localization pipeline. If there are issues in translations, visit https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is https://aka.ms/onelocbuild and the localization process in general is documented at https://aka.ms/AllAboutLoc.

---------
This way clang will show the full paths to files when emitting errors and
warnings, which makes it much easier to c&p the path to open it in an editor.
…20250904085939314 to main (#23744)

LEGO: Pull request from lego/hb_5df43909-4a19-4f55-bc3f-9ea8fccf3c82_20250904085939314 to main with localized lcls

---------
…1: Build ID 12318870 (#23741)

This is the pull request automatically created by the OneLocBuild task in the build process to check-in localized files generated based upon translation source files (.lcl files) handed-back from the downstream localization pipeline. If there are issues in translations, visit https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is https://aka.ms/onelocbuild and the localization process in general is documented at https://aka.ms/AllAboutLoc.

---------
We were setting a custom home folder (.home directory defined in the
DOTNET_CUSTOM_HOME env var) when the dotnet SDK was installed by Pair To
Mac, to encapsulate caches and to not mix them with the global dotnet
installation:
https://github.com/dotnet/macios/blob/main/msbuild/Messaging/Xamarin.Messaging.Build/TaskRunner.cs#L62C4-L66C6

If the user assigns the global dotnet installation to the
"_DotNetRootRemoteDirectory" MSBuild property, the Build agent will end
up overriding the HOME folder with a custom home that doesn't exist
(there's no .home folder in the user profile in the Mac (where dotnet
installs the global caches).

This issue has been revealed from the recent changes that allows the
MSBuild client to bypass the "_DotNetRootRemoteDirectory" property to
the Build Agent:
https://dev.azure.com/devdiv/DevDiv/_git/ClientTools.Platform/pullrequest/663026

The fix consists of setting the custom home only if the dotnet SDK path
to use is not the global one

---------

Co-authored-by: GitHub Actions Autoformatter <[email protected]>
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #7e3ec9f] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #7e3ec9f] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

✅ API diff vs stable

.NET ( No breaking changes )

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #7e3ec9f] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #7e3ec9f] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #7e3ec9f] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #7e3ec9f] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #7e3ec9f] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #7e3ec9f] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #7e3ec9f] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 7e3ec9f3cf8cda6fffa564d9967bd8c1dffb7b30 [PR build]

@dalexsoto dalexsoto merged commit da960f5 into xcode26.0 Sep 4, 2025
45 checks passed
@dalexsoto dalexsoto deleted the dev/alex/messaging26 branch September 4, 2025 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants