Processresources does no longer work starting from Gradle 1.8

Hello

In one of our build scripts we are customizing the processResources task as follows.

processResources {
 from project.jsSrcDir
 into project.jsFilteredDir
 filter(ReplaceTokens, tokens:[version: project.version,
  releaseDate: DateFormat.getDateInstance(DateFormat.MEDIUM).format(project.buildTime)])
}

This used to work with Gradle 1.7. Starting from Gradle 1.8, however, we get an UP-TO-DATE message for this task for a “clean build”, even when running with “–rerun-tasks”. Neither does this variant work:

processResources << {
 copy {
  from project.jsSrcDir
  into project.jsFilteredDir
  filter(ReplaceTokens, tokens:[version: project.version,
   releaseDate: DateFormat.getDateInstance(DateFormat.MEDIUM).format(project.buildTime)])
 }
}

What am I missing here? Why is it not working using Gradle >= 1.8?

Thanks Thorsten

Without more information, it’s impossible to say. What exactly are you trying to do here? is ‘jsSrcDir’ the only resource directory? Are you using the Java plugin? Does running with ‘–info’ give any insights?

Ok, more details. We are using the ‘java’ and the ‘js’ plugin (com.eriwen:gradle-js-plugin:1.9.0). What we are doing is to filter some JavaScript sources into a temp build folder, where they get processed subsequently by another task in the build process.

The properties are defined as follows:

ext.jsSrcDir

= “${projectDir}/src/main/js” ext.jsFilteredDir = “${buildDir}/js-filtered”

and using “gradle properties” they are resolved to (leading part omitted for privacy reasons):

jsFilteredDir: <project_home>/build/js-filtered jsSrcDir: <project_home>/src/main/js

There are actually no resource folders (src/resources), only a single source folder (src/main/js).

When running with --info as well as --debug the only relevant message related to processResources are:

:processResources (Thread[main,5,main]) started. :processResources Skipping task ‘:processResources’ as it has no source files. :processResources UP-TO-DATE

Any Ideas?