You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2017/10/19 18:30:13 UTC

[2/2] kudu git commit: [java] Convert Gradle to new buildSrc style layout

[java] Convert Gradle to new buildSrc style layout

Currently we use a buildscript.gradle file to add plugins and code
to the build. However, a newer way to do this has been added in
newer Gradle versions and this allows for more flexible and
predictable behavior of the Gradle build plugins and classpath.

See details here:
https://docs.gradle.org/current/userguide/organizing_build_logic.html#sec:build_sources

Change-Id: If23f8178ccff67f3c5ee12f82ac37db9999dfbad
Reviewed-on: http://gerrit.cloudera.org:8080/8332
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/d33075eb
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/d33075eb
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/d33075eb

Branch: refs/heads/master
Commit: d33075ebc798999c9fe6ed546ad8426e97e3ff7f
Parents: edb5ae3
Author: Grant Henke <gr...@gmail.com>
Authored: Thu Oct 19 09:23:16 2017 -0500
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Oct 19 18:29:55 2017 +0000

----------------------------------------------------------------------
 java/build.gradle              |  3 ---
 java/buildSrc/build.gradle     | 38 +++++++++++++++++++++++++++++++++++++
 java/gradle/buildscript.gradle | 38 -------------------------------------
 3 files changed, 38 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/d33075eb/java/build.gradle
----------------------------------------------------------------------
diff --git a/java/build.gradle b/java/build.gradle
index 6bd21fc..51fb517 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -18,9 +18,6 @@
 // This file is the entry-point for the gradle build and contains
 // common logic for the various subprojects in the build.
 
-// Load the buildscript file to apply dependencies needed for the gradle build itself.
-buildscript { apply from: file("gradle/buildscript.gradle"), to: buildscript }
-
 // Plugins and scripts applied at the root level only, instead of per module.
 apply plugin: "idea"
 apply plugin: "eclipse"

http://git-wip-us.apache.org/repos/asf/kudu/blob/d33075eb/java/buildSrc/build.gradle
----------------------------------------------------------------------
diff --git a/java/buildSrc/build.gradle b/java/buildSrc/build.gradle
new file mode 100644
index 0000000..9ab7892
--- /dev/null
+++ b/java/buildSrc/build.gradle
@@ -0,0 +1,38 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, 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.
+
+// This file contains the dependencies required for the gradle build itself.
+
+repositories {
+  mavenCentral()
+  jcenter()
+  maven { url "http://clojars.org/repo" } // Only used for the clojure plugin below.
+  maven { url "http://repo.spring.io/plugins-release" } // Only used for the propdeps plugin below.
+  maven { url "https://plugins.gradle.org/m2/" }
+}
+
+// Manage plugin dependencies since the plugin block can't be used in included build scripts yet.
+// For more details see: https://docs.gradle.org/current/userguide/plugins.html#plugins_dsl_limitations
+dependencies {
+  compile "com.commercehub.gradle.plugin:gradle-avro-plugin:0.9.0"
+  compile "com.github.ben-manes:gradle-versions-plugin:0.15.0"
+  compile "com.github.jengelman.gradle.plugins:shadow:2.0.1"
+  compile "com.google.protobuf:protobuf-gradle-plugin:0.8.2"
+  compile "com.netflix.nebula:nebula-clojure-plugin:4.1.0"
+  compile "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
+  compile "ru.vyarus:gradle-animalsniffer-plugin:1.4.2"
+}

http://git-wip-us.apache.org/repos/asf/kudu/blob/d33075eb/java/gradle/buildscript.gradle
----------------------------------------------------------------------
diff --git a/java/gradle/buildscript.gradle b/java/gradle/buildscript.gradle
deleted file mode 100644
index 89827b3..0000000
--- a/java/gradle/buildscript.gradle
+++ /dev/null
@@ -1,38 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, 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.
-
-// This file contains the dependencies required for the gradle build itself.
-
-repositories {
-  mavenCentral()
-  jcenter()
-  maven { url "http://clojars.org/repo" } // Only used for the clojure plugin below.
-  maven { url "http://repo.spring.io/plugins-release" } // Only used for the propdeps plugin below.
-  maven { url "https://plugins.gradle.org/m2/" }
-}
-
-// Manage plugin dependencies since the plugin block can't be used in included build scripts yet.
-// For more details see: https://docs.gradle.org/current/userguide/plugins.html#plugins_dsl_limitations
-dependencies {
-  classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.9.0"
-  classpath "com.github.ben-manes:gradle-versions-plugin:0.15.0"
-  classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
-  classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.2"
-  classpath "com.netflix.nebula:nebula-clojure-plugin:4.1.0"
-  classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
-  classpath "ru.vyarus:gradle-animalsniffer-plugin:1.4.2"
-}