Skip to content

Commit

Permalink
Release 3.1.1 (#333)
Browse files Browse the repository at this point in the history
* Bump gradle to 8.1.1

* Bump dependencies

* Bump gradle to 8.2.1

* Migrate to version catalog toml file

* Remove unused permission

* Bump android Gradle Plugin to 8.1.0

* Implement auto generateLocaleConfig

* Update gradle wrapper and script

* Update dependencies

* Update dependencies

* Migrate to Kotlin script Gradle

* Convert example UnitTest to Kotlin

* Add config to disable ability to export app data

* Bump androidx preference-ktx to 1.2.1

* Bump checkout to v4

* Bump versionCode and add new changelogs
  • Loading branch information
Jean-BaptisteC authored Sep 12, 2023
1 parent 78f5d38 commit cdeaf53
Show file tree
Hide file tree
Showing 20 changed files with 361 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
Expand Down
190 changes: 0 additions & 190 deletions app/build.gradle

This file was deleted.

177 changes: 177 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("kotlin-kapt")
id("dagger.hilt.android.plugin")
id("androidx.navigation.safeargs.kotlin")
id("org.jlleitschuh.gradle.ktlint")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "org.eu.exodus_privacy.exodusprivacy"
compileSdk = 33

defaultConfig {
applicationId = "org.eu.exodus_privacy.exodusprivacy"
minSdk = 21
targetSdk = 33
versionCode = 16
versionName = "3.1.1"
testInstrumentationRunner = "org.eu.exodus_privacy.exodusprivacy.ExodusTestRunner"
val API_KEY = System.getenv("EXODUS_API_KEY")
buildConfigField("String", "EXODUS_API_KEY", "\"$API_KEY\"")
javaCompileOptions {
annotationProcessorOptions {
compilerArgumentProviders(
RoomSchemaArgProvider(File(projectDir, "schemas"))
)
}
}

signingConfigs {
create("releaseConfig") {
// check whether we are in release workflow or on dev system
if (System.getenv("KEYSTORE_FILE") != null) {
storeFile = file(System.getenv("KEYSTORE_FILE"))
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEYSTORE_ALIAS")
keyPassword = System.getenv("KEYSTORE_PASSPHRASE")
} else {
storeFile = file("release.keystore")
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEYSTORE_ALIAS")
keyPassword = System.getenv("KEYSTORE_PASSPHRASE")
}
}
}
}

buildTypes {
getByName("debug") {
applicationIdSuffix = ".debug"
versionNameSuffix = "-debug"
isDebuggable = true
}
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("releaseConfig")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
testOptions {
unitTests {
isIncludeAndroidResources = true
}
}
sourceSets {
// Adds exported schema location as test app assets.
getByName("androidTest").assets.srcDirs("$projectDir/schemas")
}
buildFeatures {
viewBinding = true
}
lint {
lintConfig = file("lint.xml")
}

androidResources {
generateLocaleConfig = true
}
}
kapt {
correctErrorTypes = true
}

dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
// r8
implementation(libs.tools.r8)

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.legacy.support.v4)
implementation(libs.androidx.core.splashscreen)
implementation(libs.markwon.core)
implementation(libs.androidx.window)
implementation(libs.androidx.appcompat)

implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.swiperefreshlayout)
implementation(libs.android.material)
implementation(libs.code.gson)
implementation(libs.androidx.preference.ktx)
implementation(libs.androidx.browser)
implementation(libs.androidx.datastore.preferences)
implementation(libs.shimmer)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.androidx.test.junit.ktx)

// Navigation Components
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)

// Retrofit and Moshi
implementation(libs.retrofit)
implementation(libs.retrofit.converter.moshi)

// okhttp
implementation(libs.okhttp)

// Hilt
kapt(libs.dagger.hilt.compiler)
implementation(libs.dagger.hilt.android)

// Lifecycle
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.lifecycle.service)

// Room
kapt(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.runtime)

// KTX
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.activity.ktx)

// unit tests
testImplementation(libs.junit)
testImplementation(libs.robolectric)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.androidx.test.rules)
testImplementation(libs.dagger.hilt.android.testing)
testImplementation(libs.okhttp.mockwebserver)
kaptTest(libs.dagger.hilt.compiler)

// instrumentation tests
kaptAndroidTest(libs.dagger.hilt.compiler)
androidTestImplementation(libs.dagger.hilt.android.testing)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.core.ktx)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.room.testing)
androidTestImplementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.okhttp.mockwebserver)
androidTestImplementation(libs.androidx.test.ext.junit)
}

class RoomSchemaArgProvider(
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val schemaDir: File
) : CommandLineArgumentProvider {
override fun asArguments() = listOf("room.schemaLocation=${schemaDir.path}")
}
Loading

0 comments on commit cdeaf53

Please sign in to comment.