square / square/wire

Build variant specific generated source dir for proto files

Open
#3,368 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

Hey everyone 👋

I'm working on a custom task setup, where I download proto files from a remote source. For each flavored build variant I download a set of files or a zip (depends on the task) which can have a Jni or assets, and also a proto file, and I use AGP API to put them into a generated source set: build/generated/*. I know that Wire can automatically detect src/main/proto but how can I tell it to look in generated folder for a specific build variant? I tried to connect my task output (the generated directory property) to the input of the WireTask but so far it doesn't work. Is there any way to do that? I don't want to copy proto files to the src dir, I want to keep them in the build directory.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WireTask and the Android build-variant setup described in the issue, then compare how src/main/proto is discovered with inputs under build/generated. Trace whether the custom task's generated directory can be connected to the variant-specific WireTask input. Done means proto files supplied per flavor are consumed from generated directories without copying them into src.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
build-system, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.