Skip to content

Commit

Permalink
Merge pull request #1516 from Adyen/update/android-gradle-plugin
Browse files Browse the repository at this point in the history
Gradle improvements
  • Loading branch information
jreij authored Mar 19, 2024
2 parents a2ccfdc + 533ef40 commit ff744c4
Show file tree
Hide file tree
Showing 68 changed files with 1,664 additions and 9,317 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/generate_dependency_graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

# Setup Java 17
# https://github.com/marketplace/actions/setup-java-jdk
- name: Set up JDK
uses: actions/setup-java@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
distribution: 'zulu'
java-version: 17
cache: 'gradle'

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
Expand All @@ -30,4 +36,4 @@ jobs:
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
branch: ${{ github.ref }}
8 changes: 3 additions & 5 deletions 3ds2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.adyen3ds2'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions ach/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.ach'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions action-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.action.core'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions action/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.action'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions await/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.await'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions bacs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.bacs'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions bcmc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.bcmc'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions blik/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.blik'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions boleto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.boleto'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions card/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.card'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class CardView @JvmOverloads constructor(
)
setDualBrandedCardImages(detectedCardTypes, cardOutputData.cardNumberState.validation)

// TODO: 29/01/2021 get this logic from OutputData
// TODO 29/01/2021 get this logic from OutputData
val isAmex = detectedCardTypes.any { it.cardBrand == CardBrand(cardType = CardType.AMERICAN_EXPRESS) }
binding.editTextCardNumber.setAmexCardFormat(isAmex)

Expand Down
8 changes: 3 additions & 5 deletions cashapppay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.cashapppay'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions checkout-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.core'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions components-compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.components.compose'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
8 changes: 3 additions & 5 deletions components-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ apply from: "${rootDir}/config/gradle/sharedTasks.gradle"

android {
namespace 'com.adyen.checkout.components.core'
compileSdkVersion compile_sdk_version
compileSdk compile_sdk_version

defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
versionCode version_code
versionName version_name
minSdk min_sdk_version
targetSdk target_sdk_version

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ data class VoucherAction(
var alternativeReference: String? = null,
var merchantName: String? = null,
var merchantReference: String? = null,
// TODO: remove url when it's fixed from backend side
// TODO remove url when it's fixed from backend side
var url: String? = null,
var downloadUrl: String? = null,
var instructionsUrl: String? = null,
Expand Down
9 changes: 0 additions & 9 deletions config/detekt/detekt-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,5 @@
<ManuallySuppressedIssues>
</ManuallySuppressedIssues>
<CurrentIssues>
<ID>ForbiddenComment:Logger.kt$Logger$// TODO: 14/02/2019 The idea is for this class to have a system where we can send a stream of logs to the merchant</ID>
<ID>ForbiddenComment:CardView.kt$CardView$// TODO: 29/01/2021 get this logic from OutputData</ID>
<ID>ForbiddenComment:VoucherAction.kt$VoucherAction$// TODO: remove url when it's fixed from backend side</ID>
<ID>ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: trigger download image flow when user accept storage permission after checking permission type</ID>
<ID>ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: checkout_rationale_title_storage_permission and checkout_rationale_message_storage_permission</ID>
<ID>ForbiddenComment:ActionComponentDialogFragment.kt$ActionComponentDialogFragment$// TODO: can be reused based on required permission</ID>
<ID>ForbiddenComment:DefaultVoucherDelegate.kt$DefaultVoucherDelegate$// TODO: remove action.url when it's fixed from backend side</ID>
<ID>ForbiddenComment:CheckoutSessionInitializer.kt$CheckoutSessionInitializer$// TODO: Once Backend provides the correct amount in the SessionSetupResponse use that in SessionDetails instead of</ID>
<ID>ForbiddenComment:SessionDetails.kt$// TODO: Once Backend provides the correct amount in the SessionSetupResponse use that in SessionDetails</ID>
</CurrentIssues>
</SmellBaseline>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ android {
defaultConfig {
buildConfigField "String", "CHECKOUT_VERSION", "\"$version_name\""
}
}

buildFeatures {
buildConfig true
}
}
17 changes: 0 additions & 17 deletions config/gradle/ci.gradle

This file was deleted.

6 changes: 3 additions & 3 deletions config/gradle/dependencyGraph.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// From: https://github.com/tfcporciuncula/readme-graph/blob/master/gradle/projectDependencyGraph.gradle
task dependencyGraph {
tasks.register("dependencyGraph") {
doLast {
def dot = new File(rootProject.rootDir, 'dependency-graph/project.dot')
dot.parentFile.mkdirs()
Expand Down Expand Up @@ -43,7 +43,7 @@ task dependencyGraph {
javaProjects.add(project)
}

project.configurations.all { config ->
project.configurations.configureEach { config ->
config.dependencies
.withType(ProjectDependency)
.collect { it.dependencyProject }
Expand Down Expand Up @@ -97,7 +97,7 @@ task dependencyGraph {

dot << '\n # Dependencies\n\n'
dependencies.forEach { key, traits ->
dot << " \"${key.first.path}\" -> \"${key.second.path}\""
dot << " \"${key.v1.path}\" -> \"${key.v2.path}\""
if (!traits.isEmpty()) {
dot << " [${traits.join(", ")}]"
}
Expand Down
3 changes: 2 additions & 1 deletion config/gradle/dokka.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
project.plugins.withId("kotlin-android") {
apply plugin: "org.jetbrains.dokka"

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
tasks.register("javadocJar", Jar) {
dependsOn tasks.named("dokkaJavadoc")
archiveClassifier.set('javadoc')
from dokkaJavadoc.outputDirectory
}
Expand Down
2 changes: 1 addition & 1 deletion config/gradle/dokkaRoot.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
apply plugin: "org.jetbrains.dokka"

tasks.named("dokkaHtmlMultiModule") {
def dokkaDir = "$rootProject.buildDir/docs"
def dokkaDir = "${rootProject.layout.buildDirectory.get().asFile}/docs"
outputDirectory.set(file(dokkaDir))
doLast {
copy {
Expand Down
22 changes: 0 additions & 22 deletions config/gradle/runConnectedAndroidTest.gradle

This file was deleted.

Loading

0 comments on commit ff744c4

Please sign in to comment.