-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
180 lines (156 loc) · 4.1 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
178
179
180
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.library'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
group = 'mu.lab'
version = '1.0.0'
checkstyle {
toolVersion '6.7'
}
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
task checkstyleMain(type: Checkstyle) {
configFile file('./config/google_checks.xml')
source 'src'
include '**/*.java'
classpath=files()
}
task checkstyleHtml << {
if(file("$buildDir/reports/checkstyle/main.xml").exists()) {
ant.xslt(in: "$buildDir/reports/checkstyle/main.xml",
style: "./config/checkstyle-noframes-severity-sorted.xsl",
out: "$buildDir/reports/checkstyle/main.html")
}
}
checkstyleMain.finalizedBy checkstyleHtml
task findbugsMain(type: FindBugs) {
classes = fileTree("$buildDir/intermediates/classes/debug")
source = fileTree("src")
classpath = files()
effort = "max"
reports {
xml.enabled = false
html.enabled = true
}
ignoreFailures = false
excludeFilter = file("${project.projectDir}/config/findbugs-excludeFilter.xml")
}
findbugsMain.dependsOn "compileDebugSources"
task pmdMain(type: Pmd) {
source fileTree('src')
ruleSets = [
'java-android',
'java-basic',
'java-braces',
'java-clone',
'java-codesize',
// 'java-comments',
// 'java-coupling',
'java-design',
'java-empty',
'java-finalizers',
'java-imports',
'java-j2ee',
'java-javabeans',
'java-junit',
'java-logging-jakarta-commons',
'java-logging-java',
'java-migrating',
// 'java-naming',
// 'java-optimizations',
'java-strictexception',
'java-strings',
'java-sunsecure',
'java-typeresolution',
'java-unnecessary',
'java-unusedcode'
]
reports {
xml.enabled = false
html.enabled = true
}
ignoreFailures = true
}
def gitUrl = 'https://github.com/mulab/android-log.git'
def siteUrl = 'https://github.com/mulab/android-log'
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
pkg {
repo = 'mulab'
name = 'android-log'
userOrg = 'mulab'
licenses = ['MIT']
vcsUrl = gitUrl
websiteUrl = siteUrl
publish = true
}
}
install {
repositories.mavenInstaller {
pom {
project {
packaging 'arr'
name 'Android Log Wrapper'
url siteUrl
licenses {
license {
name 'MIT'
url 'http://opensource.org/licenses/MIT'
}
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives javadocJar
archives sourcesJar
}