Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
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
13 changes: 10 additions & 3 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ 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,
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these needed for all the jars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used to be an import bloat with OSGi due to it including test dependencies. I'll double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, they are no longer necessary, plus the TestNG imports have to be named for the TCK bundle anyway.

'Export-Package': 'org.reactivestreams.*',
'Automatic-Module-Name': 'org.reactivestreams'
)
}

27 changes: 15 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
16 changes: 11 additions & 5 deletions examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
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,
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
'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
Original file line number Diff line number Diff line change
@@ -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
17 changes: 12 additions & 5 deletions tck-flow/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
description = 'reactive-streams-tck-flow'
dependencies {
compile group: 'org.testng', name: 'testng', version:'5.14.10'
compile project(':reactive-streams-tck')
api group: 'org.testng', name: 'testng', version:'7.0.0'
implementation 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,
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
'Export-Package': 'org.reactivestreams.tck.flow.*',
'Automatic-Module-Name': 'org.reactivestreams.tckflow'
)
}

test.useTestNG()
Original file line number Diff line number Diff line change
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
18 changes: 12 additions & 6 deletions tck/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
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,
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
'Export-Package': 'org.reactivestreams.tck.*',
'Automatic-Module-Name': 'org.reactivestreams.tck'
)
}

test.useTestNG()
Original file line number Diff line number Diff line change
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