Skip to content

Commit

Permalink
Upgrade to Gradle 6.0.1, TestNG 7.0.0, use Bnd for OSGi properties (#473
Browse files Browse the repository at this point in the history
)

* Upgrade to Gradle 6.0.1, TestNG 7.0.0, use Bnd for OSGi properties

* Fix TCK build under JDK 9

* Fix triggerFlowRequest wrong TestNG injection attempt

* Remove wrong or unnecessary Import-Package restrictions
  • Loading branch information
akarnokd authored and viktorklang committed Dec 10, 2019
1 parent 92ffa50 commit 4db62a5
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 40 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -14,7 +14,8 @@ before_install:

matrix:
include:
- jdk: openjdk7
# JDK 7 no longer supported by Gradle 6+
# - jdk: openjdk7
- jdk: oraclejdk8 # JDK 1.8.0_131-b11
- jdk: oraclejdk9

Expand Down
12 changes: 9 additions & 3 deletions api/build.gradle
Expand Up @@ -19,7 +19,13 @@ sourceSets {
}

jar {
manifest {
attributes('Automatic-Module-Name': 'org.reactivestreams')
}
bnd ('Bundle-Name': 'reactive-streams-jvm',
'Bundle-Vendor': 'Reactive Streams SIG',
'Bundle-Description': 'Reactive Streams API',
'Bundle-DocURL': 'http://reactive-streams.org',
'Bundle-Version': project.version,
'Export-Package': 'org.reactivestreams.*',
'Automatic-Module-Name': 'org.reactivestreams'
)
}

27 changes: 15 additions & 12 deletions build.gradle
@@ -1,6 +1,19 @@
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1"
}
}

subprojects {
apply plugin: "java"
apply plugin: "osgi"
apply plugin: "java-library"
apply plugin: 'biz.aQute.bnd.builder'

group = "org.reactivestreams"
version = "1.0.3"
Expand Down Expand Up @@ -36,16 +49,6 @@ subprojects {
mavenCentral()
}


jar {
manifest {
instructionReplace "Bundle-Vendor", "Reactive Streams SIG"
instructionReplace "Bundle-Description", "Reactive Streams API"
instructionReplace "Bundle-DocURL", "http://reactive-streams.org"
instructionReplace "Bundle-Version", "1.0.3"
}
}

if (name in ["reactive-streams",
"reactive-streams-tck",
"reactive-streams-tck-flow",
Expand Down
15 changes: 10 additions & 5 deletions examples/build.gradle
@@ -1,13 +1,18 @@
description = 'reactive-streams-examples'
dependencies {
compile project(':reactive-streams')
testCompile project(':reactive-streams-tck')
implementation project(':reactive-streams')
testImplementation project(':reactive-streams-tck')
}

jar {
manifest {
attributes('Automatic-Module-Name': 'org.reactivestreams.examples')
}
bnd ('Bundle-Name': 'reactive-streams-jvm',
'Bundle-Vendor': 'Reactive Streams SIG',
'Bundle-Description': 'Reactive Streams Examples',
'Bundle-DocURL': 'http://reactive-streams.org',
'Bundle-Version': project.version,
'Export-Package': 'org.reactivestreams.example.*',
'Automatic-Module-Name': 'org.reactivestreams.examples'
)
}

test.useTestNG()
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
15 changes: 10 additions & 5 deletions tck-flow/build.gradle
@@ -1,13 +1,18 @@
description = 'reactive-streams-tck-flow'
dependencies {
compile group: 'org.testng', name: 'testng', version:'5.14.10'
compile project(':reactive-streams-tck')
api project(':reactive-streams-tck')
implementation project(':reactive-streams-examples')
}

jar {
manifest {
attributes('Automatic-Module-Name': 'org.reactivestreams.tckflow')
}
bnd ('Bundle-Name': 'reactive-streams-jvm',
'Bundle-Vendor': 'Reactive Streams SIG',
'Bundle-Description': 'Reactive Streams TCK Flow',
'Bundle-DocURL': 'http://reactive-streams.org',
'Bundle-Version': project.version,
'Export-Package': 'org.reactivestreams.tck.flow.*',
'Automatic-Module-Name': 'org.reactivestreams.tckflow'
)
}

test.useTestNG()
Expand Up @@ -33,6 +33,7 @@ public SyncTriggeredDemandSubscriberTest() {
super(new TestEnvironment());
}

@Test(enabled = false)
@Override
public void triggerFlowRequest(Flow.Subscriber<? super Integer> subscriber) {
((SyncTriggeredDemandFlowSubscriber<? super Integer>) subscriber).triggerDemand(1);
Expand Down
17 changes: 11 additions & 6 deletions tck/build.gradle
@@ -1,14 +1,19 @@
description = 'reactive-streams-tck'
dependencies {
compile group: 'org.testng', name: 'testng', version:'5.14.10'
compile project(':reactive-streams')
compile project(':reactive-streams-examples')
api group: 'org.testng', name: 'testng', version:'7.0.0'
api project(':reactive-streams')
implementation project(':reactive-streams-examples')
}

jar {
manifest {
attributes('Automatic-Module-Name': 'org.reactivestreams.tck')
}
bnd ('Bundle-Name': 'reactive-streams-jvm',
'Bundle-Vendor': 'Reactive Streams SIG',
'Bundle-Description': 'Reactive Streams TCK',
'Bundle-DocURL': 'http://reactive-streams.org',
'Bundle-Version': project.version,
'Export-Package': 'org.reactivestreams.tck.*',
'Automatic-Module-Name': 'org.reactivestreams.tck'
)
}

test.useTestNG()
Expand Up @@ -11,15 +11,11 @@

package org.reactivestreams.tck;

import org.reactivestreams.Subscriber;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.concurrent.*;

import org.reactivestreams.Subscriber;
import org.reactivestreams.tck.flow.support.SyncTriggeredDemandSubscriber;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.testng.annotations.*;

@Test // Must be here for TestNG to find and run this, do not remove
public class SyncTriggeredDemandSubscriberTest extends SubscriberBlackboxVerification<Integer> {
Expand All @@ -32,6 +28,7 @@ public SyncTriggeredDemandSubscriberTest() {
super(new TestEnvironment());
}

@Test(enabled = false) // TestNG tries to inject here but this is a helper method
@Override public void triggerRequest(final Subscriber<? super Integer> subscriber) {
((SyncTriggeredDemandSubscriber<? super Integer>)subscriber).triggerDemand(1);
}
Expand Down

0 comments on commit 4db62a5

Please sign in to comment.