blob: 5deb5c7edb534d2d8d94a032f43b14c09ea31b9a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
package mill.scalalib
import mill.define.Command
import mill.{Module, PathRef, T}
/**
* Module specific configuration of the Idea project file generator.
*/
trait GenIdeaModule extends Module {
import GenIdeaModule._
def intellijModulePath: os.Path = millSourcePath
/**
* Skip Idea project file generation.
*/
def skipIdea: Boolean = false
/**
* Contribute facets to the Java module configuration.
* @param ideaConfigVersion The IDEA configuration version in use. Probably `4`.
* @return
*/
def ideaJavaModuleFacets(ideaConfigVersion: Int): Command[Seq[JavaFacet]] = T.command { Seq[JavaFacet]() }
/**
* Contribute components to idea config files.
*/
def ideaConfigFiles(ideaConfigVersion: Int): Command[Seq[IdeaConfigFile]] = T.command { Seq[IdeaConfigFile]() }
def ideaCompileOutput: T[PathRef] = T.persistent { PathRef(T.ctx().dest / "classes") }
}
object GenIdeaModule {
import upickle.default._
case class Element(name: String, attributes: Map[String, String] = Map(), childs: Seq[Element] = Seq())
object Element {
implicit def rw: ReadWriter[Element] = macroRW
}
final case class JavaFacet(`type`: String, name: String, config: Element)
object JavaFacet {
implicit def rw: ReadWriter[JavaFacet] = macroRW
}
final case class IdeaConfigFile(name: String, component: String, config: Seq[Element])
object IdeaConfigFile {
implicit def rw: ReadWriter[IdeaConfigFile] = macroRW
}
}
|