forked from isuPatches/android-wisefy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
151 lines (120 loc) · 4.9 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
buildscript {
project.ext {
agp_version = '3.4.0'
bintray_version = '1.8.4'
cpd_version = '2.0-SNAPSHOT'
dokka_version = '0.9.18'
dexcount_version = '0.8.5'
jacoco_version = '0.8.3'
kotlin_version = "1.3.31"
maven_version = '2.1'
}
repositories {
jcenter()
google()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath "com.android.tools.build:gradle:$agp_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// Static Analysis
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version"
classpath "de.aaschmid:gradle-cpd-plugin:$cpd_version"
// Code Coverage
classpath "org.jacoco:org.jacoco.core:$jacoco_version"
classpath "org.jacoco:org.jacoco.agent:$jacoco_version"
classpath "org.jacoco:org.jacoco.report:$jacoco_version"
// Publishing
classpath "com.github.dcendents:android-maven-gradle-plugin:$maven_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
}
}
plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC14"
id "org.jlleitschuh.gradle.ktlint" version "7.3.0"
}
apply from: rootProject.file("$rootProject.projectDir/gradle/versions.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/ktlint.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/static-analysis.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/code-coverage.gradle")
subprojects {
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: "org.jlleitschuh.gradle.ktlint"
// Static Analysis
apply from: rootProject.file("$rootProject.projectDir/gradle/detekt.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/cpd.gradle")
apply from: rootProject.file("$rootProject.projectDir/gradle/pmd.gradle")
// Code Coverage
apply from: rootProject.file("$rootProject.projectDir/gradle/jacoco.gradle")
// Publishing
apply from: rootProject.file("$rootProject.projectDir/gradle/dokka.gradle")
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
outputs.upToDateWhen { false }
delete rootProject.buildDir
}
/**
* Improve build server performance by allowing disabling of pre-dexing
* (see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.)
*/
project.ext.preDexLibs = !project.hasProperty('disablePreDex')
subprojects {
project.plugins.whenPluginAdded { plugin ->
if (rootProject.ext.has('preDexLibs')) {
if ("com.android.build.gradle.AppPlugin" == plugin.class.name) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin" == plugin.class.name) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}
}
ext {
travisBuild = System.getenv("TRAVIS") == "true"
// allows for -Dpre-dex=false to be set
preDexEnabled = "true" == System.getProperty("pre-dex", "true")
// Bintray and POM Details
GROUP = "com.isupatches"
BINTRAY_REPO = "Maven"
BINTRAY_NAME = "wisefy"
LIBRARY_DESCRIPTION = "Wrapper around WifiManager and ConfigurationManager for Android"
POM_PACKAGING = "aar"
POM_DESCRIPTION = "wisefy"
POM_URL = "https://github.com/isuPatches/WiseFy"
POM_SCM_URL = "https://github.com/isuPatches/WiseFy"
POM_SCM_ISSUE_URL = 'https://github.com/isuPatches/WiseFy/issues'
POM_SCM_CONNECTION = "scm:git:https://github.com/isuPatches/WiseFy.git"
POM_SCM_DEV_CONNECTION = "scm:git:[email protected]:isuPatches/WiseFy.git"
POM_LICENSE_NAME = "The Apache Software License, Version 2.0"
POM_LICENSE_URL = "http://www.apache.org/licenses/LICENSE-2.0.txt"
POM_LICENSE_DIST = "repo"
ALL_LICENSES = ["Apache-2.0"]
POM_DEVELOPER_ID = "isuPatches"
POM_DEVELOPER_NAME = "Patches Klinefelter"
POM_DEVELOPER_EMAIL = "[email protected]"
// Common build version details
BUILD_TOOLS_VERSION = '28.0.3'
MAX_SDK_VERSION = 28
MIN_SDK_VERSION = 16
VERSION_CODE = 14
VERSION_NAME = "4.0.0"
}
task makeGoodChoices {
group = "verification"
outputs.upToDateWhen { false }
dependsOn 'staticAnalysisSanityCheck', ':wisefy:jacocoDebugUnitTest'
doLast {
println "\n#############################################" +
"\n# All checks passed! You are doing so good! #" +
"\n# You may now push the awesome to origin :) #" +
"\n#############################################"
}
}