forked from eclipse-keyple/keyple-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
160 lines (136 loc) · 4.81 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
buildscript {
repositories {
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()
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.14.0"
}
}
ext {
timestamp = new Date().format('yyyyMMdd')
}
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()
}
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 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 installRemotesePlugin{
group 'keyple'
description 'Builds and installs the keyple remotese plugin into maven local repository'
dependsOn installCore
dependsOn ':java:component:keyple-plugin:keyple-plugin-remotese:installPlugin'
}
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 installRemotesePlugin
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
}
}
spotless {
java {
target "java/**/*.java"
licenseHeaderFile '.build/spotless.license.txt'
importOrder 'java', 'javax', 'org', 'com', 'com.diffplug', ''
removeUnusedImports()
eclipse().configFile '.build/spotless.eclipseformat.xml'
}
format 'misc', {
target 'java/**/*.java', 'java/**/*.gradle', 'java/**/*.yml', 'java/**/*.md'
indentWithSpaces()
endWithNewline()
}
}