I have a Java project that uses StringTemplates. Gradle does not see changes in the *.st or *.stg files.
How can I make gradle aware of non-java file changes?
You have not given enough information
- When are these *.st and *.stg files used? (build time or runtime)
- Where are these *.st and *.stg files located?
- What do you mean by aware?
If they are under src/main/resources
then gradle will be “aware” of them (ie the jar will be rebuilt if they change)
- The *.st(g) files are used at run time.
- They are places in src/dk/kec/templates.
- “Aware”; gradle states that all tasks are up-to-date even if a change a String Template.
When I change a StringTemplate a new Jar files has to be made and test has to be run. StringTemplate are used to generate files.
Please include the relevant gradle snippet(s) which adds src/dk/kec/templates
to the jar file. I’m guessing the directory needs to be added as a task input
apply plugin: 'java'
sourceSets {
main.java.srcDirs = ['src']
}
Try this.
sourceSets {
main.resources.srcDirs = [‘src/dk/kec/templates’]
}