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

Additional src folders? #213

Open
techsy730 opened this issue Jan 3, 2021 · 5 comments
Open

Additional src folders? #213

techsy730 opened this issue Jan 3, 2021 · 5 comments

Comments

@techsy730
Copy link
Contributor

techsy730 commented Jan 3, 2021

Although we have no need for it now, in a future version it may be useful to have additional src folders. The .gitignores are setup to ignore any strict subfolders of src/it/unimi/dsi/fastutil. But sometimes it may be useful to have non-generated classes for specific cases. For example, specifically tuned implementation of boolean collections abusing the minuscule element state space (2). Or non-type specific code that we don't want to be public api could be in a it.unimi.dsi.fastutil.internal package. We can't put those in the existing src folder as the .gitignore would exclude them.

I think the cleanest solution to this would be to have a separate source folder for non-generated classes. Ant supports multiple source folders, so they would all live in the same classpath. Something like src-nongen or something (terrible name but I can't think of anything better at the moment). With some sort of ABOUT.txt or something describing why it is there.

@incaseoftrouble
Copy link
Collaborator

I think a more canonical approach would be to move to the src/main/java / src/test/java and src/main/generated etc. structure. This then also would be understood by IDEs I think

@techsy730
Copy link
Contributor Author

techsy730 commented Jan 6, 2021

I like that idea better, but I wonder if
src/main/java for handwritten code and
src/generated/java for the generated code would be even more canonical

@incaseoftrouble
Copy link
Collaborator

IIRC, canonical is src/main and src/test for different source / compilation sets (main is everything that is part of the distribution, test is part of testing, you could have src/test-fixtures or similar for, well, fixtures). So the first level basically refers to where the code belongs to, second level to its type. So we could have src/main/c for the generated c code, src/main/generated for the generated java code and src/main/java for the actual implementations.

This is at least the structure that gradle, IntelliJ, and (I think) maven generates by default.

@vigna
Copy link
Owner

vigna commented Jan 7, 2021

This is at least the structure that gradle, IntelliJ, and (I think) maven generates by default.

And, I hate Maven 😂

@techsy730
Copy link
Contributor Author

techsy730 commented Dec 4, 2023

Well, we don't have to strictly follow "canonical" layout. We already aren't using a "conventional" folder structure for the code generation.

We can convince, forcefully if needed, Ant to accept whatever folder structure we want. 😆
(Ant being the current build system used for Java file compilation and jar creation)
That said, something resembling conventional would still be a good idea.

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