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

Configure Idea project generator per module #458

Merged
merged 3 commits into from
Oct 9, 2018
Merged

Conversation

lefou
Copy link
Member

@lefou lefou commented Oct 7, 2018

This PR is a first sketch how to skip some modules in Idea project generator.

The motivation is simple:

  • Idea cannot handle multiple projects with the same base directory
  • When working with Cross to enable cross compile projects of any kind, Idea selects one of the cross versions (almost) randomly per directory, which is undesired

This is a quickly hacked PR to sketch one possible solution to tackle the need to customize project generation. I'm open for input / change requests. If we can reach a consensus about the general direction, we can beautify, e.g. move the IdeaConfigModule into it's own file. Also tests would be nice, but I'm not familiar with the integration test setup of mill yet.

@lihaoyi
Copy link
Member

lihaoyi commented Oct 8, 2018

I'd be happy just hard-coding the intellij project generation flag inside JavaModule, since the intellij project generation is already hard-coded to work with JavaModule targets anyway

@lihaoyi
Copy link
Member

lihaoyi commented Oct 8, 2018

If some day we generalize IntelliJ project generation to work for other arbitrary modules (python, js, ...) we can move the flag then

@lefou
Copy link
Member Author

lefou commented Oct 8, 2018

What about "grouping" idea related def's by trait JavaModule extends IdeaConfigModule?

@lihaoyi lihaoyi merged commit 482f540 into com-lihaoyi:master Oct 9, 2018
@lihaoyi
Copy link
Member

lihaoyi commented Oct 9, 2018

Currently idea-related defs aren't standalone; they live mixed in with the JavaModule defs, as bits and pieces refactored out to be conveniently consumed by intellij. Maybe in future when we have more idea-related stuff we can extract it out into it's own trait

ucbjrl pushed a commit to ucbjrl/mill that referenced this pull request Oct 9, 2018
* Sketched how to skip some projects from Idea project generator

* Better trait comment

* Moved skipIdea flag into JavaModule
ucbjrl pushed a commit to ucbjrl/mill that referenced this pull request Oct 9, 2018
* Sketched how to skip some projects from Idea project generator

* Better trait comment

* Moved skipIdea flag into JavaModule
for((path, mod) <- modules)
yield moduleName(path)
modules
.filter(!_._2.skipIdea)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could use a collect instead to avoid iterating over the modules twice

.collect {
  case (path, mod) if !mod.skipIdea => moduleName(path)
}

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.

None yet

3 participants