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

Mark test module as test sources; change sbt module root #298

Merged
merged 3 commits into from
Apr 19, 2018

Conversation

rockjam
Copy link
Collaborator

@rockjam rockjam commented Apr 15, 2018

This PR fixes #201
It's achieved by introducing intellijModulePath, which is different from millSourcePath for sbt/maven module's tests.
For instance:
module path in Intellij is: module
module's test path in Intellij is: module/src/test.

Meanwhile millSourcePath didn't change

@@ -321,7 +324,9 @@ object GenIdeaImpl {
compileOutputPath: Path,
generatedSourceOutputPath: Path,
libNames: Strict.Agg[String],
depNames: Strict.Agg[String]) = {
depNames: Strict.Agg[String],
isTest: Boolean
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This allows us to display test sources nicely in sources tree,
image

and split them from ordinary sources in search

@@ -65,13 +65,13 @@ trait MavenModule extends JavaModule{outer =>
)
override def resources = T.sources{ millSourcePath / 'src / 'main / 'resources }
trait Tests extends super.Tests with MavenTests {
override def millSourcePath = outer.millSourcePath
override def millSourcePath = outer.millSourcePath / 'src / 'test
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought that we can make parentModule/src/test as a root for test module. @lihaoyi Don't you mind that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or maybe we can do special handling of base path in GenIdea itself, cause this change may break current builds, when you rely on path of your test module. This happened in Play Json build.

@rockjam
Copy link
Collaborator Author

rockjam commented Apr 15, 2018

Seems to fail with cross-modules, need to fix it

@rockjam
Copy link
Collaborator Author

rockjam commented Apr 19, 2018

@lihaoyi ready for review

@lihaoyi
Copy link
Member

lihaoyi commented Apr 19, 2018

Looks good to me. Once you flesh out the PR description feel free to squash and merge

@rockjam rockjam merged commit 13d0265 into com-lihaoyi:master Apr 19, 2018
@lefou lefou added this to the 0.2.1 milestone May 2, 2019
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.

src/main folders, etc interpreted as a package names
3 participants