github.com/apache/beam/sdks/v2@v2.48.2/java/extensions/google-cloud-platform-core/build.gradle (about) 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 import groovy.json.JsonOutput 20 21 plugins { id 'org.apache.beam.module' } 22 applyJavaNature( 23 automaticModuleName: 'org.apache.beam.sdk.extensions.gcp') 24 25 description = "Apache Beam :: SDKs :: Java :: Extensions :: Google Cloud Platform Core" 26 ext.summary = """Common components used to support multiple 27 Google Cloud Platform specific maven modules.""" 28 29 // Exclude tests that need a runner 30 test { 31 systemProperty "beamUseDummyRunner", "true" 32 useJUnit { 33 excludeCategories "org.apache.beam.sdk.testing.NeedsRunner" 34 } 35 } 36 37 dependencies { 38 implementation enforcedPlatform(library.java.google_cloud_platform_libraries_bom) 39 implementation library.java.vendored_guava_26_0_jre 40 implementation project(path: ":sdks:java:core", configuration: "shadow") 41 implementation project(path: ":runners:core-java") 42 implementation library.java.google_http_client_jackson2 43 implementation library.java.google_auth_library_oauth2_http 44 implementation library.java.google_api_client 45 implementation library.java.bigdataoss_gcsio 46 implementation library.java.bigdataoss_util 47 implementation library.java.google_api_services_cloudresourcemanager 48 implementation library.java.google_api_services_storage 49 implementation library.java.google_auth_library_credentials 50 implementation library.java.google_http_client 51 implementation library.java.slf4j_api 52 implementation library.java.joda_time 53 implementation library.java.http_core 54 implementation library.java.http_client 55 implementation library.java.jackson_annotations 56 implementation library.java.jackson_databind 57 permitUnusedDeclared library.java.jackson_databind // BEAM-11761 58 testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") 59 testImplementation library.java.mockito_core 60 testRuntimeOnly library.java.slf4j_jdk14 61 } 62 63 // Note that no runner is specified here, so tests running under this task should not be running 64 // pipelines. 65 task integrationTestKms(type: Test) { 66 group = "Verification" 67 def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing' 68 def gcpTempRoot = project.findProperty('gcpTempRootKms') ?: 'gs://temp-storage-for-end-to-end-tests-cmek' 69 def dataflowKmsKey = project.findProperty('dataflowKmsKey') ?: "projects/apache-beam-testing/locations/global/keyRings/beam-it/cryptoKeys/test" 70 systemProperty "beamTestPipelineOptions", JsonOutput.toJson([ 71 "--project=${gcpProject}", 72 "--tempRoot=${gcpTempRoot}", 73 "--dataflowKmsKey=${dataflowKmsKey}", 74 ]) 75 76 // Disable Gradle cache: these ITs interact with live service that should always be considered "out of date" 77 outputs.upToDateWhen { false } 78 79 include '**/*IT.class' 80 maxParallelForks 4 81 classpath = sourceSets.test.runtimeClasspath 82 testClassesDirs = sourceSets.test.output.classesDirs 83 useJUnit { 84 includeCategories "org.apache.beam.sdk.testing.UsesKms" 85 } 86 } 87 88 task postCommit { 89 group = "Verification" 90 description = "Integration tests of GCP connectors using the DirectRunner." 91 dependsOn integrationTestKms 92 }