-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge hive2 and hive3 support into one branch as Gradle subprojects (#…
…108) * Rename 'serde' subproject (from hive3 branch) to 'hive3' * Rename 'serde' subproject (from hive2 branch) to 'hive2' * Update to Gradle 8.5 * Factor out duplicate code into a common subproject * Refactor build scripts to eliminate duplicate logic * Update copyright header --------- Co-authored-by: Joshua Barr <[email protected]>
- Loading branch information
1 parent
1956ea0
commit f8e9b0c
Showing
168 changed files
with
1,875 additions
and
2,704 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 |
---|---|---|
@@ -1,83 +1,7 @@ | ||
/* | ||
* Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file 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. | ||
*/ | ||
|
||
// sets up kotlin plugin | ||
buildscript { | ||
ext.kotlin_version = '[1.2.0,1.4.10)' | ||
ext.ionjava_version = '[1.4.0,2.0.0)' | ||
ext.pathextraction_version = '[1.2.0,2.0.0)' | ||
ext.hive_version = '[2.3.0,2.4.0)' | ||
ext.hadoop_version = '[2.7.0,2.8.0)' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" | ||
} | ||
} | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
allprojects { | ||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
apply plugin: "kotlin" | ||
|
||
|
||
configurations { | ||
// to make compileOnly available to testing scope | ||
testCompile.extendsFrom(compileOnly) | ||
} | ||
|
||
dependencies { | ||
// using kotlin to make tests less verbose | ||
testCompile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" | ||
testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" | ||
|
||
testCompile "junit:junit:[4.0.0,5.0.0)" | ||
testCompile "pl.pragmatists:JUnitParams:[1.1.0,1.2.0)" | ||
} | ||
|
||
apply plugin: 'checkstyle' | ||
checkstyle { | ||
toolVersion = "8.18" | ||
ignoreFailures = false | ||
maxWarnings = 0 | ||
maxErrors = 0 | ||
configDir = file("$rootProject.projectDir/config/checkstyle") | ||
} | ||
tasks.withType(Checkstyle) { | ||
reports { | ||
xml.enabled = false | ||
html.enabled = true | ||
} | ||
} | ||
} | ||
|
||
// clean all subprojects | ||
task cleanAll { | ||
subprojects.each { | ||
it.afterEvaluate { | ||
def cleanTask = it.tasks.findByName('clean') | ||
if (cleanTask) { | ||
dependsOn(cleanTask) | ||
} | ||
} | ||
} | ||
|
||
dependsOn(clean) | ||
group = "com.amazon.ion" | ||
version = "1.3.0-SNAPSHOT" | ||
} |
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,16 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
repositories { | ||
gradlePluginPortal() | ||
mavenCentral() | ||
} | ||
|
||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") | ||
implementation("com.github.johnrengelman:shadow:8.1.1") | ||
} |
57 changes: 57 additions & 0 deletions
57
buildSrc/src/main/kotlin/ion-hive-serde.conventions.gradle.kts
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 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import org.jetbrains.kotlin.gradle.plugin.extraProperties | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
import java.net.URI | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
plugins { | ||
kotlin("jvm") | ||
id("checkstyle") | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
checkstyle { | ||
toolVersion = "8.18" | ||
// TODO: Fix checkstyle failures | ||
isIgnoreFailures = false | ||
maxWarnings = 0 | ||
maxErrors = 0 | ||
} | ||
|
||
tasks { | ||
|
||
withType<JavaCompile>().all { | ||
// The release option is not available for the Java 8 compiler, but that's okay because we're targeting 8. | ||
if (JavaVersion.current() != JavaVersion.VERSION_1_8) { | ||
options.release.set(8) | ||
} | ||
} | ||
|
||
withType<KotlinCompile>().all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
withType<Test>().all { | ||
useJUnitPlatform() | ||
doLast { | ||
logger.quiet("Test report written to: file://${reports.html.entryPoint}") | ||
} | ||
} | ||
|
||
withType<Checkstyle>().all { | ||
reports { | ||
xml.required.set(false) | ||
html.required.set(true) | ||
} | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
buildSrc/src/main/kotlin/ion-hive-serde.dependencies.gradle.kts
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 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import org.jetbrains.kotlin.gradle.plugin.extraProperties | ||
import java.net.URI | ||
|
||
/* | ||
* This manages all of the dependencies by creating configurations for different groups of dependencies that belong | ||
* together. These groups can be added to the standard configurations (e.g. `testImplementation`) by using the | ||
* `extendFrom(...)` method in the `configurations` block. | ||
*/ | ||
|
||
// Dependencies that get bundled into the fat Jar | ||
val bundled = configurations.create("bundled") | ||
// Dependencies provided by Hive | ||
val hive2Runtime = configurations.create("hive2Runtime") | ||
val hive3Runtime = configurations.create("hive3Runtime") | ||
// Test dependencies | ||
val testFramework = configurations.create("testFramework") | ||
|
||
object Versions { | ||
val hive2_version = "[2.3.0,2.4.0)" | ||
val hive3_version = "[3.1.2,3.1.17)" | ||
val kotlin_version = "1.9.22" | ||
val ionjava_version = "[1.4.0,2.0.0)" | ||
val pathextraction_version = "[1.2.0,2.0.0)" | ||
val hadoop_version = "[2.7.0,2.8.0)" | ||
} | ||
|
||
dependencies { | ||
with(Versions) { | ||
bundled("com.amazon.ion:ion-java:${ionjava_version}") | ||
bundled("com.amazon.ion:ion-java-path-extraction:${pathextraction_version}") { | ||
// ion-java-path-extraction uses Kotlin only for testing | ||
exclude(group = "org.jetbrains.kotlin") | ||
} | ||
|
||
// Provided by the Hive installation | ||
hive2Runtime("org.apache.hive:hive-serde:${hive2_version}") | ||
hive2Runtime("org.apache.hive:hive-exec:${hive2_version}") { isTransitive = false } | ||
hive2Runtime("org.apache.hadoop:hadoop-common:${hadoop_version}") | ||
hive2Runtime("org.apache.hadoop:hadoop-main:${hadoop_version}") | ||
hive2Runtime("org.apache.hadoop:hadoop-mapreduce-client-core:${hadoop_version}") | ||
|
||
// Provided by the Hive installation | ||
hive3Runtime("org.apache.hive:hive-serde:${hive3_version}") | ||
hive3Runtime("org.apache.hive:hive-exec:${hive3_version}") { isTransitive = false } | ||
hive3Runtime("org.apache.hadoop:hadoop-common:${hadoop_version}") | ||
hive3Runtime("org.apache.hadoop:hadoop-main:${hadoop_version}") | ||
hive3Runtime("org.apache.hadoop:hadoop-mapreduce-client-core:${hadoop_version}") | ||
|
||
testFramework("pl.pragmatists:JUnitParams:[1.1.0,1.2.0)") | ||
testFramework("org.junit.jupiter:junit-jupiter:5.7.1") | ||
testFramework("org.junit.vintage:junit-vintage-engine") | ||
testFramework("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version") | ||
} | ||
} |
Oops, something went wrong.