{"id":16306185,"url":"https://github.com/gfx/gradle-plugin-template","last_synced_at":"2025-10-25T14:30:48.202Z","repository":{"id":17073500,"uuid":"19838435","full_name":"gfx/gradle-plugin-template","owner":"gfx","description":"A template project for Gradle plugins","archived":false,"fork":false,"pushed_at":"2015-03-08T01:05:18.000Z","size":298,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-06T18:21:48.311Z","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/gfx.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-05-15T23:25:10.000Z","updated_at":"2018-11-16T20:22:45.000Z","dependencies_parsed_at":"2022-09-09T02:50:13.612Z","dependency_job_id":null,"html_url":"https://github.com/gfx/gradle-plugin-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Fgradle-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Fgradle-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Fgradle-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gfx%2Fgradle-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gfx","download_url":"https://codeload.github.com/gfx/gradle-plugin-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238155504,"owners_count":19425727,"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-10T21:09:53.916Z","updated_at":"2025-10-25T14:30:47.918Z","avatar_url":"https://github.com/gfx.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A Template Project on Gradle plugins for Android [![Build Status](https://travis-ci.org/gfx/gradle-plugin-template.svg)](https://travis-ci.org/gfx/gradle-plugin-template)\n\nThis is a template project on Gradle plugins for Android. The `plugin/` directory is the main\nmodule that implements a Gradle plugin, including a plugin class, an extension class, and a task\nclass.\n\n```\nplugin/   - The main module of a Gradle plugin\nexample/  - An example android application that uses this plugin\nbuildSrc/ - A helper module to use this plugin in example modules\n```\n\n## Gradle Properties\n\nCopy `gradle.properties.sample` into `~/.gradle/gradle.properties` and set correct values.\n\nNote that `PGP_KEY_ID` is the value that `gpg --list-secret-keys` shows.\n\n## Caveats\n\n### Resources in plugin.jar\n\nReading resources from `plugin.jar` is extremely unstable so you'll see a method in\n[FooTask.groovy](https://github.com/gfx/gradle-plugin-template/blob/master/plugin%2Fsrc%2Fmain%2Fgroovy%2Fcom%2Fgithub%2Fgfx%2Fgradle_plugin_template%2FFooTask.groovy):\n\n```groovy\nString getResourceContent(String filename) {\n    URL templateFileUrl = getClass().getClassLoader().getResource(filename)\n    if (templateFileUrl == null) {\n        throw new GradleException(\"[${this.tag}] File not found: $filename\")\n    }\n\n    try {\n        return templateFileUrl.openStream().getText(\"UTF-8\")\n    } catch (IOException e) {\n        // fallback to read JAR directly\n        def connection = templateFileUrl.openConnection() as JarURLConnection\n        def jarFile = connection.jarFileURL.toURI()\n        ZipFile zip\n        try {\n            zip = new ZipFile(new File(jarFile))\n        } catch (FileNotFoundException ex) {\n            project.logger.warn(\"[${this.tag}] No plugin.jar. run `./gradlew plugin:jar` first.\")\n            throw ex\n        }\n        return zip.getInputStream((zip.getEntry(filename))).getText(\"UTF-8\")\n    }\n}\n```\n\nIt looks strange but works anyway. I don't know whether it is intended or not.\n\n## See Also\n\n* [Gradle User Guide](http://www.gradle.org/docs/current/userguide/userguide.html)\n  * [Writing Custom Task Classes](http://www.gradle.org/docs/current/userguide/custom_tasks.html)\n  * [Writing Custom Plugins](http://www.gradle.org/docs/current/userguide/custom_plugins.html)\n\n## Author And License\n\nCopyright 2014, FUJI Goro (gfx) \u003cgfuji@cpan.org\u003e. All rights reserved.\n\nThis library may be copied only under the terms of the Apache License 2.0, which may be found in the distribution.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Fgradle-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgfx%2Fgradle-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgfx%2Fgradle-plugin-template/lists"}