Skip to content

Commit 59a0b6d

Browse files
author
Justin Lee
committed
copy jar contents of the other projects rather than recompiling their sources
resolves JAVA-1857
1 parent 2cb7cb8 commit 59a0b6d

1 file changed

Lines changed: 14 additions & 20 deletions

File tree

mongo-java-driver/build.gradle

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,14 @@ apply plugin: 'osgi'
2121

2222
archivesBaseName = 'mongo-java-driver'
2323

24-
idea {
25-
module {
26-
sourceDirs = [] // Ignore in idea (prevents intellij crashing due to sources outside project dir)
27-
}
28-
}
29-
30-
// dependencies copied from driver-core
31-
dependencies {
32-
compile "io.netty:netty-buffer:$nettyVersion", optional
33-
compile "io.netty:netty-transport:$nettyVersion", optional
34-
compile "io.netty:netty-handler:$nettyVersion", optional
24+
task init() << {
25+
new File("${project.rootDir}/${archivesBaseName}/build/classes/main").mkdirs()
3526
}
3627

37-
// srcDirs copied as well, so everything is compiled twice
38-
sourceSets {
39-
main {
40-
java {
41-
srcDirs = ["$rootDir/driver/src/main", "$rootDir/driver-core/src/main", "$rootDir/bson/src/main"]
42-
}
43-
}
28+
def getJar(name) {
29+
project(name).jar.archivePath
4430
}
4531

46-
// copied from driver-core
4732
jar {
4833
manifest {
4934
instruction 'Import-Package',
@@ -59,7 +44,16 @@ jar {
5944
'io.netty.*;resolution:=optional',
6045
'org.slf4j;resolution:=optional'
6146
}
62-
}
47+
from(zipTree(getJar(":driver-core"))) {
48+
exclude("META-INF")
49+
}
50+
from(zipTree(getJar(":driver"))) {
51+
exclude("META-INF")
52+
}
53+
from(zipTree(getJar(":bson"))) {
54+
exclude("META-INF")
55+
}
56+
}.dependsOn("init")
6357

6458
modifyPom {
6559
project {

0 commit comments

Comments
 (0)