iamantoniodinuzzo / CineMates

CineMates is a modern android application for movie fans in which you will be able to search for movies and consult information provided by The Movie DB.
GNU General Public License v3.0
15 stars 3 forks source link

Implement Version Catalog #193

Closed iamantoniodinuzzo closed 1 year ago

iamantoniodinuzzo commented 1 year ago

Is there a project named like this repo?

Is your feature request related to a problem? Please describe.

At the moment all dependencies are handled in the classic way, that is, by putting them in the gradle.build, using the Version Catalog it will be easier to manage dependencies and update them also thanks to dependabot

Version Catalog Roadmap

  1. Update gradle to version 7.4.2 with the following command run from terminal:
     ./gradle wrapper --gradle-version 7.4.2
  2. In the project view , in the gradle folder enter the file libs.versions.toml.
  3. Within this file, organize the variables as follows:
     #In the versions block, define variables that hold the versions of your dependencies and plugins.
     #You use these variables in the subsequent blocks (the versions and plugins blocks)
     [versions]
     ktx = "1.10.0"
     retrofit = "2.9.0"
     androidGradlePlugin = "7.3.1"
     #In the libraries block, define your dependencies.
     [libaries]
     androidx-ktx = { module = "androidx.core:core-ktx", version.ref = "ktx" }
     retrofit-core = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
     retrofit-converter = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
     retrofit-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "logging" }
     #Grouop of libraries, not plugins
     [bundle]
     retrofit = ["retrofit.core", "retrofit.converter", "retrofit.logging"]
     #In the plugins block, define your plugins.
     [plugins]
     android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
  4. Once the file is created, you need to redefine the dependencies and plugins as follows:
        dependencies{
          implementation(libs.androidx.ktx)
          //Retrofit
          implementation(libs.bundles.retrofit) 
         //other...
        }
  5. For plugins, on the other hand, we will operate as follows:
     plugins{
        alias(libs.plugins.android.application) apply false
        //other...
      }

Describe alternatives you have considered.

No response

Additional Context

No response