Skip to content

Commit

Permalink
Forbid usage of kotlin-android-extensions (#2282)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/488551667048375/1202728801491359/f

### Description
Forbid the usage of `kotlin-android-extension` as it is deprecated.

We use(d) it for two things:
* `@Parcelize`
* synthetics

For some modules like `:app` and `:vpn-impl` I've added an exception
because we first need to migrate way from synthetics

### Steps to test this PR
Smoke tests for autofill
  • Loading branch information
aitorvs authored Sep 16, 2022
1 parent eb626f7 commit 74da702
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion ad-click/ad-click-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.squareup.anvil'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
2 changes: 1 addition & 1 deletion autofill/autofill-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-parcelize'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.duckduckgo.autofill.domain.app

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
import kotlinx.parcelize.Parcelize

/**
* Representation of login credentials used for autofilling into the browser.
Expand Down
1 change: 0 additions & 1 deletion autofill/autofill-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.squareup.anvil'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
1 change: 0 additions & 1 deletion autofill/autofill-store/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ allprojects {

subprojects {

// Break build when using deprecated plugins
String[] allowDeprecatedModuleIn = ["app", "vpn-impl"]
project.plugins.withId('kotlin-android-extensions') {
if (!allowDeprecatedModuleIn.contains(project.name)) {
throw new GradleException("kotlin-android-extensions plugin is deprecated, DO NOT USE!")
}
}

String[] allowAndroidTestsIn = ["app"]
if (!allowAndroidTestsIn.contains(project.name)) {
project.projectDir.eachFile(groovy.io.FileType.DIRECTORIES) { File parent ->
Expand Down
1 change: 0 additions & 1 deletion downloads/downloads-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.squareup.anvil'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
1 change: 0 additions & 1 deletion macos/macos-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.squareup.anvil'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down
1 change: 0 additions & 1 deletion privacy-config/privacy-config-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.squareup.anvil'
id 'kotlin-android-extensions'
}

apply from: "$rootProject.projectDir/gradle/android-library.gradle"
Expand Down

0 comments on commit 74da702

Please sign in to comment.