forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
97 lines (80 loc) · 3.67 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
* 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(
publish: false,
archivesBaseName: 'beam-sdks-java-watermark-latency',
exportJavadoc: false
)
description = "Apache Beam :: SDKs :: Java :: Watermark Latency Benchmark"
def mainClassProperty = "loadTest.mainClass"
def mainClass = project.findProperty(mainClassProperty)
// When running via Gradle, this property can be used to pass commandline arguments
// to the load-tests launch
def loadTestArgsProperty = "loadTest.args"
// When running via Gradle, this property sets the runner dependency
def runnerProperty = "runner"
def runnerDependency = (project.hasProperty(runnerProperty)
? project.getProperty(runnerProperty)
: ":runners:direct-java")
def isDataflowRunner = ":runners:google-cloud-dataflow-java".equals(runnerDependency)
def runnerConfiguration = ":runners:direct-java".equals(runnerDependency) ? "shadow" : null
if (isDataflowRunner) {
/*
* We need to rely on manually specifying these evaluationDependsOn to ensure that
* the following projects are evaluated before we evaluate this project. This is because
* we are attempting to reference a property from the project directly.
*/
evaluationDependsOn(":runners:google-cloud-dataflow-java:worker")
}
configurations {
// A configuration for running the Load testlauncher directly from Gradle, which
// uses Gradle to put the appropriate dependencies on the Classpath rather than
// bundling them into a fat jar
gradleRun
}
dependencies {
implementation library.java.joda_time
runtimeOnly library.java.kafka_clients
implementation library.java.slf4j_api
implementation project(path: ":sdks:java:core", configuration: "shadow")
runtimeOnly project(path: ":runners:direct-java", configuration: "shadow")
runtimeOnly project(":sdks:java:io:synthetic")
runtimeOnly project(":sdks:java:testing:test-utils")
runtimeOnly project(":sdks:java:io:google-cloud-platform")
runtimeOnly project(":sdks:java:io:kafka")
runtimeOnly project(":sdks:java:io:kinesis")
gradleRun project(project.path)
gradleRun project(path: runnerDependency, configuration: runnerConfiguration)
}
task run(type: JavaExec) {
def loadTestArgs = project.findProperty(loadTestArgsProperty) ?: ""
if (isDataflowRunner) {
dependsOn ":runners:google-cloud-dataflow-java:worker:shadowJar"
def dataflowWorkerJar = project.findProperty('dataflowWorkerJar') ?: project(":runners:google-cloud-dataflow-java:worker").shadowJar.archivePath
// Provide job with a customizable worker jar.
// With legacy worker jar, containerImage is set to empty (i.e. to use the internal build).
// More context and discussions can be found in PR#6694.
loadTestArgs = loadTestArgs +
" --dataflowWorkerJar=${dataflowWorkerJar} " +
" --workerHarnessContainerImage="
}
mainClass = mainClass
classpath = configurations.gradleRun
args loadTestArgs.split()
}