forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KUDU-2066. Add experimental Gradle build support
Adds an experimental Gradle build that results in similar tasks and artifacts as the existing maven build. See the readme for usage and common commands. The build is broken out by module with common configurations in the root build.gradle file. Additionally the gradle directory contains “drop in” scripts containing functional pieces of the build configuration to simplify sharing configurations and the unclutter the main build files. Includes support for: - Shaded dependencies that can be used across modules - Running unit tests before integration tests - Reporting available dependency updates - Protobuf and Avro code generation - Publishing to remote and local maven repositories - Cross compiling scala - Code quality checks (checkstyle, findbugs, pmd) Change-Id: Ib257cdd019a1f383c886b9238bb47d96576c4421 Reviewed-on: http://gerrit.cloudera.org:8080/7258 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins
- Loading branch information
1 parent
de8b92e
commit e5202d3
Showing
34 changed files
with
1,453 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// 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 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" | ||
apply from: "$rootDir/gradle/properties.gradle" | ||
apply from: "$rootDir/gradle/dependencies.gradle" | ||
apply from: "$rootDir/gradle/wrapper.gradle" | ||
|
||
subprojects { | ||
// Plugins and scripts are applied in the natural "build order" | ||
// they are used to ensure there are no dependency issues. | ||
// These are common to all subprojects. However, subprojects may | ||
// include their own plugins and scripts as well. | ||
apply plugin: "java" | ||
apply from: "$rootDir/gradle/scopes.gradle" | ||
apply from: "$rootDir/gradle/compile.gradle" | ||
apply from: "$rootDir/gradle/tests.gradle" | ||
apply from: "$rootDir/gradle/quality.gradle" | ||
apply from: "$rootDir/gradle/artifacts.gradle" | ||
apply from: "$rootDir/gradle/publishing.gradle" | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 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 project properties. | ||
# More about how to use the gradle.properties file can be read here: | ||
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties | ||
|
||
group = org.apache.kudu | ||
version = 1.5.0-SNAPSHOT | ||
url = https://kudu.apache.org/ | ||
scmUrl = git://git.apache.org/kudu.git | ||
issueTrackerUrl = https://issues.apache.org/jira/projects/KUDU | ||
|
||
javaSourceCompatibility = 1.7 | ||
encoding = UTF-8 | ||
|
||
# Maximum parallel forks to use while unit testing. | ||
maxParallelForks = 1 | ||
|
||
# Flags to speed up the gradle build. | ||
# https://docs.gradle.org/current/userguide/build_environment.html | ||
org.gradle.daemon=true | ||
# The below configurations are experimental but a nice performance boost. | ||
# org.gradle.caching=true | ||
# org.gradle.configureondemand=true | ||
# org.gradle.parallel=true | ||
# org.gradle.workers.max=4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// 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 common tasks and configuration for artifact generation. | ||
|
||
// Create a configuration so that the test jar can be referenced in other modules. | ||
configurations.create("test") | ||
|
||
task testJar(type: Jar, dependsOn: testClasses, group: "Build") { | ||
description = "Assembles a jar archive containing the test classes." | ||
from sourceSets.test.output | ||
classifier = "tests" | ||
extension "jar" | ||
} | ||
|
||
task sourcesJar(type: Jar, dependsOn: classes, group: "Build") { | ||
description = "Assembles a jar archive containing the main source." | ||
from sourceSets.main.allSource | ||
classifier "sources" | ||
extension "jar" | ||
} | ||
|
||
task testSourcesJar(type: Jar, dependsOn: testJar, group: "Build") { | ||
description = "Assembles a jar archive containing the test source." | ||
from sourceSets.test.allSource | ||
classifier "test-sources" | ||
extension "jar" | ||
} | ||
|
||
task javadocJar(type: Jar, dependsOn: javadoc, group: "Build") { | ||
description = "Assembles a jar archive containing the javadoc." | ||
from javadoc.destinationDir | ||
classifier "javadoc" | ||
extension "jar" | ||
} | ||
|
||
artifacts { | ||
test testJar | ||
archives testJar | ||
archives sourcesJar | ||
archives testSourcesJar | ||
archives javadocJar | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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.1" | ||
classpath "com.netflix.nebula:nebula-clojure-plugin:4.1.0" | ||
classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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 common compiler configurations. | ||
|
||
// Java Configuration | ||
tasks.withType(JavaCompile) { | ||
sourceCompatibility = javaSourceCompatibility | ||
options.encoding = encoding // make sure the encoding is defined by the project and not the system default. | ||
options.incremental = true // enable incremental compilation. | ||
} | ||
|
||
// Scala configuration | ||
tasks.withType(ScalaCompile) { | ||
sourceCompatibility = javaSourceCompatibility | ||
scalaCompileOptions.encoding = encoding // make sure the encoding is defined by the project and not the system default. | ||
scalaCompileOptions.additionalParameters = [ | ||
// Emit warning and location for usages of features that should be imported explicitly. | ||
"-feature", | ||
// Emit various static analysis warnings. | ||
"-Xlint" | ||
] | ||
} |
Oops, something went wrong.