Wire: Gradle plugin shouldn't fail during configuration phase if there's no wire {} block

Created on 12 Dec 2019  路  2Comments  路  Source: square/wire

I applied the plugin:

buildscript {
    dependencies {
        classpath 'com.squareup.wire:wire-gradle-plugin:3.0.2'
    }
}

apply plugin: 'com.squareup.wire'

And immediately after "Import changes" got a configuration failure:

> Invalid path string: "src/main/proto". Path does not exist.

This feels too aggressive. Perhaps the plugin should either:

  1. Not fail during configuration if there's no wire {} block in build.gradle.
  2. Not fail during configuration at all, only during execution.
Gradle enhancement

Most helpful comment

I vote 2. Doing anything during configuration is probably wrong. That path could be generated by a task that hasn't run yet.

All 2 comments

I vote 2. Doing anything during configuration is probably wrong. That path could be generated by a task that hasn't run yet.

Hmm, I tried to reproduce in a wire-plugin-test with a build.gradle without any wire block but it doesn't seem to trouble things.

Was this page helpful?
0 / 5 - 0 ratings