Trying to define global ext properties version for dependencies

There a few ways to do this.

  1. Use the map syntax: ext['slf4j.version'] = '1.7.10'
  2. Explicitly call the set() method: ext { set('slf4j.version', '1.7.10') }
  3. Put the properties in a gradle.properties file slf4j.version=1.7.10

Double-quotes with the property syntax ${}.

compile "org.slf4j:slf4j-api:${slf4jVersion}"

Note, if you end up going with the “dot” syntax you’ll have to do something a bit different. Best to just use the property() method.

compile "org.slf4j:slf4j-api:${property('slf4j.version')}"