summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorAlbin <albin@mullvad.net>2021-12-20 08:39:15 +0100
committerAlbin <albin@mullvad.net>2022-01-05 03:24:07 +0100
commit2b2b2a3fd6e1dc857b140483269019743f25a1b8 (patch)
tree2dbeca9b4c6851dc916f626ff5e356829a6cc5c5 /android
parent982cdede4e117f992aef0cb493622aef9972ed00 (diff)
downloadmullvadvpn-2b2b2a3fd6e1dc857b140483269019743f25a1b8.tar.xz
mullvadvpn-2b2b2a3fd6e1dc857b140483269019743f25a1b8.zip
Prepare gradle scripts for kotlin migration
Diffstat (limited to 'android')
-rw-r--r--android/app/build.gradle132
-rw-r--r--android/build.gradle19
2 files changed, 75 insertions, 76 deletions
diff --git a/android/app/build.gradle b/android/app/build.gradle
index 79603dd520..46b0a827dc 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -1,7 +1,7 @@
-apply plugin: 'com.android.application'
-apply plugin: 'com.github.triplet.play'
-apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-parcelize'
+apply plugin: "com.android.application"
+apply plugin: "com.github.triplet.play"
+apply plugin: "kotlin-android"
+apply plugin: "kotlin-parcelize"
def repoRootPath = rootProject.projectDir.absoluteFile.parentFile.absolutePath
def extraAssetsDirectory = "$project.buildDir/extraAssets"
@@ -15,41 +15,41 @@ if (keystorePropertiesFile.exists()) {
}
android {
- compileSdkVersion 30
- buildToolsVersion '30.0.3'
+ compileSdkVersion(30)
+ buildToolsVersion("30.0.3")
defaultConfig {
- applicationId "net.mullvad.mullvadvpn"
- minSdkVersion 26
- targetSdkVersion 30
- versionCode 21010099
- versionName "2021.1"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ applicationId = "net.mullvad.mullvadvpn"
+ minSdkVersion(26)
+ targetSdkVersion(30)
+ versionCode = 21010099
+ versionName = "2021.1"
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
if (keystorePropertiesFile.exists()) {
signingConfigs {
release {
- keyAlias keystoreProperties['keyAlias']
- keyPassword keystoreProperties['keyPassword']
- storeFile file(keystoreProperties['storeFile'])
- storePassword keystoreProperties['storePassword']
+ keyAlias = keystoreProperties["keyAlias"]
+ keyPassword = keystoreProperties["keyPassword"]
+ storeFile = file(keystoreProperties["storeFile"])
+ storePassword = keystoreProperties["storePassword"]
}
}
buildTypes {
release {
- minifyEnabled false
- signingConfig signingConfigs.release
+ minifyEnabled = false
+ signingConfig(signingConfigs.release)
}
}
}
buildTypes {
fdroid {
- initWith release
- minifyEnabled false
- signingConfig null
+ initWith(release)
+ minifyEnabled = false
+ signingConfig = null
}
}
@@ -64,37 +64,37 @@ android {
}
java {
- srcDirs += 'src/main/kotlin/'
+ srcDirs += "src/main/kotlin/"
}
}
test {
java {
- srcDirs += 'src/test/kotlin/'
+ srcDirs += "src/test/kotlin/"
}
}
androidTest {
java {
- srcDirs += 'src/androidTest/kotlin/'
+ srcDirs += "src/androidTest/kotlin/"
}
}
}
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = "1.8"
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
// Opt-in option for Koin annotation of KoinComponent.
}
applicationVariants.all { variant ->
variant.mergeAssetsProvider.configure {
- dependsOn copyExtraAssets
+ dependsOn(copyExtraAssets)
}
}
@@ -102,9 +102,9 @@ android {
unitTests.all {
testLogging {
outputs.upToDateWhen { false }
- events "passed", "skipped", "failed", "standardOut", "standardError"
- showCauses true
- showExceptions true
+ events("passed", "skipped", "failed", "standardOut", "standardError")
+ showCauses = true
+ showExceptions = true
}
}
}
@@ -130,10 +130,10 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
}
task copyExtraAssets(type: Copy) {
- from "$repoRootPath/dist-assets"
- include "relays.json"
- include "api-ip-address.txt"
- into extraAssetsDirectory
+ from("$repoRootPath/dist-assets")
+ include("relays.json")
+ include("api-ip-address.txt")
+ into(extraAssetsDirectory)
}
play {
@@ -141,39 +141,39 @@ play {
}
dependencies {
- implementation "androidx.appcompat:appcompat:1.3.1"
- implementation "androidx.constraintlayout:constraintlayout:2.1.0"
- implementation "androidx.coordinatorlayout:coordinatorlayout:1.1.0"
- implementation "androidx.core:core-ktx:1.6.0"
- implementation "androidx.fragment:fragment-ktx:$fragmentVersion"
- implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"
- implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
- implementation "androidx.recyclerview:recyclerview:1.2.1"
- implementation "com.google.android.material:material:1.4.0"
- implementation "commons-validator:commons-validator:1.7"
- implementation "io.insert-koin:koin-core:$koinVersion"
- implementation "io.insert-koin:koin-core-ext:$koinVersion"
- implementation "io.insert-koin:koin-androidx-fragment:$koinVersion"
- implementation "io.insert-koin:koin-androidx-scope:$koinVersion"
- implementation "io.insert-koin:koin-androidx-viewmodel:$koinVersion"
- implementation "joda-time:joda-time:2.10.2"
- implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
- implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1"
+ implementation("androidx.appcompat:appcompat:1.3.1")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.0")
+ implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
+ implementation("androidx.core:core-ktx:1.6.0")
+ implementation("androidx.fragment:fragment-ktx:$fragmentVersion")
+ implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1")
+ implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
+ implementation("androidx.recyclerview:recyclerview:1.2.1")
+ implementation("com.google.android.material:material:1.4.0")
+ implementation("commons-validator:commons-validator:1.7")
+ implementation("io.insert-koin:koin-core:$koinVersion")
+ implementation("io.insert-koin:koin-core-ext:$koinVersion")
+ implementation("io.insert-koin:koin-androidx-fragment:$koinVersion")
+ implementation("io.insert-koin:koin-androidx-scope:$koinVersion")
+ implementation("io.insert-koin:koin-androidx-viewmodel:$koinVersion")
+ implementation("joda-time:joda-time:2.10.2")
+ implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
+ implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.1")
/* Test dependencies */
- testImplementation "io.insert-koin:koin-test:$koinVersion"
- testImplementation "io.mockk:mockk:$mockkVersion"
- testImplementation "junit:junit:4.13"
- testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
- testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.1"
+ testImplementation("io.insert-koin:koin-test:$koinVersion")
+ testImplementation("io.mockk:mockk:$mockkVersion")
+ testImplementation("junit:junit:4.13")
+ testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
+ testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.1")
/* UI test dependencies */
- debugImplementation "androidx.fragment:fragment-testing:$fragmentVersion"
- androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
- androidTestImplementation "androidx.test.espresso:espresso-contrib:$espressoVersion"
- androidTestImplementation "androidx.test.ext:junit:1.1.3"
- androidTestImplementation "io.mockk:mockk-android:$mockkVersion"
- androidTestImplementation "io.insert-koin:koin-test:$koinVersion"
- androidTestImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
+ debugImplementation("androidx.fragment:fragment-testing:$fragmentVersion")
+ androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion")
+ androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion")
+ androidTestImplementation("androidx.test.ext:junit:1.1.3")
+ androidTestImplementation("io.mockk:mockk-android:$mockkVersion")
+ androidTestImplementation("io.insert-koin:koin-test:$koinVersion")
+ androidTestImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
}
diff --git a/android/build.gradle b/android/build.gradle
index dd148cccb1..3934e97b3c 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -2,25 +2,24 @@ buildscript {
ext {
espressoVersion = "3.3.0"
fragmentVersion = "1.3.2"
- koinVersion = '2.2.2'
- kotlinVersion = '1.4.31'
- mockkVersion = '1.12.0'
+ koinVersion = "2.2.2"
+ kotlinVersion = "1.4.31"
+ mockkVersion = "1.12.0"
}
repositories {
google()
mavenCentral()
maven {
- url "https://plugins.gradle.org/m2/"
+ url("https://plugins.gradle.org/m2/")
}
}
dependencies {
- classpath "com.android.tools.build:gradle:4.1.3"
- classpath "com.github.triplet.gradle:play-publisher:2.7.5"
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
- classpath "org.owasp:dependency-check-gradle:6.5.0.1"
-
+ classpath("com.android.tools.build:gradle:4.1.3")
+ classpath("com.github.triplet.gradle:play-publisher:2.7.5")
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
+ classpath("org.owasp:dependency-check-gradle:6.5.0.1")
}
}
@@ -36,5 +35,5 @@ allprojects {
}
task clean(type: Delete) {
- delete rootProject.buildDir
+ delete(rootProject.buildDir)
}