aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2017-08-15 17:49:54 +0200
committerGitHub <noreply@github.com>2017-08-15 17:49:54 +0200
commita3fba2aa6130c61a8f4eb3cccfc8b30913413581 (patch)
tree584c89b680daf549622f51abd0fdcec4497631f3
parent5724189e7b92199b1d4aaecb49d787e46e45a105 (diff)
parent14efd3d908f3df3897a52d3ac13452da3f761736 (diff)
downloadcbt-a3fba2aa6130c61a8f4eb3cccfc8b30913413581.tar.gz
cbt-a3fba2aa6130c61a8f4eb3cccfc8b30913413581.tar.bz2
cbt-a3fba2aa6130c61a8f4eb3cccfc8b30913413581.zip
Merge pull request #552 from darthorimar/master
Get rid of compiling CBT sources to jars
-rw-r--r--examples/export-build-information/expected.xml18
-rw-r--r--stage2/plugins/ExportBuildInformation.scala37
2 files changed, 23 insertions, 32 deletions
diff --git a/examples/export-build-information/expected.xml b/examples/export-build-information/expected.xml
index 9eb4320..6c49bca 100644
--- a/examples/export-build-information/expected.xml
+++ b/examples/export-build-information/expected.xml
@@ -81,22 +81,8 @@
</library>
</libraries>
<cbtLibraries>
- <library name="CBT:process_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/process/target/scala-2.11/process_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:eval_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/eval/target/scala-2.11/eval_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:interfaces_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/interfaces/target/scala-2.11/interfaces_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:common-0_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/common-0/target/scala-2.11/common-0_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:common-1_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/common-1/target/scala-2.11/common-1_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:file_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/file/target/scala-2.11/file_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:reflect_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/libraries/reflect/target/scala-2.11/reflect_2.11-0.9-SNAPSHOT.jar</jar>
- </library><library name="CBT:cbt_2.11-0.9-SNAPSHOT">
- <jar type="binary">CBT_HOME/target/scala-2.11/cbt_2.11-0.9-SNAPSHOT.jar</jar>
+ <library name="CBT">
+ <jar type="binary">CBT_HOME/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/stage1/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/stage2/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/compatibility/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/libraries/common-0/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/libraries/common-1/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/libraries/file/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/libraries/process/target/scala-2.11/classes</jar><jar type="binary">CBT_HOME/plugins/sonatype-release/target/scala-2.11/classes</jar><jar type="source">CBT_HOME/stage1</jar><jar type="source">CBT_HOME/stage2</jar><jar type="source">CBT_HOME/compatibility</jar><jar type="source">CBT_HOME/libraries/common-0</jar><jar type="source">CBT_HOME/libraries/common-1</jar><jar type="source">CBT_HOME/libraries/file</jar><jar type="source">CBT_HOME/libraries/process</jar><jar type="source">CBT_HOME/nailgun_launcher/process</jar><jar type="source">CBT_HOME/plugins/sonatype-release</jar>
</library>
</cbtLibraries>
<scalaCompilers>
diff --git a/stage2/plugins/ExportBuildInformation.scala b/stage2/plugins/ExportBuildInformation.scala
index 37dcc38..6ce43f9 100644
--- a/stage2/plugins/ExportBuildInformation.scala
+++ b/stage2/plugins/ExportBuildInformation.scala
@@ -111,20 +111,6 @@ object BuildInformation {
)
}
-
- private def convertCbtLibraries = {
- val cbtBuild =
- DirectoryDependency(rootBuild.context.cbtHome)(rootBuild.context).dependenciesArray.head.asInstanceOf[BaseBuild]
- transitiveBuilds(Seq((cbtBuild, ModuleType.Default)), skipTests = true)
- .map(_._1)
- .collect {
- case d: BoundMavenDependency => d.jar
- case d: PackageJars => d.jar.get
- }
- .map(exportLibrary)
- .distinct
- }
-
private def collectDependencies(dependencies: Seq[Dependency]): Seq[ModuleDependency] =
dependencies
.collect {
@@ -233,8 +219,27 @@ object BuildInformation {
Library(name, binaryJars ++ sourceJars)
}
- private def exportLibrary(file: File) =
- Library("CBT:" + file.getName.stripSuffix(".jar"), Seq(LibraryJar(file, JarType.Binary)))
+ private def convertCbtLibraries = {
+ val cbtHome = rootBuild.context.cbtHome
+ val cbtSourceDirs = //TODO add sth else here ??
+ Seq(cbtHome / "stage1",
+ cbtHome / "stage2",
+ cbtHome / "compatibility",
+ cbtHome / "libraries" / "common-0",
+ cbtHome / "libraries" / "common-1",
+ cbtHome / "libraries" / "file",
+ cbtHome / "libraries" / "process",
+ cbtHome / "nailgun_launcher" / "process",
+ cbtHome / "plugins" / "sonatype-release"
+ )
+ val sourceJars = cbtSourceDirs
+ .map(LibraryJar(_, JarType.Source))
+ val binaryJars = (cbtHome +: cbtSourceDirs)
+ .map(_ / "target" / "scala-2.11" / "classes")
+ .filter(_.exists)
+ .map(LibraryJar(_, JarType.Binary))
+ Seq(Library("CBT", binaryJars ++ sourceJars))
+ }
private def parentBuild(build: BaseBuild): Seq[BaseBuild] =
build.context.parentBuild