Skip to content

Commit f8963f3

Browse files
committed
Improved target.maven setup so that its subprojects can be configured lazily.
1 parent e2ebf6c commit f8963f3

File tree

2 files changed

+28
-21
lines changed

2 files changed

+28
-21
lines changed

build.gradle

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,27 +124,6 @@ configure(subprojects.findAll(IS_PLUGIN)) {
124124
tasks.eclipse.dependsOn(cleanEclipse)
125125
}
126126

127-
//////////////////////////////////////////////////
128-
// TARGET.MAVEN depends on every plugin project //
129-
//////////////////////////////////////////////////
130-
def pluginPaths = subprojects.collect { ':' + it.name }.grep { it.startsWith(':com.diffplug.') }
131-
project(':target.maven') {
132-
// the target platform will contain every jar
133-
// which is added to the platform config, as
134-
// well as all of its transitives, with OSGi
135-
// metadata created automatically by bnd as
136-
// required.
137-
configurations {
138-
platform
139-
// no need to add the plugins from p2
140-
all*.exclude group: 'eclipse-deps'
141-
}
142-
for (pluginPath in pluginPaths) {
143-
it.evaluationDependsOn(pluginPath)
144-
it.dependencies.add('platform', project(pluginPath))
145-
}
146-
}
147-
148127
/////////////////////////////////////////////////////////
149128
// Root eclipse project for tinkering with build files //
150129
/////////////////////////////////////////////////////////

target.maven/build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
/////////////////////////////
2+
// WRAP MAVEN DEPS TO OSGI //
3+
/////////////////////////////
4+
5+
// find the paths of all actual projects
6+
def pluginPaths = rootProject.subprojects
7+
.collect { ':' + it.name }
8+
.grep { it.startsWith(':com.diffplug.') }
9+
10+
// the target platform will contain every jar
11+
// which is added to the platform config, as
12+
// well as all of its transitives, with OSGi
13+
// metadata created automatically by bnd as
14+
// required.
15+
configurations {
16+
platform
17+
// no need to add the plugins from p2
18+
all*.exclude group: 'eclipse-deps'
19+
}
20+
for (pluginPath in pluginPaths) {
21+
evaluationDependsOn(pluginPath)
22+
dependencies.add('platform', project(pluginPath))
23+
}
24+
125
// Download from eclipse and put it into maven
226
apply plugin: 'org.standardout.bnd-platform'
327
platform {
@@ -13,6 +37,10 @@ configurations.collectMany { it.allDependencies }.findAll { it instanceof Projec
1337
bundles.dependsOn(it.dependencyProject.path + ':jar')
1438
}
1539

40+
// put the bundle task into the output of `gradle tasks` since Gradle 3.3 includes only tasks with a group
41+
bundles.group = 'Build'
42+
bundles.description = 'Converts maven dependencies into OSGi bundles.'
43+
1644
dependencies {
1745
// Gradle kicks out all but the newest, and we need both 18 and 17
1846
platformaux 'com.google.guava:guava:17.0'

0 commit comments

Comments
 (0)