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

Add java source output directory settings for frege compiler #30

Open
yuxuanchiadm opened this issue Mar 26, 2018 · 5 comments
Open

Add java source output directory settings for frege compiler #30

yuxuanchiadm opened this issue Mar 26, 2018 · 5 comments

Comments

@yuxuanchiadm
Copy link
Contributor

Still default compiles frege source code to java source code to bin folder. But add setting to project properties to change that directory so we can separate java source code file and java bytecode file.

@Ingo60
Copy link
Member

Ingo60 commented Mar 26, 2018

For what reason?

@yuxuanchiadm
Copy link
Contributor Author

One reason is for future possible frege m2e integration. It's common thing to do when using build tools like maven. Output the intermediate processed source files, resource files, etc. to like build/generated/main/java. Then compiles, archives those files to final result. In that way we can separate features of maven plugin. And combine them whatever we want. At now this just a enhancement we can do. I'll investigate this further.

@Ingo60
Copy link
Member

Ingo60 commented Mar 27, 2018

I see. But the java Files are completely ephemeral and not needed anymore (except to look at the generated code, which is valuable at least for me, but could be helpful as well for someone getting java compilation errors because of wrong native definitions).

Hence I'd rather just make a check box "Keep Java Files?" in the Frege Settings.And if this is false, just remove the files in the builder after successful compilation.

@ToivoAdams
Copy link

Thank You for great work!

I want to call Frege generated code from Java.
First I created Maven project for both Frege and Java code.
Frege code compiles and I can see both generated java source and class files under /target directory.
But java won’t see generated code.

Usually solution is to add additional source directory to Maven pom.xml.
But Frege don’t create separate generated-source directory and can’t add whole target directory s source to Maven pom file.

Next I tried pure java project and again both Frege code and java code in the same project.
Now Frege puts generated files to /bin directory. But java won’t see them.

What I am doing wrong?
Is it possible to have both Frege and Java code in the same project?
Using separate projects probably solves problem.

Thank You
Toivo

@Ingo60
Copy link
Member

Ingo60 commented Sep 1, 2018

The eclipse-plugin (without maven) currently allows for two scenarios:

  • Frege using Java code
  • Java using Frege code

You control this through the order in which the Builders work (in Project Properties):
screenshot from 2018-09-01 12-10-46

The 2nd builder (in the picture, the Frege builder) will see the class files generated by the 1st builder (here: Java builder) in the bin/ directory.

For more complex scenarios, multiple projects are probably the way to go.
Still, it's only the class files that matter, not the generated sources.

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

No branches or pull requests

3 participants