Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/local.properties
/.idea/*
.DS_Store
.kotlin
/build
/captures
.externalNativeBuild
Expand Down
16 changes: 9 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("org.jetbrains.kotlin.plugin.compose")
}

android {
Expand All @@ -15,7 +16,7 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
execution = "ANDROIDX_TEST_ORCHESTRATOR"
animationsDisabled = true
}
signingConfigs {
Expand All @@ -34,20 +35,21 @@ android {

buildTypes {
release {
minifyEnabled true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
minifyEnabled = true
signingConfig = signingConfigs.release
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

// Create baseline for lint check to ignore old issues.
lintOptions {
baseline(project.file("lint-baseline.xml"))
lint {
baseline = file('lint-baseline.xml')
}
}

dependencies {
implementation 'androidx.activity:activity:1.8.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
Expand All @@ -64,7 +66,7 @@ dependencies {
implementation FramesConfig.framesAndroidDependency
}

configurations.all {
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
if (FramesConfig.useLocalModuleDependencies) {

Expand Down
8 changes: 6 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import com.vanniktech.code.quality.tools.CodeQualityToolsPluginExtension
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.google.devtools.ksp") version "2.2.20-2.0.2" apply false
id("org.jetbrains.kotlin.plugin.compose") version "2.2.20" apply false
}

buildscript {
repositories {
google()
mavenCentral()
jcenter()
}

dependencies {
Expand Down Expand Up @@ -44,7 +48,7 @@ allprojects {
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}

/* Code quality tools config */
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ java {
}

dependencies {
implementation("com.android.tools.build:gradle:8.1.2")
implementation("com.android.tools.build:gradle:8.12.3")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.property("kotlinVersion")}")
implementation("de.mannodermaus.gradle.plugins:android-junit5:${project.property("mannodermausAndroidJunit5Version")}")
implementation("org.jetbrains.dokka:dokka-gradle-plugin:${project.property("dokkaVersion")}")
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlinVersion=1.9.10
gradleVersion=8.1.2
kotlinVersion=2.2.20
gradleVersion=8.12.3
mannodermausAndroidJunit5Version=1.8.0.0
dokkaVersion=1.9.0
codeQualityToolsPlugin=0.21.0
8 changes: 2 additions & 6 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ object Dependencies {
"org.jetbrains.kotlinx:kotlinx-coroutines-android:${Versions.kotlinCoroutines}"
const val coreKtx = "androidx.core:core-ktx:${Versions.coreKtx}"
const val appcompat = "androidx.appcompat:appcompat:${Versions.appcompat}"
const val constraintLayout =
"androidx.constraintlayout:constraintlayout:${Versions.constraintLayout}"
const val materialDesign = "com.google.android.material:material:${Versions.materialDesign}"
const val lifeCycleLiveData = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.lifeCycle}"
const val lifeCycleRunTime = "androidx.lifecycle:lifecycle-runtime-ktx:${Versions.lifeCycle}"
const val lifecycle_viewmodel =
"androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.lifeCycle}"
Expand Down Expand Up @@ -51,8 +47,6 @@ object Dependencies {

// Dependency injection
const val dagger = "com.google.dagger:dagger-android:${Versions.dagger}"
const val dagger_support = "com.google.dagger:dagger-android-support:${Versions.dagger}"
const val dagger_processor = "com.google.dagger:dagger-android-processor:${Versions.dagger}"
const val dagger_compiler = "com.google.dagger:dagger-compiler:${Versions.dagger}"

// Instrumented Test
Expand All @@ -74,6 +68,7 @@ object Dependencies {
const val junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${Versions.junit5Jupiter}"
const val junitJupiterEngine =
"org.junit.jupiter:junit-jupiter-engine:${Versions.junit5Jupiter}"
const val junitPlatformLauncher = "org.junit.platform:junit-platform-launcher:${Versions.junitPlatformLauncher}"
const val junitJupiterParams =
"org.junit.jupiter:junit-jupiter-params:${Versions.junit5Jupiter}"
const val mannodermausAndroidJunitCore =
Expand All @@ -88,6 +83,7 @@ object Dependencies {
const val kluentAndroid = "org.amshove.kluent:kluent-android:${Versions.kluent}"
const val robolectric = "org.robolectric:robolectric:${Versions.robolectric}"
const val truth = "com.google.truth:truth:${Versions.truth}"
const val testRunner = "androidx.test:runner:${Versions.testRunner}"
const val okhttpMockServer = "com.squareup.okhttp3:mockwebserver:${Versions.okhttp}"
const val kotlinCoroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.kotlinCoroutines}"
const val jsonTest = "org.json:json:${Versions.jsonTest}"
Expand Down
11 changes: 5 additions & 6 deletions buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ object Versions {
const val jsonTest = "20180813"
const val coreKtx = "1.2.0"
const val appcompat = "1.3.1"
const val constraintLayout = "2.1.1"
const val materialDesign = "1.4.0"
const val lifeCycle = "2.5.1"
const val compose_compiler_ext = "1.5.3"
const val compose_material3 = "1.1.2"
const val compose_version = "1.7.4"
const val compose_activity_version = "1.8.0"
Expand All @@ -39,13 +36,15 @@ object Versions {
const val riskSdk = "2.1.0"

// Unit Testing Dependencies
const val junit5Jupiter = "5.8.0"
const val junit5Jupiter = "5.13.4"
const val junit4 = "4.13.2"
const val junitVintageEngine = "5.8.2"
const val junitPlatformLauncher = "1.11.4"
const val kluent = "1.68"
const val mockk = "1.13.8"
const val mockk = "1.14.6"
const val robolectric = "4.11-beta-2"
const val truth = "1.1.5"
const val testRunner = "1.7.0"
const val jacoco = "0.8.10"

// Instrumented Testing Dependencies
Expand All @@ -62,7 +61,7 @@ object Versions {
const val eventLogger = "1.0.1"

// Dependency injection
const val dagger = "2.48.1"
const val dagger = "2.57.2"
}

fun loadVersionProperty(): Properties {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ fun Project.applyAndroidJUnit4Configuration() {
testImplementation(Dependencies.junitVintageEngine)
testImplementation(Dependencies.robolectric)
testImplementation(Dependencies.truth)
testImplementation(Dependencies.testRunner)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private val Project.junitPlatform: AndroidJUnitPlatformExtension
private fun DependencyHandler.junit5() {
testImplementation(Dependencies.junitJupiterApi)
testRuntimeOnly(Dependencies.junitJupiterEngine)
testRuntimeOnly(Dependencies.junitPlatformLauncher)
testImplementation(Dependencies.junitJupiterParams)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Dependencies
import com.checkout.buildsrc.utils.androidTestImplementation
import com.checkout.buildsrc.utils.debugImplementation
import com.checkout.buildsrc.utils.implementation
import com.checkout.buildsrc.utils.kapt
import com.checkout.buildsrc.utils.ksp
import com.checkout.buildsrc.utils.testImplementation
import org.gradle.api.artifacts.dsl.DependencyHandler

Expand All @@ -19,14 +19,6 @@ fun DependencyHandler.commonDependencies() {
implementation(Dependencies.appcompat)
}

/**
* Dependencies usually required for modules with a Imperative UI
*/
fun DependencyHandler.androidImperativeUI() {
implementation(Dependencies.constraintLayout)
implementation(Dependencies.materialDesign)
}

/**
* Dependencies usually required for modules with a Declarative UI
*/
Expand All @@ -51,7 +43,7 @@ fun DependencyHandler.networkingDependencies() {
implementation(Dependencies.okhttp)
implementation(Dependencies.loggingInterceptor)
implementation(Dependencies.moshi)
kapt(Dependencies.moshiCodeGen)
ksp(Dependencies.moshiCodeGen)
}

fun DependencyHandler.riskSdkDependencies() {
Expand All @@ -70,9 +62,7 @@ fun DependencyHandler.logging() {
*/
fun DependencyHandler.dependencyInjection() {
implementation(Dependencies.dagger)
implementation(Dependencies.dagger_support)
kapt(Dependencies.dagger_processor)
kapt(Dependencies.dagger_compiler)
ksp(Dependencies.dagger_compiler)
}

/**
Expand Down
47 changes: 11 additions & 36 deletions buildSrc/src/main/java/com/checkout/buildsrc/CommonConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import com.android.build.gradle.AppExtension
import com.android.build.gradle.LibraryExtension
import com.checkout.buildsrc.utils.android
import com.checkout.buildsrc.utils.kotlin
import com.checkout.buildsrc.utils.kotlinOptions
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

fun Project.applyCommonConfigurations() {
android {
Expand All @@ -25,8 +25,10 @@ fun Project.applyCommonConfigurations() {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}

testOptions {
Expand Down Expand Up @@ -79,33 +81,6 @@ fun Project.applyDIConfigurations() {
}
}

fun Project.applyCommonAppConfigurations() {
android {
require(this is AppExtension) {
"Android application plugin has not been applied"
}

applyCommonConfigurations()

buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
getByName("debug") {
isMinifyEnabled = false
}
}

buildFeatures.apply {
viewBinding = true
}
}
}

fun Project.applyCommonLibConfigurations() {
android {
require(this is LibraryExtension) {
Expand Down Expand Up @@ -133,12 +108,12 @@ fun Project.applyCommonLibConfigurations() {

kotlin {
explicitApi()
}

kotlinOptions {
freeCompilerArgs = freeCompilerArgs +
"-opt-in=kotlin.contracts.ExperimentalContracts" +
"-Xexplicit-api=strict"
compilerOptions {
freeCompilerArgs.addAll(
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xexplicit-api=strict",
)
}
}

packagingOptions.resources {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun Project.applyJacocoTestReport() {
xml.required.set(true)
html.required.set(true)
}
val buildDir = project.buildDir
val buildDir = project.layout.buildDirectory
val javaTree = fileTree("$buildDir/intermediates/javac/debug/classes") { setExcludes(FILE_FILTER) }
val kotlinTree = fileTree("$buildDir/tmp/kotlin-classes/debug") { setExcludes(FILE_FILTER) }
val execSrc = fileTree(buildDir) { setIncludes(listOf("**/*.exec")) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ fun DependencyHandler.implementation(dependency: String) {
add("implementation", dependency)
}

fun DependencyHandler.kapt(dependency: String) {
add("kapt", dependency)
}

fun DependencyHandler.annotationProcessor(dependency: String) {
add("annotationProcessor", dependency)
fun DependencyHandler.ksp(dependency: String) {
add("ksp", dependency)
}

fun DependencyHandler.androidTestImplementation(dependency: String) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ import com.android.build.gradle.LibraryExtension
import org.gradle.api.Project
import org.gradle.api.plugins.ExtensionAware
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions

internal fun Project.getProperty(property: String): String? =
project.findProperty(property) as String? ?: System.getenv(property)

internal fun Project.getRequiredProperty(property: String): String {
val propertyValue = getProperty(property)
check(!propertyValue.isNullOrEmpty()) { "Required property $property is not defined" }
return propertyValue
}

/**
* Configures the [kotlin][org.jetbrains.kotlin.gradle.dsl.KotlinAndroidProjectExtension] extension.
Expand All @@ -34,9 +24,3 @@ internal fun Project.android(configure: BaseExtension.() -> Unit) {
check(androidExtension is BaseExtension) { "Unable to access Android project extensions" }
androidExtension.apply(configure)
}

/**
* Configures the [kotlinOptions][org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions] extension.
*/
internal fun BaseExtension.kotlinOptions(configure: KotlinJvmOptions.() -> Unit): Unit =
(this as ExtensionAware).extensions.configure("kotlinOptions", configure)
13 changes: 6 additions & 7 deletions buildSrc/src/main/java/precompiled-android-app.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import com.checkout.buildsrc.genericAndroidTestDependencies
import com.checkout.buildsrc.genericTestDependencies
import com.checkout.buildsrc.utils.android
import com.checkout.buildsrc.utils.implementation
import com.checkout.buildsrc.utils.kotlinOptions
import com.checkout.buildsrc.utils.kotlin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
Expand All @@ -29,12 +30,10 @@ android {
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}

composeOptions {
kotlinCompilerExtensionVersion = Versions.compose_compiler_ext
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
}

Expand Down
Loading
Loading