Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 465536e

Browse files
committed
Fix the support for plugin dependencies inside the plugin dev environment
The PomInclusionPlugin didn't work in the plugin developer environment because sbt seems to only check the unmanagedBase for auto-plugins, not unmanagedJars that was used to load the build jar. This commit moves the jar of the build code in the plugin dev environment from `bin/chatoverflow-meta-build-*.jar` to `project/lib/chatoverflow-meta-build-*.jar`. By this the jar is in the unmanagedBase directory and sbt loads the PomInclusionPlugin and the dependency support for plugins is working in the plugin dev environment.
1 parent b41abf1 commit 465536e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

build/src/main/scala/org/codeoverflow/chatoverflow/build/deployment/BootstrapUtility.scala

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ object BootstrapUtility {
114114

115115
// Second step: Create bin directories and copy all binaries
116116
val targetJarDirectories = List("bin", "deploy/bin")
117-
prepareBinDirectories(logger, targetJarDirectories, scalaLibraryVersion, copyApi = true, copyBuild = false)
117+
prepareBinDirectories(logger, targetJarDirectories, scalaLibraryVersion, copyApi = true)
118118

119119
// Third step: Copy bootstrap launcher
120120
copyJars(s"bootstrap/target/scala-$scalaLibraryVersion/", List("deploy/"), logger)
@@ -152,9 +152,13 @@ object BootstrapUtility {
152152
// First step: Create directory
153153
createOrEmptyFolder("deployDev/")
154154

155-
// Second step: Copy all binaries
155+
// Second step: Copy framework, GUI and build-code jars
156156
val targetJarDirectories = List("bin", "deployDev/bin")
157-
prepareBinDirectories(logger, targetJarDirectories, scalaLibraryVersion, copyApi = false, copyBuild = true)
157+
prepareBinDirectories(logger, targetJarDirectories, scalaLibraryVersion, copyApi = false)
158+
159+
createOrEmptyFolder("deployDev/project/lib")
160+
val buildCodeTargetDirectories = List("bin", "deployDev/project/lib")
161+
copyJars(s"build/target/scala-$scalaLibraryVersion/sbt-1.0", buildCodeTargetDirectories, logger)
158162

159163
// Third step: Copy the api
160164
sbt.IO.copyDirectory(new File(apiProjectPath), new File("deployDev/api/"))
@@ -175,7 +179,7 @@ object BootstrapUtility {
175179
}
176180
}
177181

178-
private def prepareBinDirectories(logger: ManagedLogger, targetDirs: List[String], scalaLibraryVersion: String, copyApi: Boolean, copyBuild: Boolean): Unit = {
182+
private def prepareBinDirectories(logger: ManagedLogger, targetDirs: List[String], scalaLibraryVersion: String, copyApi: Boolean): Unit = {
179183
// First prepare all bin folders
180184
targetDirs.foreach(d => {
181185
logger info s"Preparing '$d' folder."
@@ -187,8 +191,7 @@ object BootstrapUtility {
187191

188192
val sourceJarDirectories = List(
189193
Some(s"target/scala-$scalaLibraryVersion/"),
190-
if (copyApi) Some(s"api/target/scala-$scalaLibraryVersion/") else None,
191-
if (copyBuild) Some(s"build/target/scala-$scalaLibraryVersion/sbt-1.0") else None
194+
if (copyApi) Some(s"api/target/scala-$scalaLibraryVersion/") else None
192195
).flatten
193196

194197
sourceJarDirectories.foreach(d => copyJars(d, targetDirs, logger))

deployment-files/plugin-dev/build.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ create := new PluginCreateWizard(streams.value.log).createPluginTask(pluginFolde
4646
fetch := new PluginUtility(streams.value.log).fetchPluginsTask(pluginFolderNames.value, pluginBuildFileName.value,
4747
pluginTargetFolderNames.value, apiProjectPath.value)
4848
copy := new PluginUtility(streams.value.log).copyPluginsTask(pluginFolderNames.value, pluginTargetFolderNames.value, scalaMajorVersion)
49+
50+
packageBin / includePom := false

deployment-files/plugin-dev/project/dependencies.sbt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)