This Gradle project shows an example of how remote script plugin can be versioned. Client has now the control if he wants to upgrade to the new version of the script plugin, or he wants to use the existing one in case it contains any breaking changes.
Check the build.gradle script file to see how the plugin is applied.
apply from: "https://raw.githubusercontent.com/rivancic/gradle-versioned-script-plugin/${property('tasks.plugin.version')}/gradle/filesPlugin.gradle"
Source code fo the script plugin is deployed in another publicly available Github repository.
Script Plugins (Gradle Userguide)
Public GitHub examples using remote Gradle script plugins:
Project | Description |
---|---|
kurra/sampleGradleProject | In a simple project, main gradle.build file applies remote gradle script from another remote repository of kurra/gradleScripts/. And this remote script in fact applies other remote scripts that set up repositories, other core plugins, manages exclusion of some specific dependencies.. |
grails-guides/grails-elasticsearch | Repository containing example of Grails integration with Elasticsearch. Root project is applying remote script plugin. It configures repositories, adds basic tasks and verifies that necessary properties are set after project is configured. If you check other project inside grails-guides you'll see that almost every project uses same approach to configure basic boilerplate code. |
gocd-contrib/docker-elastic-agents-plugin | GoCD uses some smart approaches of applying the remote scripts. It uses cache invalidation that appends time as query parameter to avoid caching old version of the file. This is the helper remote script plugin that gets applied. It can also resolve link to the file dynamically depending on the fact if its provided as local or remote script plugin. |