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 {
23- compileSdkVersion 27
24- buildToolsVersion ' 28.0.2 '
37+ compileSdkVersion 28
38+ buildToolsVersion " 28.0.3 "
2539
2640 defaultConfig {
2741 applicationId " com.vrem.wifianalyzer"
2842 minSdkVersion 16
29- targetSdkVersion 22
43+ 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,82 +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.1 '
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:27.1.1'
100- implementation ' org.apache.commons:commons-lang3:3.8'
101- implementation ' org.apache.commons:commons-collections4:4.2'
102- 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 "
103125 // Unit Test Dependencies
104- testImplementation ' junit:junit:4.12 '
105- testImplementation ' org.powermock:powermock-module-junit4:1.7.4 '
106- testImplementation ' org.powermock:powermock-api-mockito2:1.7.4 '
107- testImplementation ' com.googlecode.junit-toolbox:junit-toolbox:2.4 '
108- testImplementation ' org.robolectric:robolectric:3.8 '
109- 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 "
110132 // Android Test Dependencies
111- androidTestImplementation ' com.android.support.test.espresso:espresso-core:3.0.2 '
112- androidTestImplementation ' com.android.support.test:runner:1.0.2 '
113- 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 "
114136}
115137
116138updateVersion()
117139
118140def updateVersion () {
119- def propertiesFile = file(' build.properties' )
141+ def propertiesFile = file(" build.properties" )
120142 Properties properties = readProperties(propertiesFile)
121143
122- def versionMajor = properties[' version_major' ]. toString(). toInteger()
123- def versionMinor = properties[' version_minor' ]. toString(). toInteger()
124- def versionPatch = properties[' version_patch' ]. toString(). toInteger()
125- def versionBuild = properties[' version_build' ]. toString(). toInteger()
126- 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()
127149
128150 if (isReleaseTask()) {
129151 System . out. println (" >>> Building Release..." )
130152 versionPatch++
131153 versionStore++
132154 versionBuild = 0
133- properties[' version_patch' ] = versionPatch. toString()
134- properties[' version_store' ] = versionStore. toString()
135- properties[' version_build' ] = versionBuild. toString()
155+ properties[" version_patch" ] = versionPatch. toString()
156+ properties[" version_store" ] = versionStore. toString()
157+ properties[" version_build" ] = versionBuild. toString()
136158 writeProperties(propertiesFile, properties)
137159 }
138160 if (isCompileTask()) {
139161 System . out. println (" >>> Compiling Source..." )
140162 versionBuild++
141- properties[' version_build' ] = versionBuild. toString()
163+ properties[" version_build" ] = versionBuild. toString()
142164 writeProperties(propertiesFile, properties)
143165 }
144166
@@ -148,20 +170,20 @@ def updateVersion() {
148170 versionName = versionName + " .${ versionBuild} "
149171 applicationId = applicationId + android. buildTypes. debug. applicationIdSuffix
150172 }
151- System . out. println (" >>> " + project. parent. name + " " + versionName + " (" + versionStore + " ) ' " + applicationId + " ' " )
173+ System . out. println (" >>> " + project. parent. name + " " + versionName + " (" + versionStore + " ) " + applicationId)
152174 android. defaultConfig. versionCode = versionStore
153175 android. defaultConfig. versionName = versionName
154176}
155177
156178def isCompileTask () {
157179 def tasks = gradle. getStartParameter(). getTaskNames()
158- return ' :app:generateDebugSources' in tasks || ' :app:generateReleaseSources' in tasks ||
159- ' generateDebugSources' in tasks || ' generateReleaseSources' in tasks
180+ return " :app:generateDebugSources" in tasks || " :app:generateReleaseSources" in tasks ||
181+ " generateDebugSources" in tasks || " generateReleaseSources" in tasks
160182}
161183
162184def isReleaseTask () {
163185 def tasks = gradle. getStartParameter(). getTaskNames()
164- return ' :app:assembleRelease' in tasks || ' assembleRelease' in tasks
186+ return " :app:assembleRelease" in tasks || " assembleRelease" in tasks
165187}
166188
167189static Properties readProperties (propertiesFile ) {
0 commit comments