{"id":16975113,"url":"https://github.com/foso/kotlincompilerpluginexample","last_synced_at":"2025-04-05T10:07:55.217Z","repository":{"id":44362141,"uuid":"173250047","full_name":"Foso/KotlinCompilerPluginExample","owner":"Foso","description":"This is an example project that shows how to create a Kotlin Compiler Plugin. The plugin will print \"Hello from\" and the name of the file that is being compiled, as a compiler warning to the terminal log.","archived":false,"fork":false,"pushed_at":"2025-02-26T18:09:46.000Z","size":3294,"stargazers_count":136,"open_issues_count":6,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T09:09:47.056Z","etag":null,"topics":["compiler","compiler-plugin","gradle-plugin","kotlin","kotlin-compiler","kotlin-compiler-plugin","kotlin-multiplatform","kotlin-plugin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Foso.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-01T06:48:54.000Z","updated_at":"2025-03-26T07:44:38.000Z","dependencies_parsed_at":"2023-11-21T07:53:01.441Z","dependency_job_id":"bda844cc-3155-40e3-928b-7cf7aa15d522","html_url":"https://github.com/Foso/KotlinCompilerPluginExample","commit_stats":null,"previous_names":[],"tags_count":10,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foso%2FKotlinCompilerPluginExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foso%2FKotlinCompilerPluginExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foso%2FKotlinCompilerPluginExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foso%2FKotlinCompilerPluginExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foso","download_url":"https://codeload.github.com/Foso/KotlinCompilerPluginExample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"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":["compiler","compiler-plugin","gradle-plugin","kotlin","kotlin-compiler","kotlin-compiler-plugin","kotlin-multiplatform","kotlin-plugin"],"created_at":"2024-10-14T01:09:17.845Z","updated_at":"2025-04-05T10:07:55.190Z","avatar_url":"https://github.com/Foso.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003eKotlinCompilerPluginExample \u003c/h1\u003e\n\n[![jCenter](https://img.shields.io/badge/Apache-2.0-green.svg\n)](https://github.com/Foso/KotlinReactNativeMpp/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![jCenter](https://img.shields.io/badge/Kotlin-2.0.0-green.svg\n)](https://github.com/Foso/Sheasy/blob/master/LICENSE)\n\n\n\n## Introduction 🙋‍♂️\n\nThis is an example project that shows how to create a Kotlin Compiler Plugin. At compile time a gradle plugin will trigger the compiler plugin. The plugin will print \"Hello from\" and the name of the file that is being compiled, as a compiler warning to the terminal log.\n\n\u003cp\u003e\n    \u003cimg src =\"https://raw.githubusercontent.com/Foso/KotlinCompilerPluginExample/master/docs/screenshot.png\" /\u003e\n \n\u003c/p\u003e\n\n### Show some :heart: and star the repo to support the project\n\n[![GitHub stars](https://img.shields.io/github/stars/Foso/KotlinCompilerPluginExample.svg?style=social\u0026label=Star)](https://github.com/Foso/KotlinCompilerPluginExample) [![GitHub forks](https://img.shields.io/github/forks/Foso/KotlinCompilerPluginExample.svg?style=social\u0026label=Fork)](https://github.com/Foso/KotlinCompilerPluginExample/fork) [![GitHub watchers](https://img.shields.io/github/watchers/Foso/KotlinCompilerPluginExample.svg?style=social\u0026label=Watch)](https://github.com/Foso/KotlinCompilerPluginExample) [![Twitter Follow](https://img.shields.io/twitter/follow/jklingenberg_.svg?style=social)](https://twitter.com/jklingenberg_)\n\n\n## Usage\n\n\u003e :information_source: Please be aware that the Kotlin Compiler still doesn't have any stable API and there is no\n\u003e backwards compatibility guaranteed. Kotlin versions above 1.9.23 can have a totally different API.\n\n* Inside the project folder run `./gradlew clean build` \n\nThe plugin is only active when the build cache is changed. This is why you need to run \"clean\" before building, when you want to see the log output again.\n\n### 👷 Project Structure\n*  \u003ckbd\u003elib\u003c/kbd\u003e - A Kotlin Multiplatform project which applies a gradle plugin(compiler.plugin.helloworld) which triggers the compiler plugin.\n*  \u003ckbd\u003ecompiler-plugin\u003c/kbd\u003e - This module contains the Kotlin Compiler Plugin\n*  \u003ckbd\u003egradle-plugin\u003c/kbd\u003e - This module contains the gradle plugin which trigger the compiler plugin\n\n## Useful resources\n[The Road to the New Kotlin Compiler](https://www.youtube.com/watch?v=iTdJJq_LyoY)\n\n[https://github.com/bnorm/kotlin-ir-plugin-template](https://github.com/bnorm/kotlin-ir-plugin-template)\n\n[Writing Your Second Kotlin Compiler Plugin, Part 1 — Project Setup](https://blog.bnorm.dev/writing-your-second-compiler-plugin-part-1)\n\n[Experimenting with the Kotlin Compiler by Jossi Wolf, Snapp Mobile EN](https://www.youtube.com/watch?v=Y6gEA-nS2uQ)\n\n[Crash course on the Kotlin compiler | 1. Frontend: Parsing phase](https://medium.com/google-developer-experts/crash-course-on-the-kotlin-compiler-1-frontend-parsing-phase-9898490d922b)\n\n## ✍️ Feedback\n\nFeel free to send feedback on [Twitter](https://twitter.com/jklingenberg_) or [file an issue](https://github.com/foso/KotlinCompilerPluginExample/issues/new). Feature requests are always welcome.\n\n\n### Find this project useful ? :heart:\n* Support it by clicking the :star: button on the upper right of this page. :v:\n\n## 📜 License\n\n-------\n\nThis project is licensed under Apache License, Version 2.0\n\n    Copyright 2019 Jens Klingenberg\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n## Acknowledgments\nProjects that helped me understand how to setup the project:\n* [kevinmost/debuglog](https://github.com/kevinmost/debuglog)\n* [ZacSweers/redacted-compiler-plugin](https://github.com/ZacSweers/redacted-compiler-plugin)\n* [hotchemi/kotlin-compiler-plugin-example\n](https://github.com/hotchemi/kotlin-compiler-plugin-example)\n* [Takhion/sample-kotlin-compiler-plugin](https://github.com/Takhion/sample-kotlin-compiler-plugin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoso%2Fkotlincompilerpluginexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoso%2Fkotlincompilerpluginexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoso%2Fkotlincompilerpluginexample/lists"}