Skip to content

Commit

Permalink
quasarScan removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-r3 committed Nov 24, 2016
1 parent b4288cf commit 8ec21ee
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 76 deletions.
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
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'

// Can run 'gradle dependencyUpdates' to find new versions of things.
Expand Down Expand Up @@ -119,7 +119,7 @@ tasks.withType(Test) {
}

// 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'
archiveName "corda-${corda_version}.jar"
applicationSource = files(project.tasks.findByName('jar'), 'node/build/classes/main/CordaCaplet.class', 'config/dev/log4j2.xml')
Expand Down Expand Up @@ -178,8 +178,6 @@ task deployNodes(dependsOn: 'buildCordaJAR') << {
// TODO: Verify this works for gradle plugins.
task(install, dependsOn: 'publishToMavenLocal')

quasarScan.dependsOn('classes', ':node:classes', ':core:classes', ':finance:classes')

publishing {
publications {
corda(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions client/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ dependencies {
integrationTestCompile 'junit:junit:4.12'
}

quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')

task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
Expand Down
4 changes: 1 addition & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,4 @@ publishing {
artifact javadocJar
}
}
}

quasarScan.dependsOn('classes')
}
3 changes: 0 additions & 3 deletions docs/source/creating-a-cordapp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ To build against Corda and the plugins that cordapps use, update your build.grad
... 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.
publishing {
publications {
Expand Down
14 changes: 1 addition & 13 deletions gradle-plugins/quasar-utils/README.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
Quasar Utils
============

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', ...)
Quasar utilities adds several tasks and configuration that provide a default Quasar setup and removes some boilerplate.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.JavaExec

/**
* QuasarPlugin creates a "quasar" configuration, adds quasar as a dependency and creates a "quasarScan" task that scans
* for `@Suspendable`s in the code
* QuasarPlugin creates a "quasar" configuration and adds quasar as a dependency.
*/
class QuasarPlugin implements Plugin<Project> {
void apply(Project project) {
Expand All @@ -30,32 +29,5 @@ class QuasarPlugin implements Plugin<Project> {
jvmArgs "-javaagent:${project.configurations.quasar.singleFile}"
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
}
}
2 changes: 0 additions & 2 deletions node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ dependencies {
testCompile "com.nhaarman:mockito-kotlin:0.6.1"
}

quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')

task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
classpath = sourceSets.integrationTest.runtimeClasspath
Expand Down
10 changes: 0 additions & 10 deletions node/src/test/kotlin/net/corda/node/utilities/ClockUtilsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
@Suspendable
fun `test waiting for a deadline with multiple clock advance and incomplete JDK8 future on Fibers`() {
Expand All @@ -161,11 +156,6 @@ class ClockUtilsTest {
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
@Suspendable
fun `test waiting for a deadline with multiple clock advance and incomplete Guava future on Fibers`() {
Expand Down
2 changes: 0 additions & 2 deletions samples/attachment-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ idea {
}
}

quasarScan.dependsOn('classes')

publishing {
publications {
jarAndSources(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions samples/irs-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ idea {
}
}

quasarScan.dependsOn('classes')

publishing {
publications {
jarAndSources(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions samples/simm-valuation-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ task installWeb(type: Copy, dependsOn: [buildWeb]) {
into 'src/main/resources/simmvaluationweb'
}

quasarScan.dependsOn('classes')

publishing {
publications {
simmvaluationdemo(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions samples/trader-demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ idea {
}
}

quasarScan.dependsOn('classes')

publishing {
publications {
jarAndSources(MavenPublication) {
Expand Down
2 changes: 0 additions & 2 deletions test-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ dependencies {
compile 'com.squareup.okhttp3:okhttp:3.3.1'
}

quasarScan.dependsOn('classes', ':core:classes', ':finance:classes')

publishing {
publications {
testutils(MavenPublication) {
Expand Down

0 comments on commit 8ec21ee

Please sign in to comment.