Last active
December 18, 2019 04:58
-
-
Save xuwei-k/157e643570234c23c92eebd75cd1be55 to your computer and use it in GitHub Desktop.
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
lazy val getAllDependencyProjects = taskKey[Seq[ProjectRef]]( | |
"依存してるprojectを再帰的に取得" | |
) | |
lazy val commonSettings = Def.settings( | |
getAllDependencyProjects := { | |
val map = buildDependencies.value.classpath | |
def loop(root: ProjectRef): Seq[ProjectRef] = { | |
root +: map(root).map(_.project).flatMap(loop) | |
} | |
loop(thisProjectRef.value).distinct | |
}, | |
clean := { | |
println(name.value + " をcleanします") // debug用 | |
clean.value | |
}, | |
TaskKey[Unit]("cleanDependencyProjects", "依存してるprojectのすべてのcleanを実行") := Def.taskDyn{ | |
getAllDependencyProjects.value.map(_ / clean).join | |
}.value | |
) | |
lazy val a = project.settings(commonSettings) | |
lazy val b = project.dependsOn(a).settings(commonSettings) | |
lazy val c = project.dependsOn(b).settings(commonSettings) | |
lazy val d = project.dependsOn(b).settings(commonSettings) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment