All Projects → Foso → KotlinCompilerPluginExample

Foso / KotlinCompilerPluginExample

Licence: Apache-2.0 License
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.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to KotlinCompilerPluginExample

Kompute
Kotlin Compiler plugin bringing reactivity to variable declarations
Stars: ✭ 18 (-58.14%)
Mutual labels:  kotlin-compiler, kotlin-plugin, compiler-plugin, kotlin-compiler-plugin
kotlin-plugin-generated
A Kotlin compiler plugin that annotates Kotlin-generated methods for improved coverage reports
Stars: ✭ 33 (-23.26%)
Mutual labels:  gradle-plugin, kotlin-compiler, kotlin-plugin
kotlinx-resources
Kotlin Multiplatform (KMP) library for reading resources in tests
Stars: ✭ 15 (-65.12%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+148.84%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
kmp-fatframework-cocoa
A Gradle plugin to generate and publish an iOs FatFramework or XCFramework on Kotlin Multiplatform projects.
Stars: ✭ 26 (-39.53%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (+25.58%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (-27.91%)
Mutual labels:  kotlin-multiplatform
KotlinMultiplatformAndoridParcelize
Use the Parcelize Annotation of the Kotlin Android Extensions in Kotin Multiplatform projects
Stars: ✭ 16 (-62.79%)
Mutual labels:  kotlin-multiplatform
meu kumbu
💵Meu Kumbu 💰 (Means My Money) is a template app that people can use to build their owns Wallet 🤑 or a mobile 🏦 banking app.
Stars: ✭ 55 (+27.91%)
Mutual labels:  kotlin-multiplatform
multithread-mpp
This is the best architecture of Kotlin Multiplatform Project I think! This project works on background thread using kotlinx.Coroutines.
Stars: ✭ 16 (-62.79%)
Mutual labels:  kotlin-multiplatform
koru
Simple coroutine wrappers for Kotlin Native. Generated from annotations. Compatible with RxSwift, Combine etc.
Stars: ✭ 141 (+227.91%)
Mutual labels:  kotlin-multiplatform
moko-errors
Automated exceptions handler for mobile (android & ios) Kotlin Multiplatform development.
Stars: ✭ 45 (+4.65%)
Mutual labels:  kotlin-multiplatform
removeRes
一键移除Android项目中没有使用到的资源文件和Xml元素声明
Stars: ✭ 16 (-62.79%)
Mutual labels:  gradle-plugin
gradle-cleaner-intellij-plugin
Force clear delaying & no longer needed Gradle tasks.
Stars: ✭ 26 (-39.53%)
Mutual labels:  gradle-plugin
crypto
A collection of Kotlin Multiplatform Mobile cryptographic hashing functions.
Stars: ✭ 45 (+4.65%)
Mutual labels:  kotlin-multiplatform
feature-flag-android
A Gradle plugin to achieve feature flag based development for Android applications.
Stars: ✭ 82 (+90.7%)
Mutual labels:  gradle-plugin
ManaDrop
A Gradle plugin for Minecraft development
Stars: ✭ 20 (-53.49%)
Mutual labels:  gradle-plugin
stater
Android library for easy save data to bundle in Activity/Fragment.
Stars: ✭ 12 (-72.09%)
Mutual labels:  gradle-plugin
kmm-awesome
An awesome list that curates the best KMM libraries, tools and more.
Stars: ✭ 598 (+1290.7%)
Mutual labels:  kotlin-multiplatform
gradle-build-info-plugin
Gradle plugin to include build information such as Git commit ID to your JAR. It can be used to show Git commit information with Spring Boot Actuator.
Stars: ✭ 33 (-23.26%)
Mutual labels:  gradle-plugin

KotlinCompilerPluginExample

jCenter PRs Welcome jCenter

Introduction 🙋‍♂️

This 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.

Show some ❤️ and star the repo to support the project

GitHub stars GitHub forks GitHub watchers Twitter Follow

Usage

ℹ️ Please be aware that the Kotlin Compiler still doesn’t have any stable API and there is no backwards compatibility guaranteed. Kotlin versions above 1.6.0 can have a totally different API.

  • Inside the project folder run ./gradlew clean build

The 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.

👷 Project Structure

src

  • src - A Kotlin Multiplatform project which applies a gradle plugin(compiler.plugin.helloworld) whichs triggers the compiler plugin.

buildSrc/compiler-plugin

  • kotlin-compiler-native-plugin - This module contains the Kotlin Compiler Plugin for native targets
  • kotlin-compiler-plugin - This module contains the Kotlin Compiler Plugin for JVM/JS targets
  • gradle-plugin - This module contains the gradle plugin which trigger the two compiler plugins

✍️ Feedback

Feel free to send feedback on Twitter or file an issue. Feature requests are always welcome.

Find this project useful ? ❤️

  • Support it by clicking the button on the upper right of this page. ✌️

📜 License


This project is licensed under Apache License, Version 2.0

Copyright 2019 Jens Klingenberg

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Acknowledgments

Projects that helped me understand how to setup the project:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].