Example getting properties value from settings.gradle.kts

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            // Work around https://github.com/gradle/gradle/issues/1697.
            if (requested.version == null) {
                def pluginName = requested.id.name.split('-').collect { it.capitalize() }.join().uncapitalize()
                def versionPropertyName = (requested.id.id == 'org.jetbrains.kotlin.jvm') ?
                        "kotlinPluginVersion" : "${pluginName}PluginVersion"
                logger.info("Checking for plugin version property '$versionPropertyName'.")
                if (gradle.rootProject.hasProperty(versionPropertyName)) {
                    def version = gradle.rootProject.properties[versionPropertyName]
                    logger.info("Setting '${requested.id.id}' plugin version to $version.")
                    useVersion version
                } else {
                    logger.warn("No version specified for plugin '${requested.id.id}' and property " +
                            "'$versionPropertyName' does not exist.")
                }
            }
        }
    }
}

0 Response to "Example getting properties value from settings.gradle.kts"

Post a comment

Bila Ada posting yang kurang, atau error atau yang lainnya, silahkan tinggalkan komentar agar artikel/post di perbaiki.
Jangan Lupa Cek Box "Notify Me" agar tahu komentar kamu dibalas oleh saya.

If there are any posts that are missing, or error or anything else, please leave a comment for the article / post to be fixed.
Do not Forget Check Box "Notify Me" to know our comments replied by me.

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel