Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor top-level build.gradle to avoid enabling unhelpful plugins #6131

Merged
merged 7 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions all/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
apply plugin: 'com.github.kt3k.coveralls'
plugins {
id "java"
id "maven-publish"

description = "gRPC: All"

buildscript {
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep the old behavior, you might add this in settings.gradle

pluginManagement {
    repositories {
        maven { // The google mirror is less flaky than mavenCentral()
            url "https://maven-central.storage-download.googleapis.com/repos/central/data/"
        }
        gradlePluginPortal()
    }
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't using mavenCentral any more, so using the Google mirror isn't all that useful. But even more, it can't load the plugins from the google mirror, because the search will be based on the name com.github.kt3k.coveralls, not org.kt3k.gradle.plugin:coveralls-gradle-plugin. While there are ways to make that work, they require some effort and it doesn't seem all that helpful given most of the plugins are not available on the google mirror.

}
dependencies { classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1' }
id "com.github.kt3k.coveralls"
}

description = "gRPC: All"

def subprojects = [
project(':grpc-api'),
project(':grpc-auth'),
Expand Down
20 changes: 7 additions & 13 deletions alts/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
buildscript {
repositories { jcenter() }
dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' }
}
plugins {
id "java"
id "maven-publish"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move 'maven' plugin as well? If mavne-publish is a super set of maven plugin, we can remove maven plugin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just assume delete the maven plugin. I couldn't find anything that failed when I removed the maven plugin outright. That seemed suspicious to me, so I just left it in place for now to reduce the risk.


apply plugin: 'com.github.johnrengelman.shadow'
id "com.github.johnrengelman.shadow"
id "com.google.protobuf"
id "ru.vyarus.animalsniffer"
}

description = "gRPC: ALTS"

sourceCompatibility = 1.7
targetCompatibility = 1.7

buildscript {
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
}
dependencies { classpath libraries.protobuf_plugin }
}

dependencies {
compile project(':grpc-auth'),
project(':grpc-core'),
Expand Down
8 changes: 8 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
plugins {
id "java"
id "maven-publish"

id "me.champeau.gradle.jmh"
id "ru.vyarus.animalsniffer"
}

description = 'gRPC: API'

dependencies {
Expand Down
8 changes: 8 additions & 0 deletions auth/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
plugins {
id "java"
id "maven-publish"

id "me.champeau.gradle.japicmp"
id "ru.vyarus.animalsniffer"
}

description = "gRPC: Auth"
dependencies {
compile project(':grpc-api'),
Expand Down
20 changes: 12 additions & 8 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
buildscript {
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
}
dependencies { classpath libraries.protobuf_plugin }
}
plugins {
id "application"
id "java"
id "maven-publish"

apply plugin: 'application'
id "com.google.protobuf"
id "me.champeau.gradle.jmh"
}

description = "grpc Benchmarks"

Expand All @@ -20,6 +19,10 @@ jmh {
includeTests = true
}

configurations {
alpnagent
}

dependencies {
compile project(':grpc-core'),
project(':grpc-netty'),
Expand All @@ -34,6 +37,7 @@ dependencies {
libraries.netty_epoll,
libraries.math
compileOnly libraries.javax_annotation
alpnagent libraries.jetty_alpn_agent
}

import net.ltgt.gradle.errorprone.CheckSeverity
Expand Down
4 changes: 4 additions & 0 deletions bom/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id "maven-publish"
}

description = 'gRPC: BOM'

publishing {
Expand Down