jprante / gradle-plugin-jflex

A JFlex plugin for Gradle
Apache License 2.0
8 stars 6 forks source link

If Jflex input is defined as the output of another task, Jflex generation fails #23

Open stalb opened 1 year ago

stalb commented 1 year ago

Problem description

If Jflex input is defined as the output of another task, this will not be taken into account by Jflex tasks.

An example can be found in stalb/JFlex_Example2:

plugins {
    id "org.xbib.gradle.plugin.jflex" version "1.7.0"
}

repositories {
    mavenCentral()
}

def copyJflex = tasks.register("copyJflex", Copy) {
    from 'src/main/custom/'
    into "${project.buildDir}/generated/sources/custom/jflex/"
}

sourceSets {
    main {
        jflex {
            srcDir copyJflex
        }
    }
}

The main Jflex SourceDirectorySet should contains copyJflex output, however this is not the case.

In fact the generateJflex task doesn't consider copyJflex as a dependency, so running generateJflex won't trigger copyJflex task and will produce nothing.

Expected behavior