-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(WIP) -- Migrating Build.Gradle
to Version Catlog
#21029
base: trunk
Are you sure you want to change the base?
(WIP) -- Migrating Build.Gradle
to Version Catlog
#21029
Conversation
Version Catlog
Version Catlog
@@ -390,143 +390,146 @@ dependencies { | |||
} | |||
} | |||
|
|||
implementation ("com.automattic:rest:$automatticRestVersion") { | |||
implementation (libs.automatticRest) { | |||
exclude group: 'com.mcxiaoke.volley' | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what exclude type of dependency working is it over here?
For this I have used version catlog declaration as usual group , name, version no
automatticRest = { group = "com.automattic", name = "rest", version.ref = "automatticRestVersion" }
But at some place its requiring Module Declaration and why is that so I didnt found much of it online.
For example at Line No 458, for using ucrop normal version catlog declaration it was giving error it required me to used module. So my main question is when to use modules?
ucrop = { module = "com.github.yalantis:ucrop", version.ref = "uCropVersion" }
implementation (libs.ucrop) {
exclude group: 'androidx.core', module: 'core'
exclude group: 'androidx.constraintlayout', module: 'constraintlayout'
exclude group: 'androidx.appcompat', module: 'appcompat'
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @neeldoshii , please don't worry about these, all this dependency configuration shouldn't affect your work with version catalogs. As such, just like you did with libs.ucrop
, I suggest updating the dependency to version catalogs but keeping the extra configuration unchanged.
FYI: The exclude group
vs. group
+ module
diff is just that:
- When using exclude
group
only, then you instruct the dependency to exclude all dependencies from the specified group, regardless of the module name. Think multiple dependencies with the same group name. - When using exclude
group
+module
, then you instruct the dependency to exclude only the specific module of that specific group.
I hope that helps? 🙏
Version Catlog
Build.Gradle
to Version Catlog
Patch Subject: [PATCH] Plugin Migration Throws Error
---
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/gradle/libs.versions.toml (date 1720040180034)
@@ -68,6 +68,7 @@
androidxViewpager2Version = '1.0.0'
squareupKotlinPoetVersion = '1.16.0'
+agpVersion = '8.1.0'
[libraries]
androidxWebkit = { group = "androidx.webkit", name = "webkit", version.ref = "webkit" }
@@ -217,4 +218,6 @@
[plugins]
+androidApplication = { id = "com.android.application", version.ref = "agpVersion"}
+androidLibrary = { id = "com.android.library", version.ref = "agpVersion"}
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/settings.gradle (date 1720037125923)
@@ -1,7 +1,7 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.9.22'
gradle.ext.kspVersion = '1.9.22-1.0.17'
- gradle.ext.agpVersion = '8.1.0'
+ //gradle.ext.agpVersion = '8.1.0'
gradle.ext.googleServicesVersion = '4.3.15'
gradle.ext.navigationVersion = '2.7.7'
gradle.ext.sentryVersion = '4.3.1'
@@ -18,8 +18,8 @@
id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
- id "com.android.application" version gradle.ext.agpVersion
- id "com.android.library" version gradle.ext.agpVersion
+ alias(libs.plugins.androidApplication)
+ alias(libs.plugins.androidLibrary)
id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
id "androidx.navigation.safeargs.kotlin" version gradle.ext.navigationVersion
id "io.sentry.android.gradle" version gradle.ext.sentryVersion Error : A problem occurred evaluating settings 'WordPress-Android'.
I am little confused over why is plugins throwing error. Its my first time working on module gradle builds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 @neeldoshii and thanks for this contribution!
I have reviewed this draft and also tried to make the plugins
libs working, timeboxing my efforts for now, here my advise to you:
- Suggestion (💡): Let's focus on introducing
Version Catalogs
forlibraries
only. I think that migratingplugins
toVersion Catalogs
might require some additional effort and extra Gradle build knowledge as this repo and its Gradle configuration is not that straightforward*. - Warning (
⚠️ ): First, try and study first this nowinandroid and other such open-source repositories, that is, theirVersion Catalogs
configuration. You will notice a few patterns there. I want us to bring these patterns into this repo as well. For example:- Notice that every version there is defined in an alphabetical order, you need to reorder ours.
- Notice that every version there is defined in camel-case format, you did that, great! ✅
- Notice that every version there is defined without the
Version
suffix, you can drop it too. - Notice that every library these is defined in an alphabetical order, you need to reorder ours.
- Notice that every library these is defined in dash-case, you need to change the camel-case format to dash-case.
- Finally, there is no need to group version or libraries in some kind of logical way, let's keep it simple for now and optimize later, just order them alphabetical.
- Suggestion (💡): You did it all in a single commit, this makes it a bit difficult for a reviewer to verify that everything was done appropriately and nothing got slipped in or out. As such, please consider moving each dependency into
Version Catalogs
on a separate commit. Take this work here as an example, you should probably try a similar strategy. I am suggesting that because looking at diffs like this doesn't make it easy for a reviewer, each line doesn't correspond to a specific migration change, thus it is quite easy to make mistakes, both during development and while reviewing.
I hope the above will help guide you with this migration effort, one step at a time. I am here to support you all the way! 🙏
(*): I quickly tried migrating plugins
too but got stuck on this exception below and couldn't progress any further:
Error resolving plugin [id: 'com.android.application', version: '8.1.0']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
Btw @neeldoshii , this patch that you shared wouldn't work. With As per my review comment above please try looking at how other projects have dealt with this migration and see if you can move forward. 🤞 |
@neeldoshii btw, with help from @wzieba (🙇) I managed to make Expand to PatchSubject: [PATCH] Working Plugins Migration
---
Index: libs/processors/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/processors/build.gradle b/libs/processors/build.gradle
--- a/libs/processors/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/processors/build.gradle (date 1720098732780)
@@ -1,6 +1,6 @@
plugins {
- id "org.jetbrains.kotlin.jvm"
- id "org.jetbrains.kotlinx.kover"
+ alias(libs.plugins.kotlin.jvm)
+ alias(libs.plugins.kover)
}
sourceCompatibility = JavaVersion.VERSION_1_8
@@ -11,12 +11,12 @@
implementation libs.squareupKotlinPoet
implementation libs.squareupKotlinPoetKsp
- implementation "com.google.devtools.ksp:symbol-processing-api:$gradle.ext.kspVersion"
+ implementation libs.ksp.sympol.processing.api
def kctVersion = "1.5.0"
testImplementation "com.github.tschuchortdev:kotlin-compile-testing:$kctVersion"
testImplementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:$kctVersion"
testImplementation libs.junit
testImplementation libs.assertj
- testImplementation "org.jetbrains.kotlin:kotlin-reflect:$gradle.ext.kotlinVersion"
+ testImplementation libs.kotlin.reflect
}
Index: libs/networking/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle
--- a/libs/networking/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/networking/build.gradle (date 1720097537135)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
android {
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/settings.gradle (date 1720098074784)
@@ -1,36 +1,4 @@
pluginManagement {
- gradle.ext.kotlinVersion = '1.9.22'
- gradle.ext.kspVersion = '1.9.22-1.0.17'
- gradle.ext.agpVersion = '8.1.0'
- gradle.ext.googleServicesVersion = '4.3.15'
- gradle.ext.navigationVersion = '2.7.7'
- gradle.ext.sentryVersion = '4.3.1'
- gradle.ext.daggerVersion = "2.50"
- gradle.ext.detektVersion = '1.23.0'
- gradle.ext.violationCommentsVersion = '1.70.0'
- gradle.ext.measureBuildsVersion = '2.1.2'
- gradle.ext.koverVersion = '0.7.5'
- gradle.ext.dependencyAnalysisVersion = '1.28.0'
-
- plugins {
- id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
- id "com.android.application" version gradle.ext.agpVersion
- id "com.android.library" version gradle.ext.agpVersion
- id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
- id "androidx.navigation.safeargs.kotlin" version gradle.ext.navigationVersion
- id "io.sentry.android.gradle" version gradle.ext.sentryVersion
- id "io.gitlab.arturbosch.detekt" version gradle.ext.detektVersion
- id "se.bjurr.violations.violation-comments-to-github-gradle-plugin" version gradle.ext.violationCommentsVersion
- id 'com.automattic.android.measure-builds' version gradle.ext.measureBuildsVersion
- id "org.jetbrains.kotlinx.kover" version gradle.ext.koverVersion
- id "com.google.dagger.hilt.android" version gradle.ext.daggerVersion
- id "com.google.devtools.ksp" version gradle.ext.kspVersion
- id "com.autonomousapps.dependency-analysis" version gradle.ext.dependencyAnalysisVersion
- }
repositories {
maven {
url 'https://a8c-libs.s3.amazonaws.com/android'
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/WordPress/build.gradle (date 1720098452773)
@@ -3,16 +3,16 @@
import se.bjurr.violations.lib.model.SEVERITY
plugins {
- id "com.android.application"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
- id "org.jetbrains.kotlin.plugin.allopen"
- id "io.sentry.android.gradle"
- id "se.bjurr.violations.violation-comments-to-github-gradle-plugin"
- id "com.google.gms.google-services"
- id "com.google.dagger.hilt.android"
- id "org.jetbrains.kotlinx.kover"
- id "com.google.devtools.ksp"
+ alias(libs.plugins.android.application)
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
+ alias(libs.plugins.kotlin.allopen)
+ alias(libs.plugins.sentry)
+ alias(libs.plugins.violation.comments)
+ alias(libs.plugins.google.services)
+ alias(libs.plugins.dagger)
+ alias(libs.plugins.kover)
+ alias(libs.plugins.ksp)
}
sentry {
@@ -474,10 +474,10 @@
implementation (libs.googleExoPlayer) {
exclude group: 'com.android.support', module: 'support-annotations'
}
- implementation "com.google.dagger:dagger-android-support:$gradle.ext.daggerVersion"
- ksp "com.google.dagger:dagger-android-processor:$gradle.ext.daggerVersion"
- implementation "com.google.dagger:hilt-android:$gradle.ext.daggerVersion"
- ksp "com.google.dagger:hilt-compiler:$gradle.ext.daggerVersion"
+ implementation libs.dagger.android.support
+ ksp libs.dagger.android.processor
+ implementation libs.dagger.hilt.android
+ ksp libs.dagger.hilt.compiler
testImplementation(libs.androidxCoreTesting, {
exclude group: 'com.android.support', module: 'support-compat'
@@ -486,7 +486,7 @@
})
testImplementation libs.junit
testImplementation libs.mockitoKotlin
- testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$gradle.ext.kotlinVersion"
+ testImplementation libs.kotlin.test.junit
testImplementation libs.assertj
testImplementation libs.kotlinxCoroutinesTest
@@ -530,8 +530,8 @@
}
androidTestImplementation (name:'cloudtestingscreenshotter_lib', ext:'aar') // Screenshots on Firebase Cloud Testing
androidTestImplementation libs.androidxWorkManagerTesting
- androidTestImplementation "com.google.dagger:hilt-android-testing:$gradle.ext.daggerVersion"
- kspAndroidTest "com.google.dagger:hilt-android-compiler:$gradle.ext.daggerVersion"
+ androidTestImplementation libs.dagger.hilt.android.testing
+ kspAndroidTest libs.dagger.hilt.android.compiler
// Enables Java 8+ API desugaring support
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$androidDesugarVersion"
lintChecks "org.wordpress:lint:$wordPressLintVersion"
Index: libs/annotations/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/annotations/build.gradle b/libs/annotations/build.gradle
--- a/libs/annotations/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/annotations/build.gradle (date 1720097537133)
@@ -1,5 +1,5 @@
plugins {
- id "org.jetbrains.kotlin.jvm"
+ alias(libs.plugins.kotlin.jvm)
}
sourceCompatibility = JavaVersion.VERSION_1_8
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/build.gradle (date 1720099117001)
@@ -2,15 +2,18 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
- id "io.gitlab.arturbosch.detekt"
- id 'com.automattic.android.measure-builds'
- id "org.jetbrains.kotlinx.kover"
- id "com.autonomousapps.dependency-analysis"
- id "androidx.navigation.safeargs.kotlin" apply false
- id "com.android.library" apply false
- id 'com.google.gms.google-services' apply false
- id "org.jetbrains.kotlin.plugin.parcelize" apply false
- id "com.google.devtools.ksp" apply false
+ alias(libs.plugins.detekt)
+ alias(libs.plugins.measure.builds)
+ alias(libs.plugins.kover)
+ alias(libs.plugins.dependency.analysis)
+ alias(libs.plugins.navigation.safeargs).apply(false)
+ alias(libs.plugins.android.application).apply(false)
+ alias(libs.plugins.android.library).apply(false)
+ alias(libs.plugins.google.services).apply(false)
+ alias(libs.plugins.kotlin.android).apply(false)
+ alias(libs.plugins.kotlin.jvm).apply(false)
+ alias(libs.plugins.kotlin.parcelize).apply(false)
+ alias(libs.plugins.ksp).apply(false)
}
ext {
@@ -95,7 +98,7 @@
}
detekt {
- toolVersion = gradle.ext.detektVersion
+// toolVersion = gradle.ext.detektVersion
baseline = file("${project.rootDir}/config/detekt/baseline.xml")
config = files("${project.rootDir}/config/detekt/detekt.yml")
autoCorrect = false
@@ -185,7 +188,7 @@
}
dependencies {
- detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:$gradle.ext.detektVersion"
+ detektPlugins libs.detekt.formatting
}
apply from: './config/gradle/code_coverage.gradle'
Index: libs/analytics/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle
--- a/libs/analytics/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/analytics/build.gradle (date 1720097537133)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
repositories {
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/image-editor/build.gradle (date 1720098586091)
@@ -1,9 +1,9 @@
plugins {
- id "com.android.library"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
- id "androidx.navigation.safeargs.kotlin"
- id "org.jetbrains.kotlinx.kover"
+ alias(libs.plugins.android.library)
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
+ alias(libs.plugins.navigation.safeargs)
+ alias(libs.plugins.kover)
}
android {
@@ -56,8 +56,8 @@
implementation libs.androidxConstraintLayout
implementation libs.androidxViewpager2
implementation libs.googleMaterial
- implementation "androidx.navigation:navigation-fragment:$gradle.ext.navigationVersion"
- implementation "androidx.navigation:navigation-ui:$gradle.ext.navigationVersion"
+ implementation libs.navigation.fragment
+ implementation libs.navigation.ui
implementation libs.lifecycleCommon
implementation libs.lifecycleRuntime
implementation libs.lifecycleViewmodel
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/gradle/libs.versions.toml (date 1720099054787)
@@ -1,4 +1,17 @@
[versions]
+agp = "8.1.0"
+dagger = "2.50"
+dependencyAnalysis = "1.28.0"
+detekt = "1.23.0"
+googleServices = "4.3.15"
+kotlin = "1.9.22"
+kover = "0.7.5"
+ksp = "1.9.22-1.0.17"
+measureBuilds = "2.1.2"
+navigation = "2.7.7"
+sentry = "4.3.1"
+violationComments = "1.70.0"
+
#libs
webkit = '1.11.0'
androidxComposeNavigationVersion = '2.7.6'
@@ -70,6 +83,19 @@
[libraries]
+dagger-android-support = { group = "com.google.dagger", name = "dagger-android-support", version.ref = "dagger" }
+dagger-android-processor = { group = "com.google.dagger", name = "dagger-android-processor", version.ref = "dagger" }
+dagger-hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "dagger" }
+dagger-hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "dagger" }
+dagger-hilt-android-testing = { group = "com.google.dagger", name = "hilt-android-testing", version.ref = "dagger" }
+dagger-hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "dagger" }
+detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }
+kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
+kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
+ksp-sympol-processing-api = { group = "com.google.devtools.ksp", name = "symbol-processing-api", version.ref = "ksp" }
+navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "navigation" }
+navigation-ui = { group = "androidx.navigation", name = "navigation-ui", version.ref = "navigation" }
+
androidxWebkit = { group = "androidx.webkit", name = "webkit", version.ref = "webkit" }
androidxNavigation = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxComposeNavigationVersion" }
automatticRest = { group = "com.automattic", name = "rest", version.ref = "automatticRestVersion" }
@@ -203,18 +229,20 @@
squareupKotlinPoet = { group = "com.squareup", name = "kotlinpoet", version.ref ="squareupKotlinPoetVersion" }
squareupKotlinPoetKsp = { group = "com.squareup", name = "kotlinpoet-ksp", version.ref ="squareupKotlinPoetVersion" }
-
-
-
-
-
-
-
-
-
-
-
-
-
[plugins]
-
+android-application = { id = "com.android.application", version.ref = "agp" }
+android-library = { id = "com.android.library", version.ref = "agp" }
+dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
+dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
+detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
+google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
+kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
+kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
+kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
+ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
+measure-builds = { id = "com.automattic.android.measure-builds", version.ref = "measureBuilds" }
+navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navigation" }
+sentry = { id = "io.sentry.android.gradle", version.ref = "sentry" }
+violation-comments = { id = "se.bjurr.violations.violation-comments-to-github-gradle-plugin", version.ref = "violationComments" }
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/editor/build.gradle (date 1720097537134)
@@ -1,8 +1,8 @@
plugins {
- id "com.android.library"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
- id "org.jetbrains.kotlinx.kover"
+ alias(libs.plugins.android.library)
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
+ alias(libs.plugins.kover)
}
repositories {
Index: libs/mocks/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle
--- a/libs/mocks/build.gradle (revision 549f6797d154f7958ec8a14c25923fb144f04d22)
+++ b/libs/mocks/build.gradle (date 1720097537134)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
android {
FYI: This is just as an FYI on how you can make this work and maybe help you unblock. PS: It seems that the |
Hi @ParaskP7 👋
|
This reverts commit 549f679.
Note that webkit dependency was declared twice so removed the duplicate
…Naming Convention
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
dd635da
to
69ca4aa
Compare
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Co-Authored-By: Petros Paraskevopoulos <9729923+ParaskP7@users.noreply.github.com> Co-Authored-By: Wojciech Zięba <wojciech.zieba@protonmail.com>
Almost done with the migration. Same error which you mentioned above is blocking the plugin migration of kotlin and AFP to be completed. Kotlin Plugin Error Kotlin Error Log
Patch: Kotlin PatchSubject: [PATCH] Kotlin Plugin Error
---
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/WordPress/build.gradle (date 1720295395127)
@@ -4,9 +4,9 @@
plugins {
id "com.android.application"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
- id "org.jetbrains.kotlin.plugin.allopen"
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
+ alias(libs.plugins.kotlin.allopen)
alias(libs.plugins.sentry)
alias(libs.plugins.violation.comments)
id "com.google.gms.google-services"
@@ -482,7 +482,7 @@
})
testImplementation libs.junit
testImplementation libs.mockito.kotlin
- testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$gradle.ext.kotlinVersion"
+ testImplementation libs.kotlin.test
testImplementation libs.assertj.core
testImplementation libs.kotlinx.coroutines.test
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/gradle/libs.versions.toml (date 1720295095545)
@@ -53,6 +53,7 @@
indexosMediaForMobile = '43a9026f0973a2f0a74fa813132f6a16f7499c3a'
jsoup = '1.16.2'
junit = '4.13.2'
+kotlin = '1.9.22'
kotlinxCoroutines = '1.7.3'
kover = "0.7.5"
ksp = "1.9.22-1.0.17"
@@ -205,11 +206,18 @@
wiremock-httpclient-android = { group = "org.apache.httpcomponents", name = "httpclient-android", version.ref ="wiremockHttpClient" }
wordPress-persistentEditText = { group = "org.wordpress", name = "persistentedittext", version.ref = "wordPressPersistentEditText" }
zendesk = { group = "com.zendesk", name = "support", version.ref ="zendesk" }
+kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
+kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
+
[plugins]
dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
+kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
+kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
+kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
measure-builds = { id = "com.automattic.android.measure-builds", version.ref = "measureBuilds" }
Index: libs/processors/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/processors/build.gradle b/libs/processors/build.gradle
--- a/libs/processors/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/processors/build.gradle (date 1720294963020)
@@ -1,5 +1,5 @@
plugins {
- id "org.jetbrains.kotlin.jvm"
+ alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kover)
}
@@ -18,5 +18,5 @@
testImplementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:$kctVersion"
testImplementation libs.junit
testImplementation libs.assertj.core
- testImplementation "org.jetbrains.kotlin:kotlin-reflect:$gradle.ext.kotlinVersion"
+ testImplementation libs.kotlin.reflect
}
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/build.gradle (date 1720295440359)
@@ -9,7 +9,7 @@
alias(libs.plugins.navigation.safeargs).apply(false)
id "com.android.library" apply false
id 'com.google.gms.google-services' apply false
- id "org.jetbrains.kotlin.plugin.parcelize" apply false
+ alias(libs.plugins.kotlin.parcelize).apply(false)
alias(libs.plugins.ksp).apply(false)
}
Index: libs/annotations/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/annotations/build.gradle b/libs/annotations/build.gradle
--- a/libs/annotations/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/annotations/build.gradle (date 1720294724011)
@@ -1,5 +1,5 @@
plugins {
- id "org.jetbrains.kotlin.jvm"
+ alias(libs.plugins.kotlin.jvm)
}
sourceCompatibility = JavaVersion.VERSION_1_8
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/settings.gradle (date 1720294724007)
@@ -1,14 +1,8 @@
pluginManagement {
- gradle.ext.kotlinVersion = '1.9.22'
gradle.ext.agpVersion = '8.1.0'
gradle.ext.googleServicesVersion = '4.3.15'
plugins {
- id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
- id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
id "com.android.application" version gradle.ext.agpVersion
id "com.android.library" version gradle.ext.agpVersion
id 'com.google.gms.google-services' version gradle.ext.googleServicesVersion
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/image-editor/build.gradle (date 1720294724009)
@@ -1,7 +1,7 @@
plugins {
id "com.android.library"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.navigation.safeargs)
alias(libs.plugins.kover)
}
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle (revision f9371b604d4df2b355cd598ac88638059c084c6f)
+++ b/libs/editor/build.gradle (date 1720294724002)
@@ -1,7 +1,7 @@
plugins {
id "com.android.library"
- id "org.jetbrains.kotlin.android"
- id "org.jetbrains.kotlin.plugin.parcelize"
+ alias(libs.plugins.kotlin.android)
+ alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kover)
} AGP Error AGP Error Log
Patch Agp PatchSubject: [PATCH] AGP Plugin Error
---
Index: WordPress/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/WordPress/build.gradle b/WordPress/build.gradle
--- a/WordPress/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/WordPress/build.gradle (date 1720295975159)
@@ -3,7 +3,7 @@
import se.bjurr.violations.lib.model.SEVERITY
plugins {
- id "com.android.application"
+ alias(libs.plugins.android.application)
id "org.jetbrains.kotlin.android"
id "org.jetbrains.kotlin.plugin.parcelize"
id "org.jetbrains.kotlin.plugin.allopen"
Index: gradle/libs.versions.toml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
--- a/gradle/libs.versions.toml (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/gradle/libs.versions.toml (date 1720295975161)
@@ -1,4 +1,5 @@
[versions]
+agp = '8.1.0'
androidInstallReferrer = '2.2'
androidxActivity = '1.8.0'
androidxAppcompat = '1.6.1'
@@ -208,6 +209,8 @@
zendesk = { group = "com.zendesk", name = "support", version.ref ="zendesk" }
[plugins]
+android-application = { id = "com.android.application", version.ref = "agp" }
+android-library = { id = "com.android.library", version.ref = "agp" }
dagger = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version.ref = "dependencyAnalysis" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
Index: build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build.gradle b/build.gradle
--- a/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/build.gradle (date 1720296082286)
@@ -7,7 +7,7 @@
alias(libs.plugins.kover)
alias(libs.plugins.dependency.analysis)
alias(libs.plugins.navigation.safeargs).apply(false)
- id "com.android.library" apply false
+ alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.google.services).apply(false)
id "org.jetbrains.kotlin.plugin.parcelize" apply false
alias(libs.plugins.ksp).apply(false)
Index: libs/analytics/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/analytics/build.gradle b/libs/analytics/build.gradle
--- a/libs/analytics/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/analytics/build.gradle (date 1720296082280)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
repositories {
Index: settings.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/settings.gradle b/settings.gradle
--- a/settings.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/settings.gradle (date 1720296082287)
@@ -1,6 +1,6 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.9.22'
- gradle.ext.agpVersion = '8.1.0'
+// gradle.ext.agpVersion = '8.1.0'
plugins {
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
@@ -8,8 +8,6 @@
id "org.jetbrains.kotlin.plugin.serialization" version gradle.ext.kotlinVersion
id "org.jetbrains.kotlin.plugin.parcelize" version gradle.ext.kotlinVersion
id "org.jetbrains.kotlin.plugin.allopen" version gradle.ext.kotlinVersion
- id "com.android.application" version gradle.ext.agpVersion
- id "com.android.library" version gradle.ext.agpVersion
}
repositories {
maven {
Index: libs/image-editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/image-editor/build.gradle b/libs/image-editor/build.gradle
--- a/libs/image-editor/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/image-editor/build.gradle (date 1720296082288)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
id "org.jetbrains.kotlin.android"
id "org.jetbrains.kotlin.plugin.parcelize"
alias(libs.plugins.navigation.safeargs)
Index: libs/editor/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/editor/build.gradle b/libs/editor/build.gradle
--- a/libs/editor/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/editor/build.gradle (date 1720296082282)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
id "org.jetbrains.kotlin.android"
id "org.jetbrains.kotlin.plugin.parcelize"
alias(libs.plugins.kover)
Index: libs/networking/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/networking/build.gradle b/libs/networking/build.gradle
--- a/libs/networking/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/networking/build.gradle (date 1720296082284)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
android {
Index: libs/mocks/build.gradle
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libs/mocks/build.gradle b/libs/mocks/build.gradle
--- a/libs/mocks/build.gradle (revision fedc84d90abb47c0c7b19745af54953fb3744b4f)
+++ b/libs/mocks/build.gradle (date 1720296082283)
@@ -1,5 +1,5 @@
plugins {
- id "com.android.library"
+ alias(libs.plugins.android.library)
}
android { |
FollowUp TODO once the version catalog gets migrated.
exoplayer library says
Wdyt? |
Description
This PR focuses currently on migrating our gradle files to newly introduced
version catlog
. Currently this PR is WIP the plugin are yet to be migrated as well some dependency.I have relied on and trusting everything working fine by performing unit test. Trusting CI ATM.
Checklist [TODO]