Skip to content

Gradle plugin: register generated sources for third-party WireOutput subclasses#3663

Merged
oldergod merged 1 commit into
masterfrom
bquenaudon.2026-07-22.custom-wire-outputs
Jul 22, 2026
Merged

Gradle plugin: register generated sources for third-party WireOutput subclasses#3663
oldergod merged 1 commit into
masterfrom
bquenaudon.2026-07-22.custom-wire-outputs

Conversation

@oldergod

@oldergod oldergod commented Jul 22, 2026

Copy link
Copy Markdown
Member

Problem

Since the Wire 7 Gradle plugin rework, SourceRoots.registerGeneratedSources matches on the built-in output classes (JavaOutput, KotlinOutput, CustomOutput) and throws for anything else:

Wire output ThirdPartyOutput_Decorated is not supported in project :foo

This breaks Gradle plugins that build on top of Wire by adding their own WireOutput subclasses to wire.outputs (found while rolling Wire 7.0.0-alpha06 out to Cash's build logic, which registers several such outputs). It's a regression from Wire 6, where dispatch happened on the produced Target and any output producing a CustomTarget worked.

Fix

Treat unknown WireOutput subclasses like CustomOutput: custom targets are wildcards, so register the output directory on both the Java and Kotlin source sets (JVM/KMP and Android variants alike). ProtoOutput is filtered out before registerGeneratedSources is called, so the else branch only ever sees third-party outputs.

…subclasses

SourceRoots matched on the built-in output classes and threw
"Wire output X is not supported" for any other WireOutput subclass,
breaking plugins that add their own outputs (a regression from Wire 6,
which dispatched on the produced Target and supported CustomTarget from
any output). Treat unknown outputs like CustomOutput: their targets are
wildcards, so register the output directory on both the Java and Kotlin
source sets.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oldergod
oldergod requested review from dnkoutso and staktrace July 22, 2026 08:52
@oldergod
oldergod marked this pull request as ready for review July 22, 2026 08:52
@oldergod
oldergod merged commit 69dc7ba into master Jul 22, 2026
17 checks passed
@oldergod
oldergod deleted the bquenaudon.2026-07-22.custom-wire-outputs branch July 22, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants