forked from GoogleCloudPlatform/dlp-rdb-bq-import
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
147 lines (109 loc) · 3.92 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* Copyright 2018 Google LLC
Licensed 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.
*/
buildscript {
ext {
dataflowBeamVersion = '2.16.0'
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.19"
classpath "gradle.plugin.com.google.cloud.tools:jib-gradle-plugin:1.4.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.24.2"
}
}
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "net.ltgt.apt"
apply plugin: 'com.google.cloud.tools.jib'
apply plugin: "com.diffplug.gradle.spotless"
//mainClassName = System.getProperty("mainClass")
mainClassName = 'com.google.swarm.sqlserver.migration.BQReidentificationPipeline'
jib {
from {
image = 'gcr.io/dataflow-templates-base/java8-template-launcher-base:latest'
}
container {
appRoot = '/template/dlp-migration-template'
entrypoint = 'INHERIT'
environment = [DATAFLOW_JAVA_COMMAND_SPEC:'/template/dlp-migration-template/resources/java_command_spec.json']
}
}
group 'com.google.swarm'
version '0.1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
applicationDefaultJvmArgs = ['-Xms4g', '-Xmx16g']
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.apache.beam', name: 'beam-sdks-java-core', version: dataflowBeamVersion
compile group: 'org.apache.beam', name: 'beam-runners-google-cloud-dataflow-java', version: dataflowBeamVersion
compile group: 'org.apache.beam', name: 'beam-runners-direct-java', version: dataflowBeamVersion
compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.5'
compile group: 'org.apache.beam', name: 'beam-sdks-java-io-jdbc', version: dataflowBeamVersion
compile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.0.0.jre8'
compile "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
compile 'com.google.cloud:google-cloud-storage:1.55.0'
compile group: 'com.google.cloud', name: 'google-cloud-dlp', version: '0.100.0-beta'
compile 'net.sourceforge.jtds:jtds:1.3.1'
compile group: 'org.json', name: 'json', version: '20180813'
compile('com.google.guava:guava:21.0'){
force = true
}
compile ('com.google.api-client:google-api-client:1.23.0') {
force = true
}
testCompile group: 'org.apache.beam', name: 'beam-runners-direct-java', version: dataflowBeamVersion
testCompile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.5'
testCompile 'junit:junit:4.12'
testCompile group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '7.0.0.jre8'
}
jar {
manifest {
attributes ('Main-Class': mainClassName)
}
}
compileJava {
// Add additional jvm argument
options.compilerArgs.addAll(['-Xlint:all'])
}
// default tasks when you run ./gradlew
defaultTasks 'clean', 'assemble'
// Google cloud dataflow requires the resource/main directory to exist
task resources {
def resourcesDir = new File('build/resources/main')
resourcesDir.mkdirs()
}
spotless {
java {
googleJavaFormat()
}
}
run {
if (project.hasProperty('args')) {
args project.args.split('\\s')
}
}
run.mustRunAfter 'resources'