Skip to content

Commit 466f66a

Browse files
Danny WeinbergKannan Goundan
Danny Weinberg
authored and
Kannan Goundan
committed
Expose an additional jar that doesn't include OSGi manifest information
Currently doing a noop build of the SDK jar takes quite a while (for me, the jar task itself takes about 2.5 seconds to determine that it's up to date). I dug into this and it turns out that this is due to an inefficiency in the OSGi plugin when determining if the OSGi manifest is up to date. On my machine, a noop jarWithoutOsgi task is ~50x faster, taking about 0.05 seconds.
1 parent 34267d4 commit 466f66a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.gradle.internal.os.OperatingSystem;
1+
import org.gradle.internal.os.OperatingSystem
22

33
apply plugin: 'java'
44
apply plugin: 'osgi'
@@ -93,6 +93,10 @@ dependencies {
9393
testCompile 'com.google.guava:guava:19.0'
9494
}
9595

96+
configurations {
97+
withoutOsgi.extendsFrom compile
98+
}
99+
96100
processResources {
97101
filesMatching('**/sdk-version.txt') {
98102
expand project.properties
@@ -216,6 +220,11 @@ jar {
216220
}
217221
}
218222

223+
task jarWithoutOsgi(type: Jar, dependsOn: classes) {
224+
classifier 'withoutOsgi'
225+
from sourceSets.main.output
226+
}
227+
219228
task sourcesJar(type: Jar, dependsOn: classes) {
220229
classifier = 'sources'
221230
from sourceSets.main.allSource
@@ -229,6 +238,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
229238
artifacts {
230239
archives sourcesJar
231240
archives javadocJar
241+
withoutOsgi jarWithoutOsgi
232242
}
233243

234244
install {

0 commit comments

Comments
 (0)