Update automatically Android version code and version name from git tag

This commit is contained in:
Juan Miguel Boyero Corral 2015-10-11 11:56:40 +02:00
parent 9f097577a1
commit 875b14bfa4
965 changed files with 84 additions and 30 deletions

View File

@ -9,6 +9,8 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />

62
SWADroid/build.gradle Normal file
View File

@ -0,0 +1,62 @@
apply plugin: 'com.android.application'
ext {
git = org.ajoberstar.grgit.Grgit.open()
gitVersionCode = git.tag.list().size()
gitVersionName = "${git.describe()}"
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "es.ugr.swad.swadroid"
versionCode gitVersionCode
versionName gitVersionName
minSdkVersion 9
targetSdkVersion 23
android.applicationVariants.all { variant ->
def appName
//Check if an applicationName property is supplied; if not use the name of the parent project.
if (project.hasProperty("applicationName")) {
appName = applicationName
} else {
appName = parent.name
}
variant.outputs.each { output ->
def newApkName
//If there's no ZipAlign task it means that our artifact will be unaligned and we need to mark it as such.
if (output.zipAlign) {
newApkName = "${appName}-${output.baseName}-${variant.versionName}.apk"
} else {
newApkName = "${appName}-${output.baseName}-${variant.versionName}-unaligned.apk"
}
output.outputFile = new File(output.outputFile.parent, newApkName)
}
}
testApplicationId "es.ugr.swad.swadroid.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
debug {
versionNameSuffix '-DEBUG'
}
}
}
dependencies {
compile 'com.android.support:support-v4:latest.release'
compile 'com.android.support:appcompat-v7:latest.release'
compile 'com.google.android.gms:play-services:latest.release'
compile 'com.google.code.gson:gson:latest.release'
compile 'com.google.code.ksoap2-android:ksoap2-android:latest.release'
compile 'commons-io:commons-io:latest.release'
compile 'com.nostra13.universalimageloader:universal-image-loader:latest.release'
compile 'com.google.zxing:core:2.1'
}

17
SWADroid/lint.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<lint>
<issue id="BackButton" severity="warning" />
<issue id="EasterEgg" severity="warning" />
<issue id="FieldGetter" severity="warning" />
<issue id="GradleDynamicVersion" severity="warning" />
<issue id="IconExpectedSize" severity="warning" />
<issue id="NewerVersionAvailable" severity="warning" />
<issue id="RtlCompat" severity="error" />
<issue id="RtlEnabled" severity="warning" />
<issue id="RtlHardcoded" severity="warning" />
<issue id="RtlSymmetry" severity="error" />
<issue id="SelectableText" severity="warning" />
<issue id="StopShip" severity="warning" />
<issue id="TypographyQuotes" severity="warning" />
<issue id="UnusedIds" severity="warning" />
</lint>

View File

@ -1,9 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="es.ugr.swad.swadroid"
android:installLocation="auto"
android:versionCode="70"
android:versionName="1.3" >
android:installLocation="auto" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Some files were not shown because too many files have changed in this diff Show More