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

Split packages between spatial4j and spatial4j-*-tests #214

Open
dweiss opened this issue Dec 22, 2021 · 3 comments
Open

Split packages between spatial4j and spatial4j-*-tests #214

dweiss opened this issue Dec 22, 2021 · 3 comments

Comments

@dweiss
Copy link

dweiss commented Dec 22, 2021

These artifacts have classes in the same package which causes major headaches if one wants to use them together with the module system. Would it be at all possible to separate packages between these two modules?

@dsmiley
Copy link
Contributor

dsmiley commented Dec 22, 2021

To put tests in a different package from the code they are testing? That sounds unusual but yeah, possible. It's useful to use "package" visibility to expose methods to a a test that you would otherwise not want to expose.

Disclaimer: I'm only vaguely familiar with "split package" notions in the module system. I'd like to think tests need not adhere to this rule.

@dweiss
Copy link
Author

dweiss commented Dec 22, 2021

spatial-extras requires a module:

moduleApi 'org.locationtech.spatial4j:spatial4j'

and the tests of that project require this:

testImplementation 'org.locationtech.spatial4j:spatial4j::tests'

both can't live as separate public modules with the same packages - this situation is really difficult to work around in consumer projects without all sorts of command-line JVM hackery. If it's a public module meant for consumption, it should use a separate package.

@dweiss
Copy link
Author

dweiss commented Dec 22, 2021

It's useful to use "package" visibility to expose methods to a a test that you would otherwise not want to expose.

Yeah, this trick simply no longer works with the module system. module patching is a substitute for this, but it's hell in my opinion.

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

2 participants