joshfriend

Prototype implementation of a Kotlin IR based generator for java.util.ServiceLoader-style service providers

21
1
100% credibility
Found Feb 04, 2026 at 10 stars 2x -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Kotlin
AI Summary

A Kotlin compiler plugin that automatically generates service provider configuration files compatible with Java's ServiceLoader mechanism, featuring type inference and support for modern Kotlin compilers.

How It Works

1
🔍 Discover AutoService

You hear about a handy tool that makes it super easy for your app to find and use add-on features without extra setup.

2
📦 Add to your project

You simply include this tool in your project's build instructions, like adding a new ingredient to a recipe.

3
Tag your helpers

You mark the classes that provide extra features with a simple label, and the tool smartly figures out what they do.

4
🔨 Build your app

You run your usual build process, and behind the scenes, the tool creates a list of all available helpers.

5
🚀 Use features anywhere

In your app, you ask for helpers by type, and they appear ready to use, no manual linking needed.

🎉 Helpers work perfectly

Your app now automatically discovers and runs all the add-ons, making it flexible and powerful with zero hassle.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 10 to 21 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is autoservice-ir?

Autoservice-ir is a Kotlin compiler plugin that auto-generates META-INF/services files for Java's ServiceLoader, mimicking Google's AutoService but powered by Kotlin's IR and FIR backends. Drop @AutoService on implementing classes – it infers the service interface from a single supertype or uses explicit ones – and get runtime discovery without manual config files. Supports both its own annotation and Google's for easy migration, with full K2 compatibility.

Why is it gaining traction?

Unlike KSP or kapt versions, it offers type inference to skip boilerplate, real-time IDE error checking, and incremental builds that merge/clean stale entries automatically. Faster compilation, ProGuard/R8 keep rules included, and service file merging make it a seamless swap for ServiceLoader-heavy projects. Even handles nested classes and multiple interfaces out of the box.

Who should use this?

Kotlin library maintainers building plugin systems via ServiceLoader, like autoservice iraki berlin tools or iran autoservice frameworks. Android devs ditching kapt for K2-native SPI without prototype pollution risks. Teams prototyping figma-like designs or prototype design pattern implementations needing quick service registration.

Verdict

Promising drop-in for Kotlin 2.0+ ServiceLoader users, with excellent docs, tests, and functional Gradle integration despite prototype status. Low 17 stars and 1.0% credibility score mean monitor for stability, but worth piloting over slower alternatives now.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.