Skip to content

Not possible to override Property values in individual configurations #158

Description

@damianw

The construction of FladleConfigImpl for individual configs, seen here, passes all of the values directly. This is a problem for properties using the Property API: since the entire Property object is shared, the value cannot be overridden for individual configurations.

For example, in a configuration like this:

fladle {
    // ...
    localResultsDir.set("output")
    configs {
        create("firstConfig") {
            // ...
            localResultsDir.set("output-firstConfig")
        }
        create("secondConfig") {
            // ...
            localResultsDir.set("output-secondConfig")
        }
    }
}

The result of this is that every config, including the root config, end up with localResultsDir set to output-secondConfig.

I'm not sure of the "right" way to fix this - at the very least there would need to be a new property I think... something like this?

localResultsDir = project.objects.property<String>().value(project.provider { localResultsDir.get() })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions