Skip to content
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

How to update Gradle itself? #19

Closed
jmfayard opened this issue Nov 9, 2018 · 0 comments
Closed

How to update Gradle itself? #19

jmfayard opened this issue Nov 9, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@jmfayard
Copy link
Member

jmfayard commented Nov 9, 2018

Context: buildSrcVersions is a Gradle plugin that makes it easier to manage your dependencies inside your IDE. It extracts all your dependencies and search for available dependencies updates.

Available since 0.6.0

$ ./gradlew refreshVersions add in gradle.properties:

// gradle.properties
version.gradleLatestVersion=5.6.2

Available since: 0.4.0

The standard way to update gradle is to edit the file: gradle/wrapper/gradle-wrapper.properties

The buildSrcVersions also looks for what is the latest available release for Gradle itself.

object Versions {
   // ...

    const val gradleLatestVersion: String = "5.1.1"
}

You can leverage this information by configuring the wrapper task:

Groovy:

// ./build.gradle
wrapper {
}

Kotlin:

// ./build.gradle.kts
tasks.withType<Wrapper> {
    distributionType = Wrapper.DistributionType.ALL
    // with buildSrcVersions
    gradleVersion = Versions.gradleLatestVersion   
    // with refreshVersions
    gradleVersion = findProperty("gradleLatestVersion") as? String ?: gradle.gradleVersion
}

Then this will automatically update Gradle to the latest available release

$ ./gradlew wrapper
@jmfayard jmfayard self-assigned this Nov 9, 2018
@jmfayard jmfayard added this to In progress in buildSrcVersions Nov 9, 2018
@jmfayard jmfayard moved this from In progress to To do in buildSrcVersions Nov 9, 2018
@jmfayard jmfayard changed the title Gradle Wrapper & Versions Tip: updating Gradle to the latest version Dec 16, 2018
@jmfayard jmfayard changed the title Tip: updating Gradle to the latest version How to update Gradle itself? Dec 16, 2018
@jmfayard jmfayard moved this from To do to Done in buildSrcVersions Dec 16, 2018
jmfayard added a commit that referenced this issue Jan 16, 2019
Change the syntax so that it works the same in both Groovy and Kotlin
@jmfayard jmfayard added this to the 0.4.0 milestone Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

1 participant