-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Changes from 1 commit
45d3c06
19fbaf6
fb2301e
af77556
b1bb108
84d9109
ee79444
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
description = 'gRPC: gae interop testing (jdk8)' | ||
|
||
buildscript { | ||
// Configuration for building | ||
|
@@ -26,6 +25,13 @@ buildscript { | |
} | ||
} | ||
|
||
plugins { | ||
id "java" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems all projects explicitly apply java plugin, why not apply it in rootDir/build.gradle? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1 ) Android should not include Java, which is a follow-up PR and 2) make it easier to swap to java-library, since java-library will only apply to a subset of projects. "java" plugin has historically been the main problem, so it was the most important one to move into individual projects. Things like maven-publish were more icing on the cake. |
||
id "war" | ||
} | ||
|
||
description = 'gRPC: gae interop testing (jdk8)' | ||
|
||
repositories { | ||
// repositories for Jar's you access in your code | ||
mavenLocal() | ||
|
@@ -34,8 +40,6 @@ repositories { | |
jcenter() | ||
} | ||
|
||
apply plugin: 'java' // standard Java tasks | ||
apply plugin: 'war' // standard Web Archive plugin | ||
apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isn't on the plugins.gradle.org so the new plugin syntax doesn't work. I later figured out a way to solve that for Android, and I could apply it here. But I also didn't care too much about this file since it is already out-of-the-way and not causing trouble. Also also, I would still need the okhttp dependency in the |
||
|
||
dependencies { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
pluginManagement { | ||
plugins { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This method ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't use variable names in Also, I plan to move all of our library versions into this file, as Gradle allows specifying dependencies without a version and having this file choose the version to use. That would be much nicer than figuring out which variable to use. But this also relates to some pinning support I want to use, lock files, and more which I've not had time to integrate and verify that they don't regress our Maven Central pom.xml output. |
||
id "com.github.johnrengelman.shadow" version "2.0.4" | ||
id "com.github.kt3k.coveralls" version "2.0.1" | ||
id "com.google.osdetector" version "1.4.0" | ||
id "com.google.protobuf" version "0.8.8" | ||
id "me.champeau.gradle.japicmp" version "0.2.5" | ||
id "me.champeau.gradle.jmh" version "0.4.5" | ||
id "net.ltgt.errorprone" version "0.8.1" | ||
id "ru.vyarus.animalsniffer" version "1.5.0" | ||
} | ||
} | ||
|
||
rootProject.name = "grpc" | ||
include ":grpc-api" | ||
include ":grpc-core" | ||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
, notorg.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.