Triple-T / gradle-play-publisher

GPP is Android's unofficial release automation Gradle Plugin. It can do anything from building, uploading, and then promoting your App Bundle or APK to publishing app listings and other metadata.
MIT License
4.13k stars 341 forks source link

plugins {} DSL doesn't work #670

Closed tomaszrykala closed 5 years ago

tomaszrykala commented 5 years ago

This format in my root build.gradle doesn't work:

plugins {
    id 'com.android.application'
    id 'com.github.triplet.play' version '2.3.0'
}

I've had to change to the one that works for every other dependency in my project:

buildscript {
    repositories {}
    dependencies {
        classpath 'com.github.triplet.gradle:play-publisher:2.3.0'
    }
}

Wouldn't it be better to provide this example in the documentation?

Optionally, simply add it as an additional example next to the plugins format, for users who want to eschew snapshot releases.

SUPERCILEX commented 5 years ago

WDYM it doesn't work? What's the error?

SUPERCILEX commented 5 years ago

Oh wait, you applied it to the root module. That's incorrect, please apply it in the build file for your app module (usually app).

I don't want to suggest classpath because that breaks Kotlin DSLs if done incorrectly.

tomaszrykala commented 5 years ago

Hmm, maybe I don't follow.

plugins {
    id 'com.android.application'
    id 'com.github.triplet.play' version '2.3.0'
}

android {
... }

produces

> startup failed:
  build file '.../app/build.gradle': 18: only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed

  See https://docs.gradle.org/5.4.1/userguide/plugins.html#sec:plugins_block for information on the plugins {} block

that link doesn't quite explain why and where should we put the plugins section

SUPERCILEX commented 5 years ago

What's in your settings.gradle file?