This repository has been archived by the owner on Jun 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
123 lines (101 loc) · 3.91 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
}
plugins {
id "com.diffplug.gradle.spotless" version "3.14.0"
}
allprojects {
group 'org.eclipse.keyple'
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
repositories {
mavenLocal()
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
}
}
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()
}
}
//create task to agregate javadoc
task aggregatedJavadocs(type: Javadoc, description: 'Generate javadocs from all child projects as if it was a single project', group: 'Documentation') {
//println 'Create a aggregated javadoc Task to : ' + "$buildDir/docs/javadoc"
destinationDir = file("$buildDir/docs/javadoc")
title = "$project.name " + project(":java:component:keyple-core").version + " version API"
options.author true
options.links 'http://docs.oracle.com/javase/6/docs/api/',
"http://d.android.com/reference/",
'http://seek-for-android.github.io/javadoc/V4.0.0/'
options.addStringOption 'Xdoclint:none', '-quiet'
//init source to whatever file to avoid NO-SOURCE
source = 'README.MD'
}
//dynamically configure the source
aggregatedJavadocs.doFirst {
//println "DoFirst in task : aggregatedJavadocs"
//add Java modules javadoc
def aggregatedJavaProjects = [project(":java:component:keyple-core"),
project(":java:component:keyple-calypso"),
project(":java:component:keyple-plugin:keyple-plugin-pcsc"),
project(":java:component:keyple-plugin:keyple-plugin-stub"),
project(":java:component:keyple-plugin:keyple-plugin-remotese")]
aggregatedJavaProjects.each { aggregatedJavaProject ->
source += aggregatedJavaProject.javadoc.source
classpath += aggregatedJavaProject.javadoc.classpath
excludes += aggregatedJavaProject.javadoc.excludes
includes += aggregatedJavaProject.javadoc.includes
}
}