Enabled CI through Travis-CI
This commit is contained in:
parent
9591295f32
commit
ae16570491
|
@ -4,6 +4,8 @@ ext {
|
||||||
git = org.ajoberstar.grgit.Grgit.open()
|
git = org.ajoberstar.grgit.Grgit.open()
|
||||||
gitVersionCode = git.tag.list().size()
|
gitVersionCode = git.tag.list().size()
|
||||||
gitVersionName = "${git.describe()}"
|
gitVersionName = "${git.describe()}"
|
||||||
|
|
||||||
|
travisBuild = System.getenv("TRAVIS") == "true"
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -52,8 +54,28 @@ android {
|
||||||
debug {
|
debug {
|
||||||
versionNameSuffix '-DEBUG'
|
versionNameSuffix '-DEBUG'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
buildTypes.each {
|
||||||
|
it.buildConfigField "String", "SWAD_APP_KEY", getBuildConfigField("SWAD_APP_KEY")
|
||||||
|
it.buildConfigField "String", "ANALYTICS_API_KEY", getBuildConfigField("ANALYTICS_API_KEY")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//return a BuildConfigField from a properties file.
|
||||||
|
def getBuildConfigField(String property){
|
||||||
|
String value;
|
||||||
|
|
||||||
|
if(travisBuild) {
|
||||||
|
value = System.getenv(property)
|
||||||
|
} else {
|
||||||
|
Properties properties = new Properties()
|
||||||
|
properties.load(new FileInputStream("keystore.properties"))
|
||||||
|
value = "\"" + properties.getProperty(property) + "\""
|
||||||
|
}
|
||||||
|
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:support-v4:24.2.1'
|
compile 'com.android.support:support-v4:24.2.1'
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
/Config.java
|
|
35
SWADroid/src/main/java/es/ugr/swad/swadroid/Config.java
Normal file
35
SWADroid/src/main/java/es/ugr/swad/swadroid/Config.java
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* This file is part of SWADroid.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||||
|
*
|
||||||
|
* SWADroid is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* SWADroid is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with SWADroid. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package es.ugr.swad.swadroid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application settings.
|
||||||
|
*
|
||||||
|
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
|
||||||
|
*/
|
||||||
|
public class Config {
|
||||||
|
/**
|
||||||
|
* SWAD application key
|
||||||
|
*/
|
||||||
|
public static final String SWAD_APP_KEY = BuildConfig.SWAD_APP_KEY;
|
||||||
|
/**
|
||||||
|
* Google Analytics application key
|
||||||
|
*/
|
||||||
|
public static final String ANALYTICS_API_KEY = BuildConfig.ANALYTICS_API_KEY;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user