// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.9.+' } } allprojects { repositories { mavenCentral() } } // Global version for library project with sample projectVersion = '0.2' // External Parameters isRelease = project.hasProperty("exRelease") ? Boolean.valueOf(exRelease) : false; buildIndex = Integer.valueOf(project.hasProperty("exBuildIndex") ? exBuildIndex : '20048'); // General version for project fullVersion = isRelease ? projectVersion + "." + buildIndex : projectVersion + "-SNAPSHOT"; // Notify TeamCity about version println "##teamcity[buildNumber '$fullVersion']" // Android application versions apkVersionCode = Integer.valueOf(buildIndex); apkVersionName = fullVersion; //Java/Android library versions libVersion = fullVersion;