Skip to content

Commit

Permalink
Bug 1949260 - Part 1 - Replace FenixDependenciesPlugin with gradle ve…
Browse files Browse the repository at this point in the history
…rsion catalog r=android-reviewers,nalexander,jonalmeida

Differential Revision: https://phabricator.services.mozilla.com/D238809
  • Loading branch information
AadityaMozilla committed Feb 26, 2025
1 parent 4ff64c9 commit 5ac5fd0
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 97 deletions.
1 change: 0 additions & 1 deletion build/sparse-profiles/taskgraph
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,4 @@ path:mobile/android/focus-android/gradle/wrapper/gradle-wrapper.properties
path:mobile/android/fenix/gradle/wrapper/gradle-wrapper.properties
path:mobile/android/android-components/plugins/dependencies/src/main/java/DependenciesPlugin.kt
path:mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt
path:mobile/android/fenix/plugins/fenixdependencies/src/main/java/FenixDependenciesPlugin.kt
path:mobile/android/version.txt
7 changes: 7 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[versions]
adjust = "4.38.2"
installreferrer = "2.2"

[libraries]
adjust = { group = "com.adjust.sdk", name = "adjust-android", version.ref = "adjust" }
installreferrer = { group = "com.android.installreferrer", name = "installreferrer", version.ref = "installreferrer" }
5 changes: 3 additions & 2 deletions mobile/android/android-components/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildscript {
}

// Variables in plugins {} aren't directly supported. Hack around it by setting an
// intermediate variable which can pull from FenixDependencies.kt and be used later.
// intermediate variable which can pull from DependenciesPlugin.kt and be used later.
ext {
detekt_plugin = Versions.detekt
python_envs_plugin = Versions.python_envs_plugin
Expand Down Expand Up @@ -63,8 +63,9 @@ subprojects {
kotlinOptions.allWarningsAsErrors = true
}

// Prevent some dependencies from being used in AC.
// Prevent some dependencies used by Fenix/Focus from being used in AC.
project.configurations.all {
exclude group: 'com.adjust.sdk', module: 'adjust-android'
exclude group: 'io.mockk', module: 'mockk'
}

Expand Down
4 changes: 2 additions & 2 deletions mobile/android/fenix/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ dependencies {
implementation ComponentsDependencies.protobuf_javalite
implementation ComponentsDependencies.google_material

implementation FenixDependencies.adjust
implementation FenixDependencies.installreferrer // Required by Adjust
implementation(libs.adjust)
implementation(libs.installreferrer)

// Required for the Google Advertising ID
implementation ComponentsDependencies.play_services_ads_id
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/fenix/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ buildscript {
}

// Variables in plugins {} aren't directly supported. Hack around it by setting an
// intermediate variable which can pull from FenixDependenciesPlugin.kt and be used later.
// intermediate variable which can pull from DependenciesPlugin.kt and be used later.
ext {
detekt_plugin = Versions.detekt
ksp_plugin = Versions.ksp_plugin
Expand Down
25 changes: 0 additions & 25 deletions mobile/android/fenix/plugins/fenixdependencies/build.gradle

This file was deleted.

23 changes: 0 additions & 23 deletions mobile/android/fenix/plugins/fenixdependencies/settings.gradle

This file was deleted.

This file was deleted.

10 changes: 8 additions & 2 deletions mobile/android/fenix/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,22 @@ pluginManagement {
includeBuild("../android-components/plugins/dependencies")
includeBuild("../android-components/plugins/config")
includeBuild("./plugins/apksize")
includeBuild("./plugins/fenixdependencies")
}

plugins {
id 'ApkSizePlugin'
id 'FenixDependenciesPlugin'
id "mozac.ConfigPlugin"
id 'mozac.DependenciesPlugin'
}

dependencyResolutionManagement {
versionCatalogs {
libs {
from(files("../../../gradle/libs.versions.toml"))
}
}
}

ext.topsrcdir = rootProject.projectDir.absolutePath.minus("mobile/android/fenix")

apply from: file('../shared-settings.gradle')
Expand Down
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ pluginManagement {
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/dependencies")
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/android-components/plugins/publicsuffixlist")
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/fenix/plugins/apksize")
includeBuild("${rootProject.projectDir.absolutePath}/mobile/android/fenix/plugins/fenixdependencies")
}

plugins {
id "mozac.ConfigPlugin"
id 'mozac.DependenciesPlugin'
id 'ApkSizePlugin'
id 'FenixDependenciesPlugin'
}

// You might think topsrcdir is '.', but that's not true when the Gradle build
Expand Down
1 change: 0 additions & 1 deletion taskcluster/kinds/toolchain/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ linux64-android-gradle-dependencies:
- 'mobile/android/gradle.configure'
- 'mobile/android/android-components/plugins/dependencies/src/main/java/DependenciesPlugin.kt'
- 'mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt'
- 'mobile/android/fenix/plugins/fenixdependencies/src/main/java/FenixDependenciesPlugin.kt'
toolchain-artifact: public/build/android-gradle-dependencies.tar.zst
toolchain-alias: android-gradle-dependencies
fetches:
Expand Down

0 comments on commit 5ac5fd0

Please sign in to comment.