mirror of
https://github.com/corda/corda.git
synced 2025-02-05 02:29:20 +00:00
quasarScan removal.
This commit is contained in:
parent
b4288cf9dc
commit
8ec21eedb3
@ -27,7 +27,7 @@ buildscript {
|
|||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
|
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
|
||||||
classpath 'net.corda.plugins:publish-utils:0.5'
|
classpath 'net.corda.plugins:publish-utils:0.5'
|
||||||
classpath 'net.corda.plugins:quasar-utils:0.5.1'
|
classpath 'net.corda.plugins:quasar-utils:0.5.2'
|
||||||
classpath 'net.corda.plugins:cordformation:0.5.3'
|
classpath 'net.corda.plugins:cordformation:0.5.3'
|
||||||
|
|
||||||
// Can run 'gradle dependencyUpdates' to find new versions of things.
|
// Can run 'gradle dependencyUpdates' to find new versions of things.
|
||||||
@ -119,7 +119,7 @@ tasks.withType(Test) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move fat JAR building into node subproject.
|
// TODO: Move fat JAR building into node subproject.
|
||||||
task buildCordaJAR(type: FatCapsule, dependsOn: ['quasarScan', 'buildCertSigningRequestUtilityJAR']) {
|
task buildCordaJAR(type: FatCapsule, dependsOn: ['jar', 'buildCertSigningRequestUtilityJAR']) {
|
||||||
applicationClass 'net.corda.node.MainKt'
|
applicationClass 'net.corda.node.MainKt'
|
||||||
archiveName "corda-${corda_version}.jar"
|
archiveName "corda-${corda_version}.jar"
|
||||||
applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class', 'config/dev/log4j2.xml')
|
applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class', 'config/dev/log4j2.xml')
|
||||||
@ -178,8 +178,6 @@ task deployNodes(dependsOn: 'buildCordaJAR') << {
|
|||||||
// TODO: Verify this works for gradle plugins.
|
// TODO: Verify this works for gradle plugins.
|
||||||
task(install, dependsOn: 'publishToMavenLocal')
|
task(install, dependsOn: 'publishToMavenLocal')
|
||||||
|
|
||||||
quasarScan.dependsOn('classes', ':node:classes', ':core:classes', ':finance:classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
corda(MavenPublication) {
|
corda(MavenPublication) {
|
||||||
|
@ -80,8 +80,6 @@ dependencies {
|
|||||||
integrationTestCompile 'junit:junit:4.12'
|
integrationTestCompile 'junit:junit:4.12'
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')
|
|
||||||
|
|
||||||
task integrationTest(type: Test) {
|
task integrationTest(type: Test) {
|
||||||
testClassesDir = sourceSets.integrationTest.output.classesDir
|
testClassesDir = sourceSets.integrationTest.output.classesDir
|
||||||
classpath = sourceSets.integrationTest.runtimeClasspath
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
||||||
|
@ -100,6 +100,4 @@ publishing {
|
|||||||
artifact javadocJar
|
artifact javadocJar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
@ -178,9 +178,6 @@ To build against Corda and the plugins that cordapps use, update your build.grad
|
|||||||
|
|
||||||
... your tasks ...
|
... your tasks ...
|
||||||
|
|
||||||
// Sets the classes for Quasar to scan. Loaded by the the quasar-utils plugin.
|
|
||||||
quasarScan.dependsOn('classes', ... your dependent subprojects...)
|
|
||||||
|
|
||||||
// Standard way to publish Cordapps to maven local with the maven-publish and publish-utils plugin.
|
// Standard way to publish Cordapps to maven local with the maven-publish and publish-utils plugin.
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
|
@ -1,16 +1,4 @@
|
|||||||
Quasar Utils
|
Quasar Utils
|
||||||
============
|
============
|
||||||
|
|
||||||
Quasar utilities adds several tasks and configuration that provide a default Quasar setup and removes some boilerplate.
|
Quasar utilities adds several tasks and configuration that provide a default Quasar setup and removes some boilerplate.
|
||||||
One line must be added to your build.gradle once you apply this plugin:
|
|
||||||
|
|
||||||
.. code-block:: text
|
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
||||||
|
|
||||||
If any sub-projects are added that this project depends on then add the gradle target for that project to the depends
|
|
||||||
on statement. eg:
|
|
||||||
|
|
||||||
.. code-block:: text
|
|
||||||
|
|
||||||
quasarScan.dependsOn('classes', 'subproject:subsubproject', ...)
|
|
@ -6,8 +6,7 @@ import org.gradle.api.tasks.testing.Test
|
|||||||
import org.gradle.api.tasks.JavaExec
|
import org.gradle.api.tasks.JavaExec
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QuasarPlugin creates a "quasar" configuration, adds quasar as a dependency and creates a "quasarScan" task that scans
|
* QuasarPlugin creates a "quasar" configuration and adds quasar as a dependency.
|
||||||
* for `@Suspendable`s in the code
|
|
||||||
*/
|
*/
|
||||||
class QuasarPlugin implements Plugin<Project> {
|
class QuasarPlugin implements Plugin<Project> {
|
||||||
void apply(Project project) {
|
void apply(Project project) {
|
||||||
@ -30,32 +29,5 @@ class QuasarPlugin implements Plugin<Project> {
|
|||||||
jvmArgs "-javaagent:${project.configurations.quasar.singleFile}"
|
jvmArgs "-javaagent:${project.configurations.quasar.singleFile}"
|
||||||
jvmArgs "-Dco.paralleluniverse.fibers.verifyInstrumentation"
|
jvmArgs "-Dco.paralleluniverse.fibers.verifyInstrumentation"
|
||||||
}
|
}
|
||||||
|
|
||||||
project.task("quasarScan") {
|
|
||||||
inputs.files(project.sourceSets.main.output)
|
|
||||||
outputs.files(
|
|
||||||
"$project.sourceSets.main.output.resourcesDir/META-INF/suspendables",
|
|
||||||
"$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers"
|
|
||||||
)
|
|
||||||
} << {
|
|
||||||
|
|
||||||
// These lines tell gradle to run the Quasar suspendables scanner to look for unannotated super methods
|
|
||||||
// that have @Suspendable sub implementations. These tend to cause NPEs and are not caught by the verifier
|
|
||||||
// NOTE: need to make sure the output isn't on the classpath or every other run it generates empty results, so
|
|
||||||
// we explicitly delete to avoid that happening. We also need to turn off what seems to be a spurious warning in the IDE
|
|
||||||
ant.taskdef(name:'scanSuspendables', classname:'co.paralleluniverse.fibers.instrument.SuspendablesScanner',
|
|
||||||
classpath: "${project.sourceSets.main.output.classesDir}:${project.sourceSets.main.output.resourcesDir}:${project.configurations.runtime.asPath}")
|
|
||||||
project.delete "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables", "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers"
|
|
||||||
if(project.sourceSets.main.output.classesDir.exists()) {
|
|
||||||
ant.scanSuspendables(
|
|
||||||
auto:false,
|
|
||||||
suspendablesFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendables",
|
|
||||||
supersFile: "$project.sourceSets.main.output.resourcesDir/META-INF/suspendable-supers") {
|
|
||||||
fileset(dir: project.sourceSets.main.output.classesDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project.jar.dependsOn project.quasarScan
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,8 +159,6 @@ dependencies {
|
|||||||
testCompile "com.nhaarman:mockito-kotlin:0.6.1"
|
testCompile "com.nhaarman:mockito-kotlin:0.6.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')
|
|
||||||
|
|
||||||
task integrationTest(type: Test) {
|
task integrationTest(type: Test) {
|
||||||
testClassesDir = sourceSets.integrationTest.output.classesDir
|
testClassesDir = sourceSets.integrationTest.output.classesDir
|
||||||
classpath = sourceSets.integrationTest.runtimeClasspath
|
classpath = sourceSets.integrationTest.runtimeClasspath
|
||||||
|
@ -134,11 +134,6 @@ class ClockUtilsTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If this test seems to hang and throw an NPE, then likely that quasar suspendables scanner has not been
|
|
||||||
* run on core module (in IntelliJ, open gradle side tab and run:
|
|
||||||
* r3prototyping -> core -> Tasks -> other -> quasarScan
|
|
||||||
*/
|
|
||||||
@Test
|
@Test
|
||||||
@Suspendable
|
@Suspendable
|
||||||
fun `test waiting for a deadline with multiple clock advance and incomplete JDK8 future on Fibers`() {
|
fun `test waiting for a deadline with multiple clock advance and incomplete JDK8 future on Fibers`() {
|
||||||
@ -161,11 +156,6 @@ class ClockUtilsTest {
|
|||||||
assertFalse(future.get(), "Should have reached deadline")
|
assertFalse(future.get(), "Should have reached deadline")
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If this test seems to hang and throw an NPE, then likely that quasar suspendables scanner has not been
|
|
||||||
* run on core module (in IntelliJ, open gradle side tab and run:
|
|
||||||
* r3prototyping -> core -> Tasks -> other -> quasarScan
|
|
||||||
*/
|
|
||||||
@Test
|
@Test
|
||||||
@Suspendable
|
@Suspendable
|
||||||
fun `test waiting for a deadline with multiple clock advance and incomplete Guava future on Fibers`() {
|
fun `test waiting for a deadline with multiple clock advance and incomplete Guava future on Fibers`() {
|
||||||
|
@ -105,8 +105,6 @@ idea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
jarAndSources(MavenPublication) {
|
jarAndSources(MavenPublication) {
|
||||||
|
@ -110,8 +110,6 @@ idea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
jarAndSources(MavenPublication) {
|
jarAndSources(MavenPublication) {
|
||||||
|
@ -137,8 +137,6 @@ task installWeb(type: Copy, dependsOn: [buildWeb]) {
|
|||||||
into 'src/main/resources/simmvaluationweb'
|
into 'src/main/resources/simmvaluationweb'
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
simmvaluationdemo(MavenPublication) {
|
simmvaluationdemo(MavenPublication) {
|
||||||
|
@ -111,8 +111,6 @@ idea {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
jarAndSources(MavenPublication) {
|
jarAndSources(MavenPublication) {
|
||||||
|
@ -49,8 +49,6 @@ dependencies {
|
|||||||
compile 'com.squareup.okhttp3:okhttp:3.3.1'
|
compile 'com.squareup.okhttp3:okhttp:3.3.1'
|
||||||
}
|
}
|
||||||
|
|
||||||
quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')
|
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
testutils(MavenPublication) {
|
testutils(MavenPublication) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user