Skip to content

Commit

Permalink
Fixed to use virtual threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmesnik committed Jul 15, 2020
1 parent 3245db7 commit 32fb441
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 32 deletions.
51 changes: 21 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ buildscript {

// Dependency versions
// ---------------------------------------

ext.reactiveStreamsVersion = "1.0.3"
ext.junitVersion = "4.13"
ext.testNgVersion = "7.0.0"
Expand All @@ -20,7 +20,7 @@ buildscript {

// --------------------------------------

repositories {
repositories {
jcenter()
mavenCentral()
maven {
Expand Down Expand Up @@ -57,7 +57,7 @@ description = "RxJava: Reactive Extensions for the JVM – a library for composi

apply plugin: "java-library"
apply plugin: "checkstyle"
apply plugin: "jacoco"
//apply plugin: "jacoco"
apply plugin: "ru.vyarus.animalsniffer"
apply plugin: "maven"
apply plugin: "me.champeau.gradle.jmh"
Expand Down Expand Up @@ -191,7 +191,7 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact (sourcesJar) {
artifact (sourcesJar) {
classifier = "sources"
}
}
Expand Down Expand Up @@ -228,7 +228,7 @@ plugins.withType(EclipsePlugin) {
}

test {

testLogging {
// showing skipped occasionally should prevent CI timeout due to lack of standard output
events=["skipped", "failed"] // "started", "passed"
Expand All @@ -240,7 +240,7 @@ test {

info.events = ["failed", "skipped"]
info.exceptionFormat="full"

warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
Expand All @@ -252,7 +252,7 @@ test {
}
}

task testng(type: Test) {
task testng(type: Test) {
useTestNG()
testLogging {
events=["skipped", "failed"]
Expand All @@ -263,17 +263,17 @@ task testng(type: Test) {

info.events = ["failed", "skipped"]
info.exceptionFormat="full"

warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
}
}

check.dependsOn testng
check.dependsOn testng

jacoco {
toolVersion = jacocoVersion // See http://www.eclemma.org/jacoco/.
}
//jacoco {
// toolVersion = jacocoVersion // See http://www.eclemma.org/jacoco/.
//}

task GCandMem(dependsOn: "check") doLast {
print("Memory usage before: ")
Expand All @@ -295,16 +295,7 @@ task GCandMem2(dependsOn: "test") doLast {

testng.dependsOn GCandMem2

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

jacocoTestReport.dependsOn GCandMem

build.dependsOn jacocoTestReport
build.dependsOn

checkstyle {
configFile file("checkstyle.xml")
Expand All @@ -316,25 +307,25 @@ if (rootProject.hasProperty("releaseMode")) {

if ("branch".equals(rootProject.releaseMode)) {
// From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94

println("ReleaseMode: " + rootProject.releaseMode);
artifactory {
contextUrl = "https://oss.jfrog.org"

publish {
repository {
repoKey = "oss-snapshot-local"

username = rootProject.bintrayUser
password = rootProject.bintrayKey
}

defaults {
publishConfigs("archives")
}
}
}

build.finalizedBy(artifactoryPublish)
}

Expand Down Expand Up @@ -362,15 +353,15 @@ if (rootProject.hasProperty("releaseMode")) {
sign = true
}
mavenCentralSync {
sync = true
sync = true
user = rootProject.sonatypeUsername
password = rootProject.sonatypePassword
close = "1"
}
}
}
}

build.finalizedBy(bintrayUpload)
}
}
Expand Down
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
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public Thread newThread(@NonNull Runnable r) {
// }

String name = nameBuilder.toString();
Thread t = nonBlocking ? new RxCustomThread(r, name) : new Thread(r, name);
// Thread t = nonBlocking ? new RxCustomThread(r, name) : new Thread(r, name);
Thread t = Thread.newThread(name, Thread.VIRTUAL, r);
t.setPriority(priority);
t.setDaemon(true);
return t;
Expand Down

0 comments on commit 32fb441

Please sign in to comment.