Skip to content
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

3139 rust projects names #3157

Merged
merged 15 commits into from
May 8, 2024

Conversation

levBagryansky
Copy link
Member

@levBagryansky levBagryansky commented Apr 28, 2024

Closes #3139


PR-Codex overview

This PR enhances the Rust integration in the Maven plugin by updating file paths, adding a Rust function, and improving naming conventions.

Detailed summary

  • Updated file paths for Rust files
  • Added a new Rust function in a test file
  • Improved naming conventions for Rust methods
  • Implemented a method to trim and format names
  • Translated Java method names to native Rust names

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@levBagryansky
Copy link
Member Author

@maxonfjvipon WDYT

private static String translate(final String clazz, final String method) {
return String.format(
"Java_%s_%s",
clazz.replace("_", "_1").replace(".", "_"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky I didn't get what is "_1" for

Copy link
Member Author

@levBagryansky levBagryansky Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maxonfjvipon There are 2 refs in commentary: https://stackoverflow.com/questions/32470463/what-is-the-naming-convention-for-java-native-interface-method-and-module-name">stackoverflow
Or, according to oracle spec:

Escape Sequence Denotes
_1 the character “_”
_2 the character “;” in signature
_3 the character “[“ in signatures

In our case we have "_" only

@@ -58,4 +58,32 @@ public PrimeModule(final String method, final String file) {
file
);
}

/**
* Translates ("mangles") Java method name to native method name.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@levBagryansky let's add an example to the doc. Something like "before -> after"

@levBagryansky
Copy link
Member Author

@maxonfjvipon please check

@levBagryansky
Copy link
Member Author

@yegor256 please check

@yegor256
Copy link
Member

yegor256 commented May 3, 2024

@rultor merge

@rultor
Copy link
Contributor

rultor commented May 3, 2024

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor
Copy link
Contributor

rultor commented May 3, 2024

@rultor merge

@levBagryansky @yegor256 Oops, I failed. You can see the full log here (spent 22min)

@levBagryansky
Copy link
Member Author

@yegor256 please merge

@levBagryansky
Copy link
Member Author

@yegor256 please check

@yegor256
Copy link
Member

yegor256 commented May 8, 2024

@rultor merge

@rultor
Copy link
Contributor

rultor commented May 8, 2024

@rultor merge

@yegor256 OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit be4c314 into objectionary:master May 8, 2024
21 checks passed
@rultor
Copy link
Contributor

rultor commented May 8, 2024

@rultor merge

@yegor256 Done! FYI, the full log is here (took me 22min)

@levBagryansky levBagryansky deleted the 3139_rust-projects-names branch May 8, 2024 17:51
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.

Name rust projects more informatively
4 participants