Skip to content

Commit 6f73f47

Browse files
committed
Squashed commit of the following:
commit 01acef10132802b22e104c411122c2790673afdc Author: Ralf Kistner <[email protected]> Date: Sun Mar 12 13:08:09 2017 +0200 Try again. commit 4c0605282d13df59c856fd64945d096d5789f227 Author: Ralf Kistner <[email protected]> Date: Sun Mar 12 13:01:58 2017 +0200 Show lint output on build failure. commit e9af0670c8b2e07a4bd2418042b0487e97fb9389 Author: Ralf Kistner <[email protected]> Date: Sun Mar 12 12:50:11 2017 +0200 Handle missing local.properties file. commit e3976102e7342d3008c7b88cb3f75397397e3d95 Author: Ralf Kistner <[email protected]> Date: Sun Mar 12 12:36:47 2017 +0200 Update SDK components installed on Travis. commit e50952cc89cc83720e146838debf6a22bb1d9c2a Author: Ralf Kistner <[email protected]> Date: Sun Mar 12 12:28:18 2017 +0200 More tool upgrades. * Gradle 3.4.1 * Android Gra dle plugin 2.3.0 * Remove android-sdk-manager (no longer required). * Ignore lint for translation issues in sample apps.
1 parent 5d48d2f commit 6f73f47

File tree

10 files changed

+147
-42
lines changed

10 files changed

+147
-42
lines changed

.travis.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,23 @@ language: android
22
jdk: oraclejdk8
33
android:
44
components:
5+
# Install tools twice to get the latest update
6+
- tools
7+
- tools
8+
- platform-tools
9+
- build-tools-25.0.2
10+
11+
- android-25
12+
513
- extra-android-support
614
- extra-android-m2repository
715
- extra-google-m2repository
8-
# We need "tools" for build-tools. See https://github.com/travis-ci/travis-ci/issues/5036
9-
- tools
10-
- build-tools-23.0.2
1116
licenses:
1217
- 'android-sdk-license-.+'
1318
- 'google-gdk-license-.+'
1419
script:
1520
# build includes lint and test
1621
- TERM=dumb ./gradlew build
1722

23+
after_failure:
24+
- cat **/build/reports/lint-results.xml

build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ buildscript {
55
}
66

77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
9-
classpath 'com.github.JakeWharton:sdk-manager-plugin:220bf7a88a7072df3ed16dc8466fb144f2817070'
8+
classpath 'com.android.tools.build:gradle:2.3.0'
109
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
1110
}
1211
}
@@ -19,7 +18,6 @@ subprojects {
1918

2019
version = '3.4.0'
2120
group = 'com.journeyapps'
22-
apply plugin: 'android-sdk-manager'
2321

2422
ext.androidBuildTools = '25.0.2'
2523
ext.androidTargetSdk = 25

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.gradle.jvmargs=-Xmx1536M

gradle/wrapper/gradle-wrapper.jar

3.35 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Sep 04 18:48:05 CEST 2016
1+
#Sun Mar 12 11:50:08 SAST 2017
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip

gradlew

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@
66
##
77
##############################################################################
88

9-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10-
DEFAULT_JVM_OPTS=""
9+
# Attempt to set APP_HOME
10+
# Resolve links: $0 may be a link
11+
PRG="$0"
12+
# Need this for relative symlinks.
13+
while [ -h "$PRG" ] ; do
14+
ls=`ls -ld "$PRG"`
15+
link=`expr "$ls" : '.*-> \(.*\)$'`
16+
if expr "$link" : '/.*' > /dev/null; then
17+
PRG="$link"
18+
else
19+
PRG=`dirname "$PRG"`"/$link"
20+
fi
21+
done
22+
SAVED="`pwd`"
23+
cd "`dirname \"$PRG\"`/" >/dev/null
24+
APP_HOME="`pwd -P`"
25+
cd "$SAVED" >/dev/null
1126

1227
APP_NAME="Gradle"
1328
APP_BASE_NAME=`basename "$0"`
1429

30+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31+
DEFAULT_JVM_OPTS=""
32+
1533
# Use the maximum available, or set MAX_FD != -1 to use that value.
1634
MAX_FD="maximum"
1735

@@ -30,6 +48,7 @@ die ( ) {
3048
cygwin=false
3149
msys=false
3250
darwin=false
51+
nonstop=false
3352
case "`uname`" in
3453
CYGWIN* )
3554
cygwin=true
@@ -40,31 +59,11 @@ case "`uname`" in
4059
MINGW* )
4160
msys=true
4261
;;
62+
NONSTOP* )
63+
nonstop=true
64+
;;
4365
esac
4466

45-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
46-
if $cygwin ; then
47-
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48-
fi
49-
50-
# Attempt to set APP_HOME
51-
# Resolve links: $0 may be a link
52-
PRG="$0"
53-
# Need this for relative symlinks.
54-
while [ -h "$PRG" ] ; do
55-
ls=`ls -ld "$PRG"`
56-
link=`expr "$ls" : '.*-> \(.*\)$'`
57-
if expr "$link" : '/.*' > /dev/null; then
58-
PRG="$link"
59-
else
60-
PRG=`dirname "$PRG"`"/$link"
61-
fi
62-
done
63-
SAVED="`pwd`"
64-
cd "`dirname \"$PRG\"`/" >&-
65-
APP_HOME="`pwd -P`"
66-
cd "$SAVED" >&-
67-
6867
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
6968

7069
# Determine the Java command to use to start the JVM.
@@ -90,7 +89,7 @@ location of your Java installation."
9089
fi
9190

9291
# Increase the maximum file descriptors if we can.
93-
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
92+
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
9493
MAX_FD_LIMIT=`ulimit -H -n`
9594
if [ $? -eq 0 ] ; then
9695
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -114,6 +113,7 @@ fi
114113
if $cygwin ; then
115114
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116115
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116+
JAVACMD=`cygpath --unix "$JAVACMD"`
117117

118118
# We build the pattern for arguments to be converted via cygpath
119119
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

gradlew.bat

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
@if "%DEBUG%" == "" @echo off
2+
@rem ##########################################################################
3+
@rem
4+
@rem Gradle startup script for Windows
5+
@rem
6+
@rem ##########################################################################
7+
8+
@rem Set local scope for the variables with windows NT shell
9+
if "%OS%"=="Windows_NT" setlocal
10+
11+
set DIRNAME=%~dp0
12+
if "%DIRNAME%" == "" set DIRNAME=.
13+
set APP_BASE_NAME=%~n0
14+
set APP_HOME=%DIRNAME%
15+
16+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17+
set DEFAULT_JVM_OPTS=
18+
19+
@rem Find java.exe
20+
if defined JAVA_HOME goto findJavaFromJavaHome
21+
22+
set JAVA_EXE=java.exe
23+
%JAVA_EXE% -version >NUL 2>&1
24+
if "%ERRORLEVEL%" == "0" goto init
25+
26+
echo.
27+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28+
echo.
29+
echo Please set the JAVA_HOME variable in your environment to match the
30+
echo location of your Java installation.
31+
32+
goto fail
33+
34+
:findJavaFromJavaHome
35+
set JAVA_HOME=%JAVA_HOME:"=%
36+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37+
38+
if exist "%JAVA_EXE%" goto init
39+
40+
echo.
41+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42+
echo.
43+
echo Please set the JAVA_HOME variable in your environment to match the
44+
echo location of your Java installation.
45+
46+
goto fail
47+
48+
:init
49+
@rem Get command-line arguments, handling Windows variants
50+
51+
if not "%OS%" == "Windows_NT" goto win9xME_args
52+
if "%@eval[2+2]" == "4" goto 4NT_args
53+
54+
:win9xME_args
55+
@rem Slurp the command line arguments.
56+
set CMD_LINE_ARGS=
57+
set _SKIP=2
58+
59+
:win9xME_args_slurp
60+
if "x%~1" == "x" goto execute
61+
62+
set CMD_LINE_ARGS=%*
63+
goto execute
64+
65+
:4NT_args
66+
@rem Get arguments from the 4NT Shell from JP Software
67+
set CMD_LINE_ARGS=%$
68+
69+
:execute
70+
@rem Setup the command line
71+
72+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73+
74+
@rem Execute Gradle
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76+
77+
:end
78+
@rem End local scope for the variables with windows NT shell
79+
if "%ERRORLEVEL%"=="0" goto mainEnd
80+
81+
:fail
82+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83+
rem the _cmd.exe /c_ return code!
84+
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85+
exit /b 1
86+
87+
:mainEnd
88+
if "%OS%"=="Windows_NT" endlocal
89+
90+
:omega

sample-nosupport/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<resources>
2+
<resources tools:ignore="MissingTranslation" xmlns:tools="http://schemas.android.com/tools">
33

44
<string name="app_name">ZXing Sample</string>
55
<string name="scan_barcode">Scan Barcode</string>

sample/build.gradle

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@ android {
1111
versionName "3.4.0"
1212
}
1313

14-
Properties properties = new Properties()
15-
properties.load(project.rootProject.file('local.properties').newDataInputStream())
16-
def keystoreFile = properties.getProperty('keystore.file')
17-
def keystorePassword = properties.getProperty('keystore.password')
18-
def keystoreAlias = properties.getProperty('keystore.alias')
19-
def validConfig = keystoreFile != null && keystorePassword != null && keystoreAlias != null;
14+
def validConfig
15+
def keystoreFile
16+
def keystorePassword
17+
def keystoreAlias
18+
19+
try {
20+
Properties properties = new Properties()
21+
properties.load(project.rootProject.file('local.properties').newDataInputStream())
22+
keystoreFile = properties.getProperty('keystore.file')
23+
keystorePassword = properties.getProperty('keystore.password')
24+
keystoreAlias = properties.getProperty('keystore.alias')
25+
validConfig = keystoreFile != null && keystorePassword != null && keystoreAlias != null;
26+
} catch(error) {
27+
validConfig = false;
28+
}
2029

2130
if(validConfig) {
2231
System.out.println("Release signing configured with " + keystoreFile)

sample/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<resources>
2+
<resources tools:ignore="MissingTranslation" xmlns:tools="http://schemas.android.com/tools">
33

44
<string name="app_name">ZXing Sample</string>
55
<string name="scan_barcode">Scan Barcode</string>

0 commit comments

Comments
 (0)