Git Product home page Git Product logo

Comments (8)

elventear avatar elventear commented on May 21, 2024 9

Using this snippet in my build script seems to be working for me:

dependencies {
    ...
    compileOnly "com.ea.async:ea-async:1.2.1"
}

task instrument(type: JavaExec) {
    main = 'com.ea.async.instrumentation.Main'
    classpath = sourceSets.main.compileClasspath
    args "$buildDir"
}

compileJava.doLast {
    tasks.instrument.execute()
}

from ea-async.

juddgaddie avatar juddgaddie commented on May 21, 2024 5

+1

from ea-async.

JoeHegarty avatar JoeHegarty commented on May 21, 2024

There is currently no Gradle plugin.
The easiest way would likely be to to use the command line tool as the final step in your Gradle build.
I’d like to support Gradle but I haven’t had time to look into that yet.

from ea-async.

JoeHegarty avatar JoeHegarty commented on May 21, 2024

Resolved in #46 thanks to @Fleex255

from ea-async.

sevenaper avatar sevenaper commented on May 21, 2024

Using this snippet in my build script seems to be working for me:

dependencies {
    ...
    compileOnly "com.ea.async:ea-async:1.2.1"
}

task instrument(type: JavaExec) {
    main = 'com.ea.async.instrumentation.Main'
    classpath = sourceSets.main.compileClasspath
    args "$buildDir"
}

compileJava.doLast {
    tasks.instrument.execute()
}

Thank you very much. But task.execute() can not be used after gradle 5.0. And I change it to compileJava.dependsOn(tasks.instrument), but it does not work. Do you know how to fix it?

from ea-async.

Fleex255 avatar Fleex255 commented on May 21, 2024

I haven't tested that kind of setup, but I think the instrument task needs to depend on compileJava so that instrumentation occurs after compilation. Then the Java plugin's classes task must be made to depend on instrument as well so that the build process always includes the instrumentation.

from ea-async.

sevenaper avatar sevenaper commented on May 21, 2024

I haven't tested that kind of setup, but I think the instrument task needs to depend on compileJava so that instrumentation occurs after compilation. Then the Java plugin's classes task must be made to depend on instrument as well so that the build process always includes the instrumentation.

I have tried both. But neither of them can work.

from ea-async.

ctemple avatar ctemple commented on May 21, 2024

在我的构建脚本中使用此代码段似乎对我有用:

dependencies {
    ...
    compileOnly "com.ea.async:ea-async:1.2.1"
}

task instrument(type: JavaExec) {
    main = 'com.ea.async.instrumentation.Main'
    classpath = sourceSets.main.compileClasspath
    args "$buildDir"
}

compileJava.doLast {
    tasks.instrument.execute()
}

谢谢。但是 task.execute() 在 gradle 5.0 之后不能使用。我把它改成 compileJava.dependsOn(tasks.instrument),但它不起作用。你知道如何解决它吗?

dependencies {
...
compileOnly "com.ea.async:ea-async:1.2.1"
}

task instrument(type: JavaExec) {
main = 'com.ea.async.instrumentation.Main'
classpath = sourceSets.main.compileClasspath
args "$buildDir"
}

compileJava.finalizedBy(instrument)

from ea-async.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.