blob: 3496a9e01874f901fd2a58e0c1c51841c61fcaa3 [file] [log] [blame]
import groovy.json.JsonOutput
/*
* 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' }
applyJavaNature(
testShadowJar: true
)
dependencies {
shadow library.java.grpc_google_cloud_datacatalog_v1beta1
shadow library.java.proto_google_cloud_datacatalog_v1beta1
provided project(path: ":sdks:java:extensions:sql", configuration: "shadow")
// For Data Catalog GRPC client
provided library.java.grpc_all
provided library.java.google_auth_library_oauth2_http
provided library.java.grpc_netty
provided library.java.netty_tcnative_boringssl_static
// Dependencies for the example
provided project(path: ":sdks:java:io:google-cloud-platform", configuration: "shadow")
provided library.java.vendored_guava_20_0
provided library.java.slf4j_api
shadowTestRuntimeClasspath library.java.slf4j_simple
}
task runDataCatalogExample(type: JavaExec) {
description = "Run SQL example of how to use Data Catalog table provider"
main = "org.apache.beam.sdk.extensions.sql.example.BeamSqlDataCatalogExample"
classpath = sourceSets.main.runtimeClasspath
def runner = project.findProperty('runner') ?: 'DirectRunner'
def queryString = project.findProperty('queryString') ?: ''
def outputFilePrefix = project.findProperty('outputFilePrefix') ?: ''
def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing'
def gcsTempRoot = project.findProperty('gcsTempRoot') ?: 'gs://temp-storage-for-end-to-end-tests/'
args = [
"--runner=${runner}",
"--queryString=${queryString}",
"--outputFilePrefix=${outputFilePrefix}",
"--project=${gcpProject}",
"--tempLocation=${gcsTempRoot}",
]
}