-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
138 lines (122 loc) · 3.53 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
/*
* Copyright 2021-2023 Cyface GmbH
*
* This file is part of the Cyface Protobuf Messages.
*
* The Cyface Protobuf Messages is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* The Cyface Protobuf Messages is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Cyface Protobuf Messages. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* The root build gradle file.
*
* @author Armin Schnabel
* @version 1.0.2
* @since 1.0.0
*/
buildscript {
repositories {
mavenCentral()
}
}
plugins {
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven-publish'
//noinspection SpellCheckingInspection
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.google.protobuf' version '0.9.2'
}
group = 'de.cyface'
version = rootProject.file('VERSION').text.trim()
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
ext {
commonsLangVersion = '3.12.0'
gradleWrapperVersion = '7.6.1'
protobufVersion = '3.22.2'
// Versions of testing dependencies
junitVersion = '5.9.2'
mockitoVersion = '5.2.0'
hamcrestVersion = '2.2'
}
wrapper {
gradleVersion = "$gradleWrapperVersion"
}
repositories {
mavenCentral()
}
// Code Quality Checker
dependencies {
// Generate java files from the Protobuf files
implementation "com.google.protobuf:protobuf-java:$protobufVersion"
// Utility
implementation "org.apache.commons:commons-lang3:$commonsLangVersion" // Using Validate
// Testing Dependencies
testImplementation(platform("org.junit:junit-bom:$junitVersion"))
testImplementation "org.junit.jupiter:junit-jupiter-api"
//testImplementation "org.junit.jupiter:junit-jupiter-params" // Required for parameterized tests
testImplementation "org.hamcrest:hamcrest:$hamcrestVersion"
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation "org.mockito:mockito-junit-jupiter:$mockitoVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
// See https://github.com/google/protobuf-gradle-plugin
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
generateProtoTasks {
//noinspection GroovyAssignabilityCheck
all().each { task ->
task.builtins {
java {}
}
}
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
// Definitions for the maven-publish Plugin
publishing {
// The following repositories are used to publish artifacts to.
repositories {
maven {
name = 'github'
url = uri("https://maven.pkg.github.com/cyface-de/protos")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("PASSWORD")
}
}
maven {
name = 'local'
url = "file://${rootProject.buildDir}/repo"
}
}
publications {
//noinspection GroovyAssignabilityCheck
publishExecutable(MavenPublication) {
//noinspection GroovyAssignabilityCheck
from components.java
}
}
}
shadowJar {}