Merhabalar Gradle refreshVersions versiyon yönetimi ve gruplama yapabileceğimiz kütüphanedir.

Niçin Kullanmalıyız ?

  • Tüm bağımlılıkları (dependencies) merkezileştirme ve gruplama sağlar.
  • Bağımlılıkların (dependencies) en güncel sürümlerine hızlı erişim sağlar
  • Projemizde sürüm güncellemelerimiz için uzun uzadıya Google’da tek tek bağımlılıkların en güncel sürümleri aramamıza gerek kalmıyor.
  • Projemizde tüm bağımlıklarımızı en güncel ve kararlı sürümlere yükseltebiliriz.

Gereksinimler

  • Gradle 6.8+
  • IntelliJ IDEA or Android Studio

Kurulum

Settings.gradle :

Eklenmesi Gerekenler :

plugins {
        id("de.fayard.refreshVersions") version "0.51.0"
    }
plugins {
    id("de.fayard.refreshVersions")
}

Eklendikten Sonra :

pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
    plugins {

        id("de.fayard.refreshVersions") version "0.51.0"
    }


}

plugins {
    id("de.fayard.refreshVersions")
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.name = "Sample Project Name"
include ':app'

Otomatik versiyon kontrol kurulum

Terminal :

 ./gradlew refreshVersionsMigrate --mode=VersionsPropertiesOnly

Bu işlem sonrasında versions.properties dosyası otomatik projenize oluşturulur. Proje görünümünü ‘Project’ olarak değiştirerek erişebilirsiniz.

versions.properties :

#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.51.0
####
#### Don't manually edit or split the comments that start with four hashtags (####),
#### they will be overwritten by refreshVersions.
####
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file



version.org.jacoco..org.jacoco.ant=0.8.7

version.kotlin=1.6.10

version.junit.junit=4.13.2

version.androidx.test.ext.junit=1.1.4

version.androidx.test.espresso=3.5.0

version.androidx.lifecycle=2.3.1

version.androidx.core=1.7.0

version.androidx.compose.ui=1.1.1

version.androidx.compose.material=1.1.1

version.androidx.compose.compiler=1.1.1

version.androidx.activity=1.3.1

plugin.android=7.3.1

Şimdi bağımlılıklar eklendi tek bir dosyada ve biz bunların güncel sürümlerinin ne olduklarını görmek istiyoruz.

Terminal

./gradlew refreshVersions

Komut çalıştırdıktan sonra dosyamız aşağıdaki gibi görünecektir.

versions.properties :

#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.51.0
####
#### Don't manually edit or split the comments that start with four hashtags (####),
#### they will be overwritten by refreshVersions.
####
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file

## unused
version.org.jacoco..org.jacoco.ant=0.8.7

version.kotlin=1.6.10
## # available=1.6.20-M1
## # available=1.6.20-RC
## # available=1.6.20-RC2
## # available=1.6.20
## # available=1.6.21
## # available=1.7.0-Beta
## # available=1.7.0-RC
## # available=1.7.0-RC2
## # available=1.7.0
## # available=1.7.10
## # available=1.7.20-Beta
## # available=1.7.20-RC
## # available=1.7.20
## # available=1.7.21
## # available=1.7.22
## # available=1.8.0-Beta
## # available=1.8.0-RC
## # available=1.8.0-RC2

version.junit.junit=4.13.2

version.androidx.test.ext.junit=1.1.4

version.androidx.test.espresso=3.5.0

version.androidx.lifecycle=2.3.1
##             # available=2.4.0-alpha01
##             # available=2.4.0-alpha02
##             # available=2.4.0-alpha03
##             # available=2.4.0-beta01
##             # available=2.4.0-rc01
##             # available=2.4.0
##             # available=2.4.1
##             # available=2.5.0-alpha01
##             # available=2.5.0-alpha02
##             # available=2.5.0-alpha03
##             # available=2.5.0-alpha04
##             # available=2.5.0-alpha05
##             # available=2.5.0-alpha06
##             # available=2.5.0-beta01
##             # available=2.5.0-rc01
##             # available=2.5.0-rc02
##             # available=2.5.0
##             # available=2.5.1
##             # available=2.6.0-alpha01
##             # available=2.6.0-alpha02
##             # available=2.6.0-alpha03

version.androidx.core=1.7.0
##        # available=1.8.0-alpha01
##        # available=1.8.0-alpha02
##        # available=1.8.0-alpha03
##        # available=1.8.0-alpha04
##        # available=1.8.0-alpha05
##        # available=1.8.0-alpha06
##        # available=1.8.0-alpha07
##        # available=1.8.0-beta01
##        # available=1.8.0-rc01
##        # available=1.8.0-rc02
##        # available=1.8.0
##        # available=1.9.0-alpha01
##        # available=1.9.0-alpha02
##        # available=1.9.0-alpha03
##        # available=1.9.0-alpha04
##        # available=1.9.0-alpha05
##        # available=1.9.0-beta01
##        # available=1.9.0-rc01
##        # available=1.9.0

version.androidx.compose.ui=1.1.1
##              # available=1.2.0-alpha01
##              # available=1.2.0-alpha02
##              # available=1.2.0-alpha03
##              # available=1.2.0-alpha04
##              # available=1.2.0-alpha05
##              # available=1.2.0-alpha06
##              # available=1.2.0-alpha07
##              # available=1.2.0-alpha08
##              # available=1.2.0-beta01
##              # available=1.2.0-beta02
##              # available=1.2.0-beta03
##              # available=1.2.0-rc01
##              # available=1.2.0-rc02
##              # available=1.2.0-rc03
##              # available=1.2.0
##              # available=1.2.1
##              # available=1.3.0-alpha01
##              # available=1.3.0-alpha02
##              # available=1.3.0-alpha03
##              # available=1.3.0-beta01
##              # available=1.3.0-beta02
##              # available=1.3.0-beta03
##              # available=1.3.0-rc01
##              # available=1.3.0
##              # available=1.3.1
##              # available=1.3.2
##              # available=1.4.0-alpha01
##              # available=1.4.0-alpha02
##              # available=1.4.0-alpha03

version.androidx.compose.material=1.1.1
##                    # available=1.2.0-alpha01
##                    # available=1.2.0-alpha02
##                    # available=1.2.0-alpha03
##                    # available=1.2.0-alpha04
##                    # available=1.2.0-alpha05
##                    # available=1.2.0-alpha06
##                    # available=1.2.0-alpha07
##                    # available=1.2.0-alpha08
##                    # available=1.2.0-beta01
##                    # available=1.2.0-beta02
##                    # available=1.2.0-beta03
##                    # available=1.2.0-rc01
##                    # available=1.2.0-rc02
##                    # available=1.2.0-rc03
##                    # available=1.2.0
##                    # available=1.2.1
##                    # available=1.3.0-alpha01
##                    # available=1.3.0-alpha02
##                    # available=1.3.0-alpha03
##                    # available=1.3.0-beta01
##                    # available=1.3.0-beta02
##                    # available=1.3.0-beta03
##                    # available=1.3.0-rc01
##                    # available=1.3.0
##                    # available=1.3.1
##                    # available=1.4.0-alpha01
##                    # available=1.4.0-alpha02
##                    # available=1.4.0-alpha03

## unused
version.androidx.compose.compiler=1.1.1

version.androidx.activity=1.3.1
##            # available=1.4.0-alpha01
##            # available=1.4.0-alpha02
##            # available=1.4.0-beta01
##            # available=1.4.0-rc01
##            # available=1.4.0
##            # available=1.5.0-alpha01
##            # available=1.5.0-alpha02
##            # available=1.5.0-alpha03
##            # available=1.5.0-alpha04
##            # available=1.5.0-alpha05
##            # available=1.5.0-beta01
##            # available=1.5.0-rc01
##            # available=1.5.0
##            # available=1.5.1
##            # available=1.6.0-alpha01
##            # available=1.6.0-alpha03
##            # available=1.6.0-alpha05
##            # available=1.6.0-beta01
##            # available=1.6.0-rc01
##            # available=1.6.0-rc02
##            # available=1.6.0
##            # available=1.6.1
##            # available=1.7.0-alpha01
##            # available=1.7.0-alpha02

## unused
plugin.android=7.3.1

Projenizden oluşturduğunuz zamandan bu yana bağımlılıklar ne kadar değişen versiyona sahip olmuş bunları da inceleyebiliriz.

Projedeki bağımlıklıkları tek dosyadan hızlı bir biçimde yükseltebiliriz.

build.gradle (:app)

dependencies {

    implementation AndroidX.core.ktx
    implementation AndroidX.lifecycle.runtime.ktx
    implementation AndroidX.activity.compose
    implementation AndroidX.compose.ui
    implementation AndroidX.compose.ui.toolingPreview
    implementation AndroidX.compose.material

    testImplementation Testing.junit4
    androidTestImplementation AndroidX.test.ext.junit
    androidTestImplementation AndroidX.test.espresso.core
    androidTestImplementation AndroidX.compose.ui.testJunit4
    debugImplementation AndroidX.compose.ui.tooling
    debugImplementation AndroidX.compose.ui.testManifest

}