Build entirely using local Android SDK to move beyond Android 4.1

This commit is contained in:
Sean Owen 2017-01-24 13:25:08 +00:00
parent 63c4b21556
commit 5d61990e26
No known key found for this signature in database
GPG key ID: F6CE9695C9318406
2 changed files with 37 additions and 12 deletions

View file

@ -13,7 +13,7 @@ matrix:
# Covers Java 8, Oracle JDK, Android apps
- jdk: oraclejdk8
env: ANDROID_HOME=$HOME/android-sdk-linux
before_install: if [ ! -d $HOME/android-sdk-linux/tools ]; then curl -s https://storage.googleapis.com/zxing-build/android-sdk-linux.tar.bz2 | bunzip2 | tar xf - -C $HOME; else ls -l $HOME/android-sdk-linux; fi
before_install: if [ ! -d $HOME/android-sdk-linux/platforms ]; then curl -s https://storage.googleapis.com/zxing-build/android-sdk-linux.tar.bz2 | bunzip2 | tar xf - -C $HOME; else ls -l $HOME/android-sdk-linux; fi
cache:
directories:
- $HOME/.m2
@ -21,3 +21,22 @@ cache:
git:
depth: 10
after_success: if [ -n "$JACOCO" ]; then bash <(curl -s https://codecov.io/bash); fi
# The Android SDK package android-sdk-linux.tar.bz2 above is built roughly like so:
#
# mkdir android-sdk-linux; cd android-sdk-linux
# curl -O https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
# unzip *.zip
# rm *.zip
#
# # Or different, more recent versions:
# ./tools/bin/sdkmanager "platforms;android-22" "build-tools;25.0.2"
# # Accept license
#
# ./tools/bin/sdkmanager --uninstall tools
#
# ./tools/bin/sdkmanager --update
# # Accept license
#
# cd ..
# tar cf - android-sdk-linux | bzip2 -9 > android-sdk-linux.tar.bz2

26
pom.xml
View file

@ -46,12 +46,6 @@
<artifactId>guava</artifactId>
<version>21.0</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
@ -84,8 +78,7 @@
<modules>
<module>core</module>
<module>javase</module>
<module>android-core</module>
<module>android-integration</module>
<!-- android modules are activated by a profile below -->
<module>zxing.appspot.com</module>
<module>zxingorg</module>
</modules>
@ -100,6 +93,7 @@
<slf4j.version>1.7.22</slf4j.version>
<!-- This can't reference project.version as some subprojects version differently -->
<zxing.version>3.3.1-SNAPSHOT</zxing.version>
<android.platform>22</android.platform>
</properties>
<build>
@ -176,7 +170,6 @@
<target>${java.version}</target>
<compilerArgs>
<arg>-Xlint:all</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
@ -362,7 +355,7 @@
</executions>
<configuration>
<sdk>
<platform>24</platform>
<platform>${android.platform}</platform>
</sdk>
<proguard>
<skip>true</skip>
@ -716,10 +709,23 @@
</property>
</activation>
<modules>
<module>android-core</module>
<module>android-integration</module>
<module>android</module>
<module>androidtest</module>
<module>glass</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${android.platform}</version>
<scope>system</scope>
<systemPath>${env.ANDROID_HOME}/platforms/android-${android.platform}/android.jar</systemPath>
</dependency>
</dependencies>
</dependencyManagement>
</profile>
<profile>
<id>release</id>