blob: 5ba415aee74f3994453b2a178614e363a68a5ced [file] [log] [blame]
/*
* 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.
*/
plugins { id 'org.apache.beam.module' }
archivesBaseName = 'beam-runners-google-cloud-dataflow-java-fn-api-worker'
// Set a specific version of 'com.google.apis:google-api-services-dataflow'
// by adding -Pdataflow.version=<version> in Gradle command. Otherwise,
// 'google_clients_version' defined in BeamModulePlugin will be used as default.
def DATAFLOW_VERSION = "dataflow.version"
// Get full dependency of 'com.google.apis:google-api-services-dataflow'
def google_api_services_dataflow = project.hasProperty(DATAFLOW_VERSION) ? "com.google.apis:google-api-services-dataflow:" + getProperty(DATAFLOW_VERSION) : library.java.google_api_services_dataflow
applyJavaNature(
publish: false,
exportJavadoc: false,
enableSpotbugs: true,
validateShadowJar: false,
shadowClosure: {
// In the case of the Fn API worker jar we are creating an application so we rely on
// the shadow plugin to include all transitive dependencies to create an uber jar.
// Include original source files extracted under
// '$buildDir/original_sources_to_package' to jar
from "$buildDir/original_sources_to_package"
exclude "META-INF/LICENSE.txt"
exclude "about.html"
},
)
/******************************************************************************/
// Configure the worker root project
configurations {
sourceFile
// Ban these dependencies from all configurations
all {
// Ban the usage of AppleJavaExtensions in spotbugs.
exclude group: "com.apple", module: "AppleJavaExtensions"
}
}
dependencies {
// Note that any dependency that is modified here should also be modified within
// runners/google-cloud-dataflow-java/worker/legacy-worker/build.gradle using the rules provided
// there.
//
// All main sourceset dependencies here should be listed as compile scope so that the dependencies
// are all packaged into a single uber jar allowing the jar to serve as an application.
compile project(path: ":runners:google-cloud-dataflow-java", configuration: "shadow")
compile project(path: ":sdks:java:core", configuration: "shadow")
compile project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "shadow")
compile project(path: ":sdks:java:io:google-cloud-platform", configuration: "shadow")
compile project(path: ":model:fn-execution", configuration: "shadow")
compile project(path: ":model:pipeline", configuration: "shadow")
compile project(path: ":runners:core-construction-java", configuration: "shadow")
compile project(path: ":runners:core-java", configuration: "shadow")
compile project(path: ":runners:java-fn-execution", configuration: "shadow")
compile project(path: ":sdks:java:fn-execution", configuration: "shadow")
compile project(path: ":runners:google-cloud-dataflow-java:worker:windmill", configuration: "shadow")
compile library.java.vendored_grpc_1_13_1
compile google_api_services_dataflow
compile library.java.avro
compile library.java.google_api_client
compile library.java.google_http_client
compile library.java.google_http_client_jackson
compile library.java.jackson_annotations
compile library.java.jackson_core
compile library.java.jackson_databind
compile library.java.joda_time
shadow library.java.vendored_guava_20_0
compile library.java.slf4j_api
compile "javax.servlet:javax.servlet-api:3.1.0"
compile "org.conscrypt:conscrypt-openjdk:1.1.3:linux-x86_64"
compile "org.eclipse.jetty:jetty-server:9.2.10.v20150310"
compile "org.eclipse.jetty:jetty-servlet:9.2.10.v20150310"
compile library.java.error_prone_annotations
compile library.java.slf4j_jdk14
// All test sourceset dependencies can be marked as shadowTest since we create an uber jar without
// relocating any code.
shadowTest project(path: ":runners:core-java", configuration: "shadowTest")
shadowTest project(path: ":sdks:java:harness", configuration: "shadowTest")
shadowTest project(path: ":sdks:java:core", configuration: "shadowTest")
shadowTest project(path: ":sdks:java:extensions:google-cloud-platform-core", configuration: "shadowTest")
shadowTest project(path: ":runners:direct-java", configuration: "shadow")
shadowTest library.java.guava_testlib
shadowTest library.java.hamcrest_core
shadowTest library.java.hamcrest_library
shadowTest library.java.junit
shadowTest library.java.mockito_core
}
//TODO(BEAM-5657): checktyle task should be enabled in the future.
checkstyleMain.enabled = false
checkstyleTest.enabled = false
//TODO(BEAM-5659): javadoc task should be enabled in the future.
javadoc.enabled = false