android - Read versionName of build.gradle from Jenkins -


i'm using jenkins android app builds. on every build, info, build number, etc...

i'm searching way read versionname value of in build.gradle when jenkins build job. know can buildnumber $build_numberenv variable, how versionname?

you adding execute shell step determines versionname, , exporting environment variable using envinject plugin.

assuming build.gradle contains:

versionname = myname 

you can add script:

v=$(cat build.gradle  | grep versionname | awk '{print $3}') echo my_version_name=${v} > env.properties 

Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -