# Martin Bonnin's blog

Untitled Publication

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Gradle brainteasers 2/2: relocatable input files

DevFeed: [Gradle brainteasers 2/2: relocatable input files](<https://devfeed.tech/articles/gradle-brainteasers-2-2-relocatable-input-files-25431.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/gradle-brainteasers-22-relocatable-input-files>)

Author: Martin Bonnin

Published: 2024-07-17T08:41:15Z

Content type: tutorial

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [GraphQL](<https://devfeed.tech/topics/graphql.md>), [Caching](<https://devfeed.tech/topics/caching.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [apollo](<https://devfeed.tech/tags/apollo.md>), [build-tool](<https://devfeed.tech/tags/build-tool.md>), [cache](<https://devfeed.tech/tags/cache.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [gradle-plugin](<https://devfeed.tech/tags/gradle-plugin.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [plugin](<https://devfeed.tech/tags/plugin.md>)

### AI overview

This tutorial explains how the Apollo Gradle Plugin models GraphQL input files so generated Kotlin package names remain correct without breaking Gradle build cache relocation. It recommends using FileCollection and related APIs to preserve each file's relative path and other input information.

### Source excerpt

This is a follow up to this other post about having fun with the Gradle APIs. In this post, I'm talking about how I spent a shameful amount of time understanding how Gradle handles input files. The problem The Apollo Gradle Plugin is generating Kotli...

## Gradle brainteasers 1/2: aggregating artifacts

DevFeed: [Gradle brainteasers 1/2: aggregating artifacts](<https://devfeed.tech/articles/gradle-brainteasers-1-2-aggregating-artifacts-25430.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/gradle-brainteasers-12-aggregating-artifacts>)

Author: Martin Bonnin

Published: 2024-07-15T10:44:26Z

Content type: tutorial

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [modules](<https://devfeed.tech/topics/modules.md>)

Tags: [build](<https://devfeed.tech/tags/build.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [modules](<https://devfeed.tech/tags/modules.md>)

### AI overview

This tutorial explains how to aggregate artifacts from multiple Gradle projects in a multi-project build while supporting project isolation. It describes using configurations and the artifacts {} API to express cross-project dependencies and avoid unsafe sharing patterns that can cause race conditions and hinder parallelized, reproducible builds.

### Source excerpt

I've been developing Gradle plugins for 7 years now. Sometimes I love it, sometimes I hate it. But even when I hate it, I love hating it! I just realized some of the Gradle APIs are like those metal wire brain teasers games: Are they easy? No. Do y...

## Gradle alternatives to afterEvaluate for more explicit plugin configuration

DevFeed: [Gradle alternatives to afterEvaluate for more explicit plugin configuration](<https://devfeed.tech/articles/my-life-after-afterevaluate-25434.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/my-life-after-afterevaluate>)

Author: Martin Bonnin

Published: 2022-11-24T15:00:50Z

Content type: opinion

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [build](<https://devfeed.tech/tags/build.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

### AI overview

The article explains why relying on Gradle's afterEvaluate {} can make plugin and script dependencies implicit and fragile. It recommends exposing functions in plugin extensions for reading extension properties and configuring defaults, giving code more explicit control over execution timing.

### Source excerpt

If you're writing Gradle build scripts, chances are you have already used afterEvaluate {}. This is usually the last resort solution. But in my life of Gradle scripts engineer, I found the odds of afterEvaluate {} actually "fixing" your issue are in ...

## How Gradle compiles your build scripts

DevFeed: [How Gradle compiles your build scripts](<https://devfeed.tech/articles/how-gradle-compiles-your-build-scripts-25432.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/how-gradle-compiles-your-build-scripts>)

Author: Martin Bonnin

Published: 2022-11-18T17:14:29Z

Content type: tutorial

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Code](<https://devfeed.tech/topics/code.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Parser](<https://devfeed.tech/topics/parser.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [build](<https://devfeed.tech/tags/build.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [script](<https://devfeed.tech/tags/script.md>)

### AI overview

This tutorial explains how Gradle compiles build scripts in multiple passes. Gradle first extracts and evaluates the plugins block using the Kotlin lexer, generates accessors, and then compiles and evaluates the script with plugin dependencies on the classpath. It also discusses version catalogs and other ways to centralize Kotlin versions.

### Source excerpt

This post is inspired by a discussion on the Gradle community slack. Many thanks to @Vampire and @ephemient for their help understanding all of this Have you ever tried to do something like this? val kotlinVersion = "1.7.21" plugins { id("org.j...

## About the Android Makers app, security and google-services.json

DevFeed: [About the Android Makers app, security and google-services.json](<https://devfeed.tech/articles/about-the-android-makers-app-security-and-google-services-json-25429.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/about-the-android-makers-app-security-and-google-servicesjson>)

Author: Martin Bonnin

Published: 2022-05-06T13:45:38Z

Content type: article

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [API keys](<https://devfeed.tech/topics/api-keys.md>), [Security](<https://devfeed.tech/topics/security.md>), [Firebase](<https://devfeed.tech/topics/firebase.md>), [APK](<https://devfeed.tech/topics/apk.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Google](<https://devfeed.tech/topics/google.md>), [Google Play](<https://devfeed.tech/topics/google-play.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [api](<https://devfeed.tech/tags/api.md>), [apk](<https://devfeed.tech/tags/apk.md>), [firebase](<https://devfeed.tech/tags/firebase.md>), [google-cloud](<https://devfeed.tech/tags/google-cloud.md>), [google-play](<https://devfeed.tech/tags/google-play.md>), [security](<https://devfeed.tech/tags/security.md>)

### AI overview

The article explains why an Android API key in google-services.json is accessible in an app and can be retrieved from a published APK. It discusses the apparent contradiction between that accessibility and warnings about exposing the key in GitHub or Google Play.

### Source excerpt

Android Makers is over! With over 650 participants and 50 sessions over 2 days in Paris, it was a lot of fun! It was nice to see everyone in person again and discuss all the Android things (and 🍻 too)! This year, we decided to rewrite the Android a...

## Kotlin compatibility QuickSheet

DevFeed: [Kotlin compatibility QuickSheet](<https://devfeed.tech/articles/kotlin-compatibility-quicksheet-25433.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/kotlin-compatibility-quicksheet>)

Author: Martin Bonnin

Published: 2021-11-17T15:22:18Z

Content type: tutorial

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [blog-post](<https://devfeed.tech/tags/blog-post.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

### AI overview

A practical guide to Kotlin compatibility across compiler, library, API, language, and metadata versions. It tests projects compiled with Kotlin 1.3, 1.4, and 1.5 against a library compiled with Kotlin 1.6, and discusses using Kotlin 1.6 APIs while supporting older users.

### Source excerpt

Edit: Blog post updated for Kotlin 1.7, see the last paragraph for details. Kotlin 1.6 has just been released 🎉 (blog post). This is great news for everyone in the Kotlin ecosystem. As with every feature release, there are new features, new deprec...

## Use latest Kotlin in your Gradle plugins

DevFeed: [Use latest Kotlin in your Gradle plugins](<https://devfeed.tech/articles/use-latest-kotlin-in-your-gradle-plugins-25435.md>)

Original publisher: [Read original article](<https://blog.mbonnin.net/use-latest-kotlin-in-your-gradle-plugins>)

Author: Martin Bonnin

Published: 2021-11-12T15:13:39Z

Content type: tutorial

Language: en

Sources: [Martin Bonnin's blog](<https://devfeed.tech/sources/martin-bonnin-s-blog.md>)

Topics: [Gradle](<https://devfeed.tech/topics/gradle.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [plugins](<https://devfeed.tech/tags/plugins.md>)

### AI overview

This article explains the classloader and embedded Kotlin runtime limitations that arise when using newer Kotlin APIs in Gradle plugins. It discusses the resulting compatibility problem and workarounds including bytecode restrictions and Gradle's Worker API with classloader isolation.

### Source excerpt

This is the story of how I got down the rabbit hole of relocating classes while trying to workaround the Gradle classloaders and fixed Kotlin runtime limitations. I'm not sure if I'd recommend trying this at home but this was an interesting journey! ...