We are using a code generator that creates java-classes based on a database schema.
To improve the performance of our build I would like to make use of gradle’s up-to-date checking.
The idea is that the task connects to the database and returns a hash based on the schema state.
For this to work the getDbState() needs access to other inputs (dbUrl, dbUsername and dbPassword).
class JooqTask extends DefaultTask {
@Input
String dbUrl
@Input
String dbUsername
@Input dbPassword
@Input
String getDbState() {
// connect to database
// calculate hash
return hash
}
}
What is the correct way to have dependencies between @Input elements?
e.g how can I be sure that dbUrl, dbUsername and dbPassword are initialized before the getDbState() (@Input) is resolved?