|
| 1 | +/* |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | + * or more contributor license agreements. See the NOTICE file |
| 4 | + * distributed with this work for additional information |
| 5 | + * regarding copyright ownership. The ASF licenses this file |
| 6 | + * to you under the Apache License, Version 2.0 (the |
| 7 | + * License); you may not use this file except in compliance |
| 8 | + * with the License. You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an AS IS BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | + |
| 20 | +plugins { |
| 21 | + id 'java' |
| 22 | + id 'org.apache.beam.module' |
| 23 | + id 'com.gradleup.shadow' |
| 24 | +} |
| 25 | + |
| 26 | +applyJavaNature( |
| 27 | + exportJavadoc: false, |
| 28 | + automaticModuleName: 'org.apache.beam.examples.iceberg', |
| 29 | + // iceberg requires Java11+ |
| 30 | + requireJavaVersion: JavaVersion.VERSION_11 |
| 31 | +) |
| 32 | + |
| 33 | +description = "Apache Beam :: Examples :: Java :: Iceberg" |
| 34 | +ext.summary = """Apache Beam Java SDK examples using IcebergIO.""" |
| 35 | + |
| 36 | +/** Define the list of runners which execute a precommit test. |
| 37 | + * Some runners are run from separate projects, see the preCommit task below |
| 38 | + * for details. |
| 39 | + */ |
| 40 | +def preCommitRunners = ["directRunner", "flinkRunner", "sparkRunner"] |
| 41 | +// The following runners have configuration created but not added to preCommit |
| 42 | +def nonPreCommitRunners = ["dataflowRunner", "prismRunner"] |
| 43 | +for (String runner : preCommitRunners) { |
| 44 | + configurations.create(runner + "PreCommit") |
| 45 | +} |
| 46 | +for (String runner: nonPreCommitRunners) { |
| 47 | + configurations.create(runner + "PreCommit") |
| 48 | +} |
| 49 | +configurations.sparkRunnerPreCommit { |
| 50 | + // Ban certain dependencies to prevent a StackOverflow within Spark |
| 51 | + // because JUL -> SLF4J -> JUL, and similarly JDK14 -> SLF4J -> JDK14 |
| 52 | + exclude group: "org.slf4j", module: "jul-to-slf4j" |
| 53 | + exclude group: "org.slf4j", module: "slf4j-jdk14" |
| 54 | +} |
| 55 | + |
| 56 | +dependencies { |
| 57 | + implementation enforcedPlatform(library.java.google_cloud_platform_libraries_bom) |
| 58 | + runtimeOnly project(":sdks:java:io:iceberg") |
| 59 | + runtimeOnly project(":sdks:java:io:iceberg:bqms") |
| 60 | + implementation project(path: ":sdks:java:core", configuration: "shadow") |
| 61 | + implementation project(":sdks:java:extensions:google-cloud-platform-core") |
| 62 | + implementation project(":sdks:java:io:google-cloud-platform") |
| 63 | + implementation project(":sdks:java:managed") |
| 64 | + implementation library.java.google_auth_library_oauth2_http |
| 65 | + implementation library.java.joda_time |
| 66 | + runtimeOnly project(path: ":runners:direct-java", configuration: "shadow") |
| 67 | + implementation library.java.vendored_guava_32_1_2_jre |
| 68 | + runtimeOnly library.java.hadoop_client |
| 69 | + runtimeOnly library.java.bigdataoss_gcs_connector |
| 70 | + |
| 71 | + // Add dependencies for the PreCommit configurations |
| 72 | + // For each runner a project level dependency on the examples project. |
| 73 | + for (String runner : preCommitRunners) { |
| 74 | + delegate.add(runner + "PreCommit", project(path: ":examples:java", configuration: "testRuntimeMigration")) |
| 75 | + } |
| 76 | + directRunnerPreCommit project(path: ":runners:direct-java", configuration: "shadow") |
| 77 | + flinkRunnerPreCommit project(":runners:flink:${project.ext.latestFlinkVersion}") |
| 78 | + sparkRunnerPreCommit project(":runners:spark:3") |
| 79 | + sparkRunnerPreCommit project(":sdks:java:io:hadoop-file-system") |
| 80 | + dataflowRunnerPreCommit project(":runners:google-cloud-dataflow-java") |
| 81 | + dataflowRunnerPreCommit project(":runners:google-cloud-dataflow-java:worker") // v2 worker |
| 82 | + dataflowRunnerPreCommit project(":sdks:java:harness") // v2 worker |
| 83 | + prismRunnerPreCommit project(":runners:prism:java") |
| 84 | + |
| 85 | + // Add dependency if requested on command line for runner |
| 86 | + if (project.hasProperty("runnerDependency")) { |
| 87 | + runtimeOnly project(path: project.getProperty("runnerDependency")) |
| 88 | + } |
| 89 | +} |
0 commit comments