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

Generated Intellij project: output path is shared between production, tests #311

Closed
guilgaly opened this issue May 4, 2018 · 4 comments
Closed
Labels
solved The issue was fixed/resolved
Milestone

Comments

@guilgaly
Copy link
Contributor

guilgaly commented May 4, 2018

I have created a mill build with a few modules, each of them with a nested test module. I have generated and opened an Intellij IDEA project with mill.scalalib.GenIdea/idea. If I try to run anything from within IDEA (rather than from mill), I get the following error for each test module :

Output path <project path>/out/myModule/test/compile/dest/classes is shared between: Module 'myModule.test' production, Module 'myModule.test' tests

This is apparently because the test modules have an output path, but don't have a test output path. Since mill test modules only contain test code, I solved this by removing the regular output path, and using the same path for the test output path instead (basically, replace <output> with <output-test>). It seems to work for me.

I'll make a PR for this (it seems like it would be a trivial change in GenIdeaImpl), hopefully I'm not missing something obvious here.

@guilgaly
Copy link
Contributor Author

guilgaly commented May 4, 2018

I did some more tests; I also think that the resources folder in a test module should be declared as:
<sourceFolder url="file://$MODULE_DIR$/../myModule/test/resources" type="java-test-resource" />
And not:
<sourceFolder url="file://$MODULE_DIR$/../myModule/test/resources" isTestSource="true" type="java-resource"/>

The first one is what I get if I manually set the path for "test resources" in IDEA; the latter is just seen as "resources" after opening in IDEA.

@rockjam
Copy link
Contributor

rockjam commented May 5, 2018

@guilgaly if IDEA sets resourceFolder type to java-test-resource - I guess that what mill should do too. PR will be appreciated

@rockjam
Copy link
Contributor

rockjam commented May 6, 2018

@guilgaly I guess we can close this?

@rockjam rockjam closed this as completed May 6, 2018
@guilgaly
Copy link
Contributor Author

guilgaly commented May 6, 2018

@rockjam sure, fine with me. 👍

@lefou lefou added this to the 0.2.1 milestone May 2, 2019
@lefou lefou added the solved The issue was fixed/resolved label Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue was fixed/resolved
Projects
None yet
Development

No branches or pull requests

3 participants