So, this is my gradle task. I want to copy some sql-Files from src/main/sql to build/sql while filtering some data based on .properties Files.
import org.apache.tools.ant.filters.ReplaceTokens
task buildSQL(type: Copy) {
def db_names = ['oracle', 'postgresql', 'h2']
db_names.each{db ->
copy {
from('src/main/sql')
include '*sql'
def properties = new Properties()
file('src/main/sql/' + db + '_token.properties').withInputStream{
properties.load(it);
}
filter(ReplaceTokens, tokens: properties)
rename 'vorlage', db
into 'build/sql'
}
}
}
Basically this task works fine when I run gradle buildSQL.
When I run gradle clean buildSQL the task will not be executed.
What do I have to do so that the task "buildSQL" is running?