I’m trying to write a custom task with a mutable nested managed property. But I was only able to get read-only property. Running the build throws an error: “Cannot set the value of read-only property ‘database’ for task ‘:importData’ of type ch.so.agi.gretl.tasks.Ili2pgImport.”
Custom task:
@Nested
public abstract Database getDatabase();
Database class:
public abstract class Database {
@Input
public abstract Property<String> getUri();
@Input
@Optional
public abstract Property<String> getUser();
@Input
@Optional
public abstract Property<String> getPassword();
}
build.gradle:
tasks.register('importData', Ili2pgImport) {
database = {
uri = "jdbc:postgresql://localhost:54321/edit"
}
}
Any ideas what’s wrong with my task? My build file?
Thanks
Stefan