xgouchet / Stanley

An Android app explorer for developers (extract the manifest and other info from any installed application)
Other
94 stars 32 forks source link

Use Gradle Version Catalog #67

Closed xgouchet closed 1 year ago

xgouchet commented 1 year ago

Gradle now provides a built-in mecanism to setup the dependency.

fejd commented 1 year ago

I'd like to work on this one.

In Dependencies.kt there are a couple of unused dependencies. Should I do some cleanup and skip these in the version catalog transition?

xgouchet commented 1 year ago

Hi @fejd , thanks a lot for your help. Yes there are a bunch of legacy dependencies there, so feel free to cleanup all the unused ones.

fejd commented 1 year ago

Almost done, however I ran into this issue https://github.com/gradle/gradle/issues/20084 when I tried to put the com.android.application plugin inside a plugins { } block. That clashes with the buildSrc dependency implementation 'com.android.tools.build:gradle:7.3.0' which gives the error:

What went wrong: Error resolving plugin [id: 'com.android.application', version: '7.3.0', apply: false] 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.

If I comment that out, and the usage in OSSPlugin.kt, it builds. Not a solution though. 😃 I'm thinking of just moving the other dependencies to the version catalog, and keeping apply plugin: 'com.android.application' for now since it requires additional changes. What do you think @xgouchet ?

xgouchet commented 1 year ago

I'm thinking of just moving the other dependencies to the version catalog, and keeping apply plugin: 'com.android.application' for now since it requires additional changes.

Sure that makes sense indeed.

But before have you tried the workardound given in the linked issue:

plugins {
  id(libs.plugins.android.application.get().pluginId) apply false
  id(libs.plugins.android.library.get().pluginId) apply false
  id(libs.plugins.kotlin.android.get().pluginId) apply false
}
fejd commented 1 year ago

I'm thinking of just moving the other dependencies to the version catalog, and keeping apply plugin: 'com.android.application' for now since it requires additional changes.

Sure that makes sense indeed.

But before have you tried the workardound given in the linked issue:

plugins {
  id(libs.plugins.android.application.get().pluginId) apply false
  id(libs.plugins.android.library.get().pluginId) apply false
  id(libs.plugins.kotlin.android.get().pluginId) apply false
}

Yes, unfortunately the Groovy version of that makes no difference:

plugins { alias libs.plugins.android.application apply false }