Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,22 @@ def getScalaSuffix(scalaVersion) {
return scalaVersion.startsWith('2.10') ? '_2.10' : "_$scalaVersion"
}

subprojects {
/* Helper to build OSGI package lists with explicit version spec.
* By default the osgi plugin adds version range such as (0.6.91,1.0]
* for import-package. To avoid missmatch we want exact version.
* Downside: Manual package lists in gradle...
* Alternative is to use -consumer-policy directive to force ==, but
* that applies to external imports too which is undesired.
*/
def createOsgiVersionedPackageList(pkgs) {
def out = []
for(String pkg: pkgs){
out.add(pkg + ';version="'+version+'"')
}
return out.join(',')
}

subprojects {
// the cross built scala modules share the same source directories so we need to make their output directories unique
buildDir = "${rootProject.buildDir}/$name"

Expand Down
9 changes: 9 additions & 0 deletions cluster/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'osgi'

dependencies {
compile externalDependency.scalaLibrary
Expand All @@ -17,3 +18,11 @@ dependencies {
testCompile externalDependency.junit
}

jar{
manifest {
name = 'Norbert Cluster'
symbolicName = 'com.linkedin.norbert.cluster'
instruction 'Bundle-Description', 'Norbert Cluster'
instruction 'Bundle-Vendor', 'LinkedIn'
}
}
15 changes: 15 additions & 0 deletions java-cluster/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'osgi'

dependencies {
compile project(":cluster$scalaSuffix")
compile externalDependency.scalaLibrary
}

ext.osgi_local_imports = [
'com.linkedin.norbert.cluster',
'com.linkedin.norbert.cluster.memory']

jar{
manifest {
name = 'Norbert Java Cluster'
symbolicName = 'com.linkedin.norbert.java-cluster'
instruction 'Bundle-Description', 'Norbert Java Cluster'
instruction 'Bundle-Vendor', 'LinkedIn'
instruction 'Import-Package', createOsgiVersionedPackageList(osgi_local_imports) + ',*'
}
}

28 changes: 28 additions & 0 deletions java-network/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'osgi'

dependencies {
compile project(":network$scalaSuffix")
Expand All @@ -8,3 +9,30 @@ dependencies {
compile externalDependency.scalaLibrary
}

ext.osgi_local_imports = [
'com.linkedin.norbert.cluster',
'com.linkedin.norbert.javacompat',
'com.linkedin.norbert.javacompat.cluster',
'com.linkedin.norbert.network',
'com.linkedin.norbert.network.client',
'com.linkedin.norbert.network.client.loadbalancer',
'com.linkedin.norbert.network.common',
'com.linkedin.norbert.network.netty',
'com.linkedin.norbert.network.partitioned',
'com.linkedin.norbert.network.partitioned.loadbalancer',
'com.linkedin.norbert.network.server']

jar{
manifest {
name = 'Norbert Java Network'
symbolicName = 'com.linkedin.norbert.java-network'
instruction 'Bundle-Description', 'Norbert Java Network'
instruction 'Bundle-Vendor', 'LinkedIn'
/* We must not export com.linkedin.norbert as it collides with cluster bundle.
* However, using '!com.linkedin.norbert,*' did for some reason remove the version
* information, making importing of the package impossible.
*/
instruction 'Export-Package', 'com.linkedin.norbert.javacompat.network;version="'+version+'"'
instruction 'Import-Package', createOsgiVersionedPackageList(osgi_local_imports) + ',*'
}
}
18 changes: 18 additions & 0 deletions network/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'java'
apply plugin: 'scala'
apply plugin: 'osgi'

dependencies {
compile project(":cluster$scalaSuffix")
Expand All @@ -18,3 +19,20 @@ dependencies {
testCompile externalDependency.junit
}

ext.osgi_local_imports = [
'com.linkedin.norbert',
'com.linkedin.norbert.cluster',
'com.linkedin.norbert.jmx',
'com.linkedin.norbert.logging',
'com.linkedin.norbert.norbertutils',
'com.linkedin.norbert.protos']

jar{
manifest {
name = 'Norbert Network'
symbolicName = 'com.linkedin.norbert.network'
instruction 'Bundle-Description', 'Norbert Network'
instruction 'Bundle-Vendor', 'LinkedIn'
instruction 'Import-Package', createOsgiVersionedPackageList(osgi_local_imports) + ',*'
}
}