Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Gradle dependencies: Parenthesis vs single/double quotes only

When naming dependencies in the Cradle-file: What’s the difference between putting the string within parenthesis or just quotes alone.

For example:
implementation("io.coil-kt:coil:2.2.2")

Versus:
implementation 'com.squareup.moshi:moshi-kotlin:1.9.3'

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I see both forms all the time. When do I use which?

>Solution :

Both notation are available and are equivalent , in the Groovy DSL: see explanation here

Reference to this feature in Groovy specifications: https://groovy-lang.org/style-guide.html#_omitting_parentheses

In Koltin DSL, only the method call version (with parenthesis) is available.

"When do I use which? " : personally I prefer using the version with parenthesis , making it simpler to migrate to Kotlin DSL later : https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html#prepare_your_groovy_scripts

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading