-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
78f5d38
commit cdeaf53
Showing
20 changed files
with
361 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}") | ||
} |
Oops, something went wrong.