This repository was archived by the owner on Sep 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.gradle
More file actions
219 lines (192 loc) · 7.41 KB
/
build.gradle
File metadata and controls
219 lines (192 loc) · 7.41 KB
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'maven'
buildscript {
repositories {
mavenLocal()
jcenter()
//use a mirror of maven_central to speed up CI build
maven {
url 'https://repo.eclipse.org/service/local/repositories/maven_central/content'
}
mavenCentral()
maven {url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.14.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.31"
classpath 'org.eclipse.keyple:keyple-gradle:0.1.0'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2"
classpath "org.jacoco:org.jacoco.core:0.8.5"
classpath "org.jacoco:org.jacoco.agent:0.8.5"
}
}
apply plugin: "com.diffplug.gradle.spotless"
allprojects {
group 'org.eclipse.keyple'
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
repositories {
mavenLocal()
maven {
url 'https://repo.eclipse.org/service/local/repositories/maven_central/content'
}
//to import keyple snapshots
maven {url 'https://oss.sonatype.org/content/repositories/snapshots' }
//to import keyple releases
maven { url 'https://oss.sonatype.org/content/repositories/releases' }
//mavenCentral()
google()
jcenter()
}
dependencies {
}
apply plugin: 'pmd'
pmd {
ruleSets = [
"java-basic",
"java-braces",
"java-strings",
"java-imports",
"java-unnecessary",
"java-unusedcode",
// "java-metrics",
"java-empty",
"java-codesize",
"java-clone",
"java-typeresolution",
"java-strictexception",
"java-finalizers",
"java-migrating",
"java-logging-java",
// "java-controversial",
"java-sunsecure",
"java-junit",
"java-optimizations",
// "java-naming",
"java-coupling",
"java-design",
"java-comments"
]
// PMD priorities levels:
// 1. Change absolutely required. Behavior is critically broken/buggy.
// 2. Change highly recommended. Behavior is quite likely to be broken/buggy.
// 3. Change recommended. Behavior is confusing, perhaps buggy, and/or against standards/best practices.
// 4. Change optional. Behavior is not likely to be buggy, but more just flies in the face of standards/style/good taste.
// 5. Change highly optional. Nice to have, such as a consistent naming policy for package/class/fields…
rulePriority = 1
}
}
task setVersion {
dependsOn ':java:component:keyple-core:setVersion'
dependsOn ':java:component:keyple-calypso:setVersion'
dependsOn ':java:component:keyple-plugin:keyple-plugin-pcsc:setVersion'
dependsOn ':java:component:keyple-distributed:keyple-distributed-network:setVersion'
dependsOn ':java:component:keyple-distributed:keyple-distributed-local:setVersion'
dependsOn ':java:component:keyple-distributed:keyple-distributed-remote:setVersion'
dependsOn ':java:component:keyple-plugin:keyple-plugin-stub:setVersion'
doLast {
new File("$projectDir", "VERSION").text = version
}
}
task installCore{
group 'keyple'
description 'Builds and installs the keyple core library into maven local repository'
dependsOn ':java:component:keyple-core:installCore'
}
task installCalypsoExtension{
group 'keyple'
description 'Builds and installs the keyple calypso extension library into maven local repository'
dependsOn installCore
dependsOn ':java:component:keyple-calypso:installExtension'
}
task installPcscPlugin{
group 'keyple'
description 'Builds and installs the keyple pcsc plugin into maven local repository'
dependsOn installCore
dependsOn ':java:component:keyple-plugin:keyple-plugin-pcsc:installPlugin'
}
task installDistributedNetwork{
group 'keyple'
description 'Builds and installs the Keyple Distributed Network into maven local repository'
dependsOn installCore
dependsOn ':java:component:keyple-distributed:keyple-distributed-network:installModule'
}
task installDistributedLocal{
group 'keyple'
description 'Builds and installs the Keyple Distributed Local into maven local repository'
dependsOn installDistributedNetwork
dependsOn ':java:component:keyple-distributed:keyple-distributed-local:installModule'
}
task installDistributedRemote{
group 'keyple'
description 'Builds and installs the Keyple Distributed Remote into maven local repository'
dependsOn installDistributedNetwork
dependsOn ':java:component:keyple-distributed:keyple-distributed-remote:installModule'
}
task installStubPlugin{
group 'keyple'
description 'Builds and installs the keyple stub plugin into maven local repository'
dependsOn installCore
dependsOn ':java:component:keyple-plugin:keyple-plugin-stub:installPlugin'
}
task installAll {
group 'keyple'
description 'Builds and installs all java Keyple library into maven local repository'
dependsOn installCore
dependsOn installCalypsoExtension
dependsOn installDistributedNetwork
dependsOn installDistributedLocal
dependsOn installDistributedRemote
dependsOn installStubPlugin
dependsOn installPcscPlugin
doLast {
println 'Keyple artifacts have been installed into maven local repo at path: ' + project.getRepositories().get(0).getAt("url")
}
}
task removeAll(type: Delete){
group 'keyple'
def path = new URL(project.getRepositories().get(0).getAt("url").toString() + "org/eclipse/keyple");
description 'Removes all keyple artifacts deployed in maven local repo at path: ' + path
delete path
doLast {
println description
}
}
task codeQuality {
group 'keyple'
description 'Analyse code and send results to Sonar'
dependsOn installCore
dependsOn ':java:component:keyple-core:sonarqube'
dependsOn installCalypsoExtension
dependsOn ':java:component:keyple-calypso:sonarqube'
dependsOn installDistributedNetwork
dependsOn ':java:component:keyple-distributed:keyple-distributed-network:sonarqube'
dependsOn installDistributedLocal
dependsOn ':java:component:keyple-distributed:keyple-distributed-local:sonarqube'
dependsOn installDistributedRemote
dependsOn ':java:component:keyple-distributed:keyple-distributed-remote:sonarqube'
dependsOn installStubPlugin
dependsOn ':java:component:keyple-plugin:keyple-plugin-stub:sonarqube'
dependsOn installPcscPlugin
dependsOn ':java:component:keyple-plugin:keyple-plugin-pcsc:sonarqube'
doLast {
println 'Keyple code has been analysed and result was sent to SonarQube.'
}
}
spotless {
java {
target "java/**/*.java"
licenseHeaderFile '.build/spotless.license.txt'
importOrder 'java', 'javax', 'org', 'com', 'com.diffplug', ''
removeUnusedImports()
googleJavaFormat()
}
format 'misc', {
target 'java/**/*.java', 'java/**/*.gradle', 'java/**/*.yml', 'java/**/*.md'
indentWithSpaces()
endWithNewline()
}
}