Code Monkey home page Code Monkey logo

Comments (3)

jskillin-idt avatar jskillin-idt commented on July 22, 2024

(Reproducer added)

from jandex-gradle-plugin.

jmini avatar jmini commented on July 22, 2024

The reproducer is really helpful. 👍 .

When I run it:

./gradlew build --console=PLAIN first run:

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :
Jandex Gradle plugin 1.0.0. Consider becoming a patron at https://www.patreon.com/aalmiray

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE
> Task :check UP-TO-DATE
> Task :jandex
> Task :jar
> Task :assemble

> Task :printMethods
void <init>()
void sayHi()

> Task :build

BUILD SUCCESSFUL in 14s
4 actionable tasks: 4 executed

git checkout hello and second run ./gradlew build --console=PLAIN:

> Configure project :
Jandex Gradle plugin 1.0.0. Consider becoming a patron at https://www.patreon.com/aalmiray

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :jandex UP-TO-DATE
> Task :jar
> Task :assemble
> Task :compileTestJava NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test NO-SOURCE
> Task :check UP-TO-DATE

> Task :printMethods
void <init>()
void sayHi()

> Task :build

BUILD SUCCESSFUL in 729ms

The Task :jandex UP-TO-DATE is wrong in the second run.


I am not an expert, but I think that the problem is that when resolvedProcessDefaultFileSet is true (which is the default), the folder build/classes/java/main is not treated as being part of the input, because resolveSources() is called too late (configuration is already done and the folder is not part of the input):

if (resolvedProcessDefaultFileSet.get()) {
files.addAll((Collection<String>) sourceSets.findByName('main').output.classesDirs*.absolutePath.flatten())
}


My current work-around is to add the folder as additional input for the jandex task:

tasks.named('jandex') {
    inputs.files(sourceSets.findByName('main').output.classesDirs*.absolutePath.flatten())
        .withPropertyName('sourceFiles')
        .withPathSensitivity(PathSensitivity.RELATIVE)
}

from jandex-gradle-plugin.

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.