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

pretty-close-to-build-rs #188

Merged
merged 4 commits into from
Dec 26, 2024
Merged

pretty-close-to-build-rs #188

merged 4 commits into from
Dec 26, 2024

Conversation

rcoh
Copy link
Contributor

@rcoh rcoh commented Nov 8, 2024

Moves javap into build.rs. Error handling works pretty well. There is one missing piece to also capture #[java...] derives
since those must also be reflected in build.rs.

@nikomatsakis
Copy link
Member

@rcoh I'm finally getting around to reading this -- is it possible you forgot to add duchess-reflect/src/reflect/javap.rs?

Moves javap into build.rs. Error handling works pretty well. There is one missing piece to also capture `#[java...]` derives
since those must also be reflected in build.rs.
@rcoh rcoh marked this pull request as ready for review December 24, 2024 16:29
Copy link
Member

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

This makes sense to me -- I was removing eprintln! statements but I realized maybe you're not quite ready for this to land.

reflector: &mut duchess_reflect::reflect::JavapReflector,
) -> anyhow::Result<bool> {
let mut watch_file = false;
eprintln!("Looking for derive(java) in {:?}", rs_file.path);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
eprintln!("Looking for derive(java) in {:?}", rs_file.path);

let mut watch_file = false;
eprintln!("Looking for derive(java) in {:?}", rs_file.path);
for capture in re::java_derive().captures_iter(&rs_file.contents) {
eprintln!("Debug: found derive(java) in {:?}", rs_file.path);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
eprintln!("Debug: found derive(java) in {:?}", rs_file.path);

pub fn process_file(rs_file: &File, reflector: &mut JavapReflector) -> anyhow::Result<bool> {
let mut watch_file = false;
for capture in re::java_package().captures_iter(&rs_file.contents) {
eprintln!("Debug: found java macro in {:?}", rs_file.path);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
eprintln!("Debug: found java macro in {:?}", rs_file.path);

@rcoh
Copy link
Contributor Author

rcoh commented Dec 26, 2024 via email

@rcoh rcoh merged commit da2a942 into main Dec 26, 2024
13 checks passed
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.

2 participants