{"id":17993499,"url":"https://github.com/stempler/gradle-include-plugin","last_synced_at":"2025-03-26T01:32:15.808Z","repository":{"id":14582162,"uuid":"17298594","full_name":"stempler/gradle-include-plugin","owner":"stempler","description":"Parametrizable includes for Gradle build scripts ","archived":false,"fork":false,"pushed_at":"2014-09-11T15:36:57.000Z","size":304,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T01:34:15.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stempler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-28T20:21:54.000Z","updated_at":"2020-07-15T06:18:30.000Z","dependencies_parsed_at":"2022-09-06T23:30:34.056Z","dependency_job_id":null,"html_url":"https://github.com/stempler/gradle-include-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stempler%2Fgradle-include-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stempler%2Fgradle-include-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stempler%2Fgradle-include-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stempler%2Fgradle-include-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stempler","download_url":"https://codeload.github.com/stempler/gradle-include-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245572011,"owners_count":20637431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T20:11:43.214Z","updated_at":"2025-03-26T01:32:15.559Z","avatar_url":"https://github.com/stempler.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"gradle-include-plugin\n=====================\n\nParametrizable includes for Gradle build scripts. The plugin allows to include external build scripts quite similar to using `apply from: ...`. In contrast to *apply from* you can directly call specific methods defined in the included script and if applicable provide parameter values.\n\nUsage\n-----\n\nFirst apply the plugin in your build file:\n\n```groovy\nbuildscript {\n\trepositories {\n\t\tjcenter()\n\t}\n\tdependencies {\n\t\tclasspath 'org.standardout:gradle-include-plugin:0.2.0'\n\t\t// if using Gradle 1.x uncomment the following line\n//\t\tclasspath 'org.codehaus.groovy:groovy-backports-compat23:2.3+'\n\t}\n}\n\napply plugin: 'org.standardout.include'\n```\n\nSpecify scripts to include like this:\n\n```groovy\ninclude {\n  from 'modules/test.groovy'\n}\n```\n\nThis will execute the script body, like `apply from: 'modules/test.groovy'` would do.\n\nAdding a closure allows to call specific methods defined in the included script - the script body will not be executed, unless you call it explicitly inside the closure with `run()`:\n\n```groovy\ninclude {\n  from 'modules/test.groovy', {\n    hello('world')\n  }\n}\n```\n\nThe included **modules/test.groovy** for these examples could look like this:\n\n```groovy\ndef hello(String who = 'Gradle') {\n  project.logger.info \"Hello $who!\"\n}\n\nhello()\n```\n\nSo for the first include example the script would be run and **hello** executed without parameters, for the second include example instead the **hello** method is explicitly called with a custom parameter (and `Hello world!` is logged).\n\nThe [sample project for bnd-platform](https://github.com/stempler/bnd-platform-sample) also contains some examples on using the *gradle-include-plugin*. Check it out to see more complex and complete examples of using the plugin.\n\n### Available properties\n\nThe following properties are injected into the script:\n\n* **project** - the Gradle project\n* **thisFile** - the File object representing the included script\n* **thisDir** - the directory the included script resides in (also a File object)\n \nApart from this any properties or methods that are not found in the script will be resolved against the project. So the script that is included can be defined similar to a normal build script.\n\n### Including directories\n\nYou can also specify a directory instead of a script file to be included. The plugin will look for files with `.gradle` or `.groovy` extensions. If a file is found that has the same name as the directory, only this file is included, if no such file is found all script files encountered are included. If no closure is applied, each file is executed, otherwise the methods called in the closure are called on each script.\n\n```groovy\ninclude {\n  from 'modules' // run all scripts\n}\n```\n\n```groovy\ninclude {\n  from('modules') {\n    hello() // all scripts must have a hello method that is executed\n  }\n}\n```\n\nLicense\n-------\n\nThis software is licensed under the\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstempler%2Fgradle-include-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstempler%2Fgradle-include-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstempler%2Fgradle-include-plugin/lists"}