guides icon indicating copy to clipboard operation
guides copied to clipboard

Clarity enhancement on Implementing Gradle Plugins guide

Open rettal opened this issue 5 years ago • 1 comments

Message relates to following guide: https://guides.gradle.org/implementing-gradle-plugins/

Regarding the ServerEnvironmentPlugin section of the guide it is not clear what serverEnvironment.getName would return?

It is not clear what getName will return because 3 names are defined in the DSL shown.

This is first time I am writing a plugin so apologies if I am missing something.

Thank you, Daniel.

rettal avatar Feb 26 '20 21:02 rettal

Does this help out at all?

The below code would create 3 instances of a ServerEnvironment each would have a different name.

environments {
    dev { // name would be 'dev'
        url = 'http://localhost:8080'
    }

    staging { // name would be 'staging'
        url = 'http://staging.enterprise.com'
    }

    production { // name would be 'production'
        url = 'http://prod.enterprise.com'
    }
}

JLLeitschuh avatar Mar 09 '20 21:03 JLLeitschuh