question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grade plugin ignores the `tasks` property

See original GitHub issue

Hi!

I am playing with ByteBuddy’s Gradle plugin (version 1.10.9) and it seems that the tasks property is ignored.

My config:

byteBuddy {
    setTasks(new AbstractSet<String>() {
        @Override
        boolean contains(Object o) {
            new Exception(o.toString()).printStackTrace()
            return false; // "compileBuildPluginTestJava" == o
        }

        @Override
        Iterator<String> iterator() {
            return Collections.emptyIterator()
        }

        @Override
        int size() {
            return 0
        }
    })

    transformation {
        plugin = "reactor.tools.agent.ReactorDebugByteBuddyPlugin"
    }
}

(AbstractSet here just to debug contains, but it does not work with ["nonExistingTask"] as Set neither)

Running the logs with --info gives me:

> Configure project :reactor-tools
Evaluating project ':reactor-tools' using build file '/Users/bsideup/Work/reactor/reactor-core/reactor-tools/build.gradle'.
Compiling build file '/Users/bsideup/Work/reactor/reactor-core/reactor-tools/build.gradle' using SubsetScriptTransformer.
Compiling build file '/Users/bsideup/Work/reactor/reactor-core/reactor-tools/build.gradle' using BuildScriptTransformer.
java.lang.Exception: compileJarFileTestJava
	<...>
	at build_6qu5i2imhbvxxd29jtzu5e6km$1.contains(/Users/bsideup/Work/reactor/reactor-core/reactor-tools/build.gradle:34)
	at net.bytebuddy.build.gradle.ByteBuddyExtension.implies(ByteBuddyExtension.java:239)
	at net.bytebuddy.build.gradle.PostCompilationAction.execute(PostCompilationAction.java:62)

And later in the same log:

Task ':reactor-tools:compileJava' is not up-to-date because:
  Output property 'destinationDirectory' file /Users/bsideup/Work/reactor/reactor-core/reactor-tools/build/classes/java/main has been removed.
  Output property 'destinationDirectory' file /Users/bsideup/Work/reactor/reactor-core/reactor-tools/build/classes/java/main/reactor has been removed.
  Output property 'destinationDirectory' file /Users/bsideup/Work/reactor/reactor-core/reactor-tools/build/classes/java/main/reactor/tools has been removed.
The input changes require a full rebuild for incremental task ':reactor-tools:compileJava'.
Compiling with JDK Java compiler API.
/Users/bsideup/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.10.9/cbbeffa557e6b1b4cbb181b0782436921c523699/byte-buddy-agent-1.10.9.jar(/net/bytebuddy/agent/ByteBuddyAgent.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings': class file for edu.umd.cs.findbugs.annotations.SuppressFBWarnings not found
/Users/bsideup/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.10.9/cbbeffa557e6b1b4cbb181b0782436921c523699/byte-buddy-agent-1.10.9.jar(/net/bytebuddy/agent/ByteBuddyAgent.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
/Users/bsideup/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.10.9/cbbeffa557e6b1b4cbb181b0782436921c523699/byte-buddy-agent-1.10.9.jar(/net/bytebuddy/agent/ByteBuddyAgent.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings'
/Users/bsideup/.gradle/caches/modules-2/files-2.1/net.bytebuddy/byte-buddy-agent/1.10.9/cbbeffa557e6b1b4cbb181b0782436921c523699/byte-buddy-agent-1.10.9.jar(/net/bytebuddy/agent/ByteBuddyAgent.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
4 warnings
Resolved plugin: reactor.tools.agent.ReactorDebugByteBuddyPlugin
Resolved entry point: REBASE
Processing class files located in in: /Users/bsideup/Work/reactor/reactor-core/reactor-tools/build/classes/java/main
Transformed 7 types

Reproducer:

  1. Clone https://github.com/reactor/reactor-core
  2. Reproduces with commit b681a6b5f4e41d462178d014a8b15c85a19a247e
  3. Run test task in reactor-tools module
  4. stackTrace() test case will fail because the instrumentation is applied two times

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
raphwcommented, Sep 6, 2020

I rewrote the plugin in its entirety and this should no longer be an issue.

0reactions
rmlekuscommented, Sep 1, 2020

Sorry for the really long delay, but finally I could look at it, but finally I would Identify the reason for the tasks set not being considered to a conflict with gradle´s lazy configuration mechanism.

Please find an attempted fix in my fork of the project as well as a pull request with my attempted fix in: https://github.com/raphw/byte-buddy/pull/918

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authoring Tasks - Gradle User Manual
Gradle supports tasks that have their own properties and methods. ... A 'should run after' task ordering is ignored if it introduces an...
Read more >
Set the project properties in subclassed gradle task
I am defining a gradle task "launchIPad2Simulator" that is subclassing another already defined task "launchIPadSimulatorfrom" in robovm gradle plugin.
Read more >
Gradle Goodness: Run Task Ignoring Up-to-date Checks
Gradle builds are fast because Gradle supports incremental tasks. This means Gradle can determine if input or output of task has changed, ...
Read more >
Diagnosing Build Cache misses with Gradle Enterprise task ...
This tutorial is based on Gradle Enterprise 2018.5, build scan plugin 2.1, ... Gradle relies on tasks declaring the nature of their input...
Read more >
Using the SpotBugs Gradle Plugin - Read the Docs
This Gradle Plugin generates task for each sourceSet generated by Gradle Java Plugin. For instance, if you have two sourceSets main and test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found