Skip to content

Commit

Permalink
open-api: Build runtime jar for test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
ajantha-bhat committed Nov 5, 2024
1 parent 469c556 commit 0aa01f9
Show file tree
Hide file tree
Showing 4 changed files with 807 additions and 3 deletions.
28 changes: 25 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,9 @@ project(':iceberg-snowflake') {

project(':iceberg-open-api') {
apply plugin: 'java-test-fixtures'
apply plugin: 'com.gradleup.shadow'

build.dependsOn shadowJar

dependencies {
testImplementation project(':iceberg-api')
Expand All @@ -967,11 +970,9 @@ project(':iceberg-open-api') {
testFixturesImplementation project(':iceberg-gcp')
testFixturesImplementation project(':iceberg-azure')
testFixturesImplementation(libs.hadoop3.common) {
exclude group: 'log4j'
exclude group: 'org.slf4j'
exclude group: 'ch.qos.reload4j'
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'com.fasterxml.woodstox'
exclude group: 'com.google.guava'
exclude group: 'com.google.protobuf'
exclude group: 'org.apache.curator'
Expand All @@ -980,7 +981,6 @@ project(':iceberg-open-api') {
exclude group: 'org.apache.hadoop', module: 'hadoop-auth'
exclude group: 'org.apache.commons', module: 'commons-configuration2'
exclude group: 'org.apache.hadoop.thirdparty', module: 'hadoop-shaded-protobuf_3_7'
exclude group: 'org.codehaus.woodstox'
exclude group: 'org.eclipse.jetty'
}
testFixturesImplementation project(path: ':iceberg-bundled-guava', configuration: 'shadow')
Expand Down Expand Up @@ -1014,6 +1014,28 @@ project(':iceberg-open-api') {
recommend.set(true)
}
check.dependsOn('validateRESTCatalogSpec')

shadowJar {
archiveBaseName.set("iceberg-open-api-test-fixtures-runtime")
archiveClassifier.set(null)
configurations = [project.configurations.testFixturesRuntimeClasspath]
from sourceSets.testFixtures.output
zip64 true

// include the LICENSE and NOTICE files for the runtime Jar
from(projectDir) {
include 'LICENSE'
include 'NOTICE'
}

manifest {
attributes 'Main-Class': 'org.apache.iceberg.rest.RESTCatalogServer'
}
}

jar {
enabled = false
}
}

@Memoized
Expand Down
1 change: 1 addition & 0 deletions deploy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ subprojects {
} else if (isOpenApi) {
artifact testJar
artifact testFixturesJar
artifact shadowJar
} else {
if (tasks.matching({task -> task.name == 'shadowJar'}).isEmpty()) {
from components.java
Expand Down
Loading

0 comments on commit 0aa01f9

Please sign in to comment.