-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove explicit dependency of JniGenerator on JavaGenerator #1636
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
…solver The dependency is now injected via constructor of JniGeneratorPredicates, which receives common PlatformSignatureResolver interface. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The platform type attribute is now injected via the constructor of JniGeneratorPredicates. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change removes explicit usage of 'external.java' field. Instead, 'getFor(platformAttribute)' is used. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change removes the dependency on JavaGenerator from JniTemplates class. Instead of accessing the class directly, JniTemplates receives the needed data via constructor. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The platform type attribute is now injected via the constructor of JniTemplates. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change removes the explicit dependency to JavaSignatureResolver from JniTemplates. Instead the PlatformSigantureResolver interface is used. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
This change removes the explicit dependency to JavaNameRules from instance of JniNameResolver. Instead, the common base class is used: NameRules. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
The dependency to a concrete type called JavaNameRules has been replaced by the usage of the common base class called NameRules. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
To remove the dependency to 'java' field of LimeExternalDescriptor, the member function 'getFor(platformAttribute)' was used. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
To remove the explicit usage of static functions from JavaNameRules, which are related to 'external types', a map called 'externalNameRules' is now accepted by the constructor of JniTemplates, which is later utilized by JniNameResolver. The interested classes from JNI directory should use JniNameResolver. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
To avoid the explicit usage of the mentioned field 'platformAttribute' is injected via constructor. It is later used to call 'getFor(platformAttribute)' to remove the dependency to types related to java directory. Signed-off-by: Patryk Wrobel <183546751+pwrobeldev@users.noreply.github.com>
Hsilgos
approved these changes
Jan 13, 2025
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.
------ Motivation ------
Types defined in
generator/jni
were tightly coupled with types fromgenerator/java
.There are more languages than Java, that could use JNI in the future.
Therefore, removing the explicit dependencies could be beneficial
by avoiding changes in JNI code and making this layer future-proof.
------ Solution ------
Removed the explicit dependencies on types and functions related to
generator/java
fromgenerator/jni
by injecting them via constructors.