Skip to content Skip to sidebar Skip to footer

How To Determine During The Build Which Exactly Version Of Dependency Is Used

I want to display exact versions of my app's dependencies in the 'About' screen. In build.config I'm using wildcards like compile 'com.google.guava:guava:16.0.+' for dependencies,

Solution 1:

It sounds like you are looking for the dependencyReport task from the project reports plugin

Otherwise you could do something like this:

task buildConfig << {
   new File("$buildDir/BuildConfig").withWriter { out ->
        configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { dep -> 
            out.writeLine(dep.moduleVersion.id.toString()) 
      }
   }
}

Post a Comment for "How To Determine During The Build Which Exactly Version Of Dependency Is Used"