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