Gradle7 Version Catalog: How to use it with buildSrc?

With Gradle 7.3.3, it is possible. Note version catalogs are GA since Gradle 7.4 The code snippet assumes Gradle is at least 7.4, but if you need them prior that version, insert enableFeaturePreview(“VERSION_CATALOGS”) at the beginning of each settings.gradle.kts. Using buildSrc buildSrc/settings.gradle.kts dependencyResolutionManagement { versionCatalogs { create(“libs”) { from(files(“../gradle/libs.versions.toml”)) } } } buildSrc/build.gradle.kts dependencies { … Read more

Boilerplate project configuration in Gradle with Gradle Kotlin DSL

If you want to benefit from all the Gradle Kotlin DSL goodness you should strive to apply all plugins using the plugins {} block. See https://github.com/gradle/kotlin-dsl/blob/master/doc/getting-started/Configuring-Plugins.md You can manage plugin repositories and resolution strategies (e.g. their version) in your settings files. Starting with Gradle 4.4 this file can be written using the Kotlin DSL, aka … Read more

Can’t use project extra properties in plugin block

Apparently this has become possible recently, if it wasn’t possible in the past. (Almost) from the docs: gradle.properties: helloPluginVersion=1.0.0 settings.gradle.kts: pluginManagement { val helloPluginVersion: String by settings plugins { id(“com.example.hello”) version helloPluginVersion } } And now the docs say that build.gradle.kts should be empty but my testing shows that you still need this in build.gradle.kts: … Read more

Gradle: What is the benefit if I switch from Groovy to Kotlin?

Kotlin is statically typed, whereas Groovy is not. Statically typed languages like Kotlin enable IDEs to support particular tasks much better: auto-completion and content assist quick documentation navigation to source refactoring and more This is a great advantage that Gradle sees and therefore started with Kotlin as an alternative to Groovy. There are also some … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)