-
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Derived new GenIdea module to support meta-builds (#2638)
Moved the implementation from `mill.scalalib` to a new module `mill.idea`. The reason is simple, we need access to the `runner` module, but `runner` itself depends on `scalalib` to provide compilation support. Generating an IDE setup has a much broader scope so a dedicated module is IMHO the best. This is analog to `mill.bsp`, which also provides IDE support as a dedicated module. Deprecated the old `mill.scalalib.GenIdea` module. Enhanced the lookup for modules and root modules to reflect the new meta-build capabilities of Mill. Reworked the XML generator to re-respect the `GenIdeaModule.intellijModulePath` setting and ensured we combine multiple source folders under the same source root if appropriate. Pull request: #2638
- Loading branch information
Showing
30 changed files
with
1,158 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package mill.idea | ||
|
||
import mill.T | ||
import mill.api.Result | ||
import mill.define.{Command, Discover, ExternalModule} | ||
import mill.eval.Evaluator | ||
|
||
import scala.util.control.NonFatal | ||
|
||
object GenIdea extends ExternalModule { | ||
|
||
def idea(allBootstrapEvaluators: Evaluator.AllBootstrapEvaluators): Command[Unit] = T.command { | ||
try { | ||
Result.Success(GenIdeaImpl( | ||
evaluators = Evaluator.allBootstrapEvaluators.value.value | ||
).run()) | ||
} catch { | ||
case GenIdeaImpl.GenIdeaException(m) => Result.Failure(m) | ||
case NonFatal(e) => | ||
Result.Exception(e, new Result.OuterStack(new java.lang.Exception().getStackTrace)) | ||
} | ||
} | ||
|
||
override lazy val millDiscover = Discover[this.type] | ||
} |
Oops, something went wrong.