forked from apache/beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
177 lines (152 loc) · 6.35 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*
* 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.
*/
// See build_rules.gradle for documentation on default build tasks
// and properties that are enabled in addition to natures
// that can be applied to configure a project for certain common
// tasks.
apply from: project(":").file("build_rules.gradle")
// Define the set of repositories and dependencies required to
// fetch and enable plugins.
buildscript {
repositories {
maven { url offlineRepositoryRoot }
// To run gradle in offline mode, one must first invoke
// 'updateOfflineRepository' to create an offline repo
// inside the root project directory. See the application
// of the offline repo plugin within build_rules.gradle
// for further details.
if (gradle.startParameter.isOffline()) {
return
}
mavenLocal()
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath "net.ltgt.gradle:gradle-apt-plugin:0.13" // Enable a Java annotation processor
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.1" // Enable proto code generation
classpath "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE" // Enable provided and optional configurations
classpath "gradle.plugin.org.nosphere.apache:creadur-rat-gradle:0.3.1" // Enable Apache license enforcement
classpath "com.commercehub.gradle.plugin:gradle-avro-plugin:0.11.0" // Enable Avro code generation
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.6.0" // Enable a code formatting plugin
classpath "gradle.plugin.com.github.blindpirate:gogradle:0.9" // Enable Go code compilation
classpath "gradle.plugin.com.palantir.gradle.docker:gradle-docker:0.13.0" // Enable building Docker containers
classpath "cz.malohlava:visteg:1.0.3" // Enable generating Gradle task dependencies as ".dot" files
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1" // Enable shading Java dependencies
classpath "ca.coglinc:javacc-gradle-plugin:2.4.0" // Enable the JavaCC parser generator
classpath "gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.3" // Enable creating an offline repository
}
}
/*************************************************************************************************/
// Configure the root project
apply plugin: "base"
// Apply one top level rat plugin to perform any required license enforcement analysis
apply plugin: "org.nosphere.apache.rat"
rat {
plainOutput = true
xmlOutput = false
htmlOutput = false
failOnError = true
excludes = [
// Ignore any offline repositories the user may have created.
"**/${offlineRepositoryRoot}/**/*",
// Exclude files generated by the Gradle build process
"**/.gradle/**/*",
"**/.gogradle/**/*",
"**/gogradle.lock",
"**/build/**/*",
"**/vendor/**/*",
"**/.gradletasknamecache",
// .gitignore: Ignore files generated by the Maven build process
"**/target/**/*",
"**/bin/**/*",
"**/dependency-reduced-pom.xml",
// .gitignore: Ignore files generated by the Python build process
"**/*.pyc",
"**/*.pyo",
"**/*.pyd",
"**/*.egg-info/**/*",
"**/.eggs/**/*",
"**/nose-*.egg/**/*",
"**/.tox/**/*",
"**/dist/**/*",
"**/distribute-*/**/*",
"**/env/**/*",
"sdks/python/**/*.c",
"sdks/python/**/*.so",
"sdks/python/**/*.egg",
"sdks/python/LICENSE",
"sdks/python/NOTICE",
"sdks/python/README.md",
"sdks/python/apache_beam/portability/api/*pb2*.*",
// .gitignore: Ignore IntelliJ files.
"**/.idea/**/*",
"**/*.iml",
"**/*.ipr",
"**/*.iws",
"**/out/**/*",
// .gitignore: Ignore Eclipse files.
"**/.classpath",
"**/.project",
"**/.factorypath",
"**/.checkstyle",
"**/.fbExcludeFilterFile",
"**/.apt_generated/**/*",
"**/.settings/**/*",
// .gitignore: Ignore Visual Studio Code files.
"**/.vscode/**/*",
// .gitignore: Hotspot VM leaves this log in a non-target directory when java crashes
"**/hs_err_pid*.log",
// .gitignore: Ignore files that end with "~", since they
// are most likely auto-save files produced by a text editor.
"**/*~",
// .gitignore: Ignore MacOSX files.
"**/.DS_Store/**/*",
// Ignore files we track but do not distribute
".github/**/*",
"**/package-list",
"**/user.avsc",
"**/test/resources/**/*.txt",
"**/test/**/.placeholder",
// Default eclipse excludes neglect subprojects
// Proto/grpc generated wrappers
"**/apache_beam/portability/api/*_pb2*.py",
"**/go/pkg/beam/**/*.pb.go",
// Ignore Go test data files
"**/go/data/**",
// VCF test files
"**/apache_beam/testing/data/vcf/*",
]
}
check.dependsOn rat
// Define root PreCommit tasks simplifying what is needed
// to be specified on the commandline when executing locally.
// This indirection also makes Jenkins use the branch of the PR
// for the test definitions.
task javaPreCommit() {
dependsOn ":rat"
dependsOn ":sdks:java:core:buildNeeded"
dependsOn ":sdks:java:core:buildDependents"
dependsOn ":examples:java:preCommit"
}
task goPreCommit() {
dependsOn ":rat"
dependsOn ":sdks:go:test"
}