Hi.

First off, thanks for a GREAT build tool.

In my multiproject build I have something like this:

subprojects {
  <snip stuff>
  task filterResources(dependsOn: updateBuildProperties) << {
    buildProps = new Properties()
    file("../build.properties").withInputStream {
      buildProps.load(it)
    }
  }
  processResources.dependsOn filterResources
  processTestResources.dependsOn filterResources
}

(Yes, I do know that build.properties is loaded for each subproject -
working on it :-) )
and then each project extends the filterResources task like so:

project(":some-jpa") {
  <snip stuff>
  filterResources.doLast {
    file("resources/META-INF/persistence.xml").delete()
    file("conf/hibernate.properties").delete()
    file("conf/hibernate.reveng.xml").delete()
    assert file('templates/persistence.xml').exists()
    assert file('templates/hibernate.properties').exists()
    assert file('templates/hibernate.reveng.xml').exists()
    copy {
      into 'resources/META-INF'
      from('templates')
      include 'persistence.xml'
      filter(ReplaceTokens, tokens: buildProps)
    }
    copy {
      into 'conf'
      from('templates') {
        include 'hibernate.reveng.xml'
        include 'hibernate.properties'
      }
      filter(ReplaceTokens, tokens: buildProps)
    }
  }
}

With this approach, I hoped that the processResources task from the
java plugin would pick up on changes to the resource files. But that
is not the case. If I change a property, and build with gradle, then
the filtered file contains the changes, but the procssesResources is
claimed to be up-to-date:

<snip from gradle build>
:updateBuildProperties
:some-jpa:filterResources
:some-jpa:processResources UP-TO-DATE

Is there someway to force processResources overwrite existing files? I
was thinking along the lines of a "force" attribute?

I track the git repository for, and I currently run gradle version
0.9-20100611103621+0200

Regards,
/Daniel

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to