Splitties / refreshVersions

Life is too short to google for dependencies and versions
https://splitties.github.io/refreshVersions/
MIT License
1.66k stars 107 forks source link

Upgrading an old project to Gradle 6 and AGP 3.5.3 #156

Closed jmfayard closed 4 years ago

jmfayard commented 4 years ago

I have been trying to upgrade projects to Gradle 6

A procedure that seems reliable:

jmfayard commented 4 years ago

Plugin setup

Settings file

// settings.gradle.kts

import static de.fayard.versions.PluginsManagementSetupKt.setupVersionPlaceholdersResolving
buildscript {
    dependencies.classpath("de.fayard.refreshVersions:de.fayard.refreshVersions.gradle.plugin:0.8.6")
}
setupVersionPlaceholdersResolving(settings)

Root Build file

// build.gradle
buildscript {
}
plugins {
  id("de.fayard.refreshVersions")
}

app/build.gradle

plugins {
  id("de.fayard.dependencies") version "0.5.1"
}
jmfayard commented 4 years ago

gradle.properties

# ./gradle.properties
# See https://dev.to/jmfayard/configuring-gradle-with-gradle-properties-211k
org.gradle.caching=true
org.gradle.parallel=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx1536m
jmfayard commented 4 years ago

Errors I had so far

com.android.build.gradle.tasks.factory NoSuchMethodError:  org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V
https://scans.gradle.com/s/riualqbnns34a

Could not find method leftShift() for arguments CLOSURE on task ':qrcodereaderview:findConventions' of type org.gradle.api.DefaultTask.
https://gradle.com/s/hsxxm2m5fkq5u
task findConventions << {
  println project.getConvention()
}

org.gradle.api.GradleException: androidx.navigation.safeargs can only be used with an androidx project
https://gradle.com/s/mb5injtrvtywi

QRCodeReaderView: PMD violation
https://gradle.com/s/vb6kys6ruc6o4

QRCodeReaderView: unit tests failed
https://gradle.com/s/wqbxt4ah6xoru

Could not find org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.61-dev-withExperimentalGoogleExtensions-20191127.
https://gradle.com/s/lisaz2jmhudt6
jmfayard commented 4 years ago

cool init script to enable the build scan to all builds https://docs.gradle.com/enterprise/gradle-plugin/#gradle_enterprise

jmfayard commented 4 years ago

Integrated in https://github.com/jmfayard/refreshVersions/issues/242