1616 * along with this program. If not, see <http://www.gnu.org/licenses/>
1717 */
1818
19- apply plugin : ' com.android.application'
20- apply plugin : ' jacoco-android'
19+ apply plugin : " com.android.application"
20+ apply plugin : " jacoco-android"
21+
22+ ext {
23+ supportVersion = " 28.0.0"
24+ lang3Version = " 3.8.1"
25+ collections4Version = " 4.2"
26+ graphviewVersion = " 4.2.2"
27+ powermockVersion = " 1.7.4"
28+ robolectricVersion = " 4.0"
29+ junitVersion = " 4.12"
30+ junitToolboxVersion = " 2.4"
31+ shadowsVersion = " 3.4-rc2"
32+ espressoVersion = " 3.0.2"
33+ testVersion = " 1.0.2"
34+ }
2135
2236android {
2337 compileSdkVersion 28
24- buildToolsVersion ' 28.0.3'
38+ buildToolsVersion " 28.0.3"
2539
2640 defaultConfig {
2741 applicationId " com.vrem.wifianalyzer"
2842 minSdkVersion 16
2943 targetSdkVersion 28
3044 versionCode
3145 versionName
32- testInstrumentationRunner ' android.support.test.runner.AndroidJUnitRunner'
46+ testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
3347 }
3448
3549 buildTypes {
3650 release {
3751 minifyEnabled true
3852 shrinkResources true
39- proguardFiles getDefaultProguardFile(' proguard-android.txt' )
53+ proguardFiles getDefaultProguardFile(" proguard-android.txt" )
4054 signingConfig
4155 }
4256 debug {
@@ -63,84 +77,90 @@ android {
6377 }
6478
6579 lintOptions {
66- disable ' GoogleAppIndexingWarning'
80+ disable " GoogleAppIndexingWarning"
81+ }
82+
83+ compileOptions {
84+ sourceCompatibility JavaVersion . VERSION_1_8
85+ targetCompatibility JavaVersion . VERSION_1_8
6786 }
6887}
6988
7089jacoco {
71- toolVersion = ' 0.8.2'
90+ toolVersion = " 0.8.2"
7291}
7392
7493tasks. withType(Test ) {
7594 jacoco. includeNoLocationClasses = true
7695}
7796
7897jacocoAndroidUnitTestReport {
79- excludes + = [' **/com/jjoe64/*' ]
98+ excludes + = [" **/com/jjoe64/*" ]
8099 html. enabled true
81100 xml. enabled true
82101 csv. enabled false
83102}
84103
85- if (project. hasProperty(' keyAlias' )) {
86- def propertiesFile = file(' ../../keystores/androidkeystore.properties' )
104+ if (project. hasProperty(" keyAlias" )) {
105+ def propertiesFile = file(" ../../keystores/androidkeystore.properties" )
87106 Properties properties = readProperties(propertiesFile)
88107
89108 System . out. println (" >>> Signing Config " + properties)
90- android. buildTypes. release. signingConfig. keyAlias = properties[' key_alias' ]. toString()
91- android. buildTypes. release. signingConfig. keyPassword = properties[' key_password' ]. toString()
92- android. buildTypes. release. signingConfig. storeFile = file(properties[' store_filename' ]. toString())
93- android. buildTypes. release. signingConfig. storePassword = properties[' store_password' ]. toString()
109+ android. buildTypes. release. signingConfig. keyAlias = properties[" key_alias" ]. toString()
110+ android. buildTypes. release. signingConfig. keyPassword = properties[" key_password" ]. toString()
111+ android. buildTypes. release. signingConfig. storeFile = file(properties[" store_filename" ]. toString())
112+ android. buildTypes. release. signingConfig. storePassword = properties[" store_password" ]. toString()
94113}
95114
96115dependencies {
97116 // Compile Build Dependencies
98- implementation fileTree(include : [' *.jar' ], dir : ' libs' )
99- implementation ' com.android.support:design:28.0.0'
100- implementation ' com.android.support:support-v4:28.0.0'
101- implementation ' com.android.support:support-media-compat:28.0.0'
102- implementation ' org.apache.commons:commons-lang3:3.8.1'
103- implementation ' org.apache.commons:commons-collections4:4.2'
104- implementation ' com.jjoe64:graphview:4.2.2'
117+ implementation fileTree(include : [" *.jar" ], dir : " libs" )
118+ implementation " com.android.support:design:$supportVersion "
119+ implementation " com.android.support:preference-v7:$supportVersion "
120+ implementation " com.android.support:support-v4:$supportVersion "
121+ implementation " com.android.support:support-media-compat:$supportVersion "
122+ implementation " org.apache.commons:commons-lang3:$lang3Version "
123+ implementation " org.apache.commons:commons-collections4:$collections4Version "
124+ implementation " com.jjoe64:graphview:$graphviewVersion "
105125 // Unit Test Dependencies
106- testImplementation ' junit:junit:4.12 '
107- testImplementation ' org.powermock:powermock-module-junit4:1.7.4 '
108- testImplementation ' org.powermock:powermock-api-mockito2:1.7.4 '
109- testImplementation ' com.googlecode.junit-toolbox:junit-toolbox:2.4 '
110- testImplementation ' org.robolectric:robolectric:4.0 '
111- testImplementation ' org.robolectric:shadows-support-v4:3.4-rc2 '
126+ testImplementation " junit:junit:$j unitVersion "
127+ testImplementation " org.powermock:powermock-module-junit4:$p owermockVersion "
128+ testImplementation " org.powermock:powermock-api-mockito2:$p owermockVersion "
129+ testImplementation " com.googlecode.junit-toolbox:junit-toolbox:$j unitToolboxVersion "
130+ testImplementation " org.robolectric:robolectric:$r obolectricVersion "
131+ testImplementation " org.robolectric:shadows-support-v4:$s hadowsVersion "
112132 // Android Test Dependencies
113- androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2 '
114- androidTestImplementation ' com.android.support.test:runner:1.0.2 '
115- androidTestImplementation ' com.android.support.test:rules:1.0.2 '
133+ androidTestImplementation " com.android.support.test.espresso:espresso-core:$e spressoVersion "
134+ androidTestImplementation " com.android.support.test:runner:$t estVersion "
135+ androidTestImplementation " com.android.support.test:rules:$t estVersion "
116136}
117137
118138updateVersion()
119139
120140def updateVersion () {
121- def propertiesFile = file(' build.properties' )
141+ def propertiesFile = file(" build.properties" )
122142 Properties properties = readProperties(propertiesFile)
123143
124- def versionMajor = properties[' version_major' ]. toString(). toInteger()
125- def versionMinor = properties[' version_minor' ]. toString(). toInteger()
126- def versionPatch = properties[' version_patch' ]. toString(). toInteger()
127- def versionBuild = properties[' version_build' ]. toString(). toInteger()
128- def versionStore = properties[' version_store' ]. toString(). toInteger()
144+ def versionMajor = properties[" version_major" ]. toString(). toInteger()
145+ def versionMinor = properties[" version_minor" ]. toString(). toInteger()
146+ def versionPatch = properties[" version_patch" ]. toString(). toInteger()
147+ def versionBuild = properties[" version_build" ]. toString(). toInteger()
148+ def versionStore = properties[" version_store" ]. toString(). toInteger()
129149
130150 if (isReleaseTask()) {
131151 System . out. println (" >>> Building Release..." )
132152 versionPatch++
133153 versionStore++
134154 versionBuild = 0
135- properties[' version_patch' ] = versionPatch. toString()
136- properties[' version_store' ] = versionStore. toString()
137- properties[' version_build' ] = versionBuild. toString()
155+ properties[" version_patch" ] = versionPatch. toString()
156+ properties[" version_store" ] = versionStore. toString()
157+ properties[" version_build" ] = versionBuild. toString()
138158 writeProperties(propertiesFile, properties)
139159 }
140160 if (isCompileTask()) {
141161 System . out. println (" >>> Compiling Source..." )
142162 versionBuild++
143- properties[' version_build' ] = versionBuild. toString()
163+ properties[" version_build" ] = versionBuild. toString()
144164 writeProperties(propertiesFile, properties)
145165 }
146166
@@ -150,20 +170,20 @@ def updateVersion() {
150170 versionName = versionName + " .${ versionBuild} "
151171 applicationId = applicationId + android. buildTypes. debug. applicationIdSuffix
152172 }
153- System . out. println (" >>> " + project. parent. name + " " + versionName + " (" + versionStore + " ) ' " + applicationId + " ' " )
173+ System . out. println (" >>> " + project. parent. name + " " + versionName + " (" + versionStore + " ) " + applicationId)
154174 android. defaultConfig. versionCode = versionStore
155175 android. defaultConfig. versionName = versionName
156176}
157177
158178def isCompileTask () {
159179 def tasks = gradle. getStartParameter(). getTaskNames()
160- return ' :app:generateDebugSources' in tasks || ' :app:generateReleaseSources' in tasks ||
161- ' generateDebugSources' in tasks || ' generateReleaseSources' in tasks
180+ return " :app:generateDebugSources" in tasks || " :app:generateReleaseSources" in tasks ||
181+ " generateDebugSources" in tasks || " generateReleaseSources" in tasks
162182}
163183
164184def isReleaseTask () {
165185 def tasks = gradle. getStartParameter(). getTaskNames()
166- return ' :app:assembleRelease' in tasks || ' assembleRelease' in tasks
186+ return " :app:assembleRelease" in tasks || " assembleRelease" in tasks
167187}
168188
169189static Properties readProperties (propertiesFile ) {
0 commit comments