Remove build dependency on Android SDK

This commit is contained in:
Paul Schaub 2021-06-03 23:24:30 +02:00
parent cc87bf5111
commit e0cb1cff3b
2 changed files with 2 additions and 26 deletions

View File

@ -1,8 +1,5 @@
language: android
language: java
dist: trusty
android:
components:
- android-10
jdk:
- openjdk8
- openjdk11
@ -13,7 +10,6 @@ before_cache:
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.android/build-cache
- $HOME/.m2
before_install:

View File

@ -28,6 +28,7 @@ allprojects {
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
// For non-sop modules, enable android api compatibility check
if (!it.name.equals('pgpainless-sop')) {
// animalsniffer
apply plugin: 'ru.vyarus.animalsniffer'
@ -56,7 +57,6 @@ allprojects {
project.ext {
junitVersion = '5.7.1'
androidBootClasspath = getAndroidRuntimeJar(pgpainlessMinAndroidSdk)
rootConfigDir = new File(rootDir, 'config')
gitCommit = getGitCommit()
builtDate = (new SimpleDateFormat("yyyy-MM-dd")).format(new Date())
@ -196,26 +196,6 @@ subprojects {
processResources.dependsOn generateVersionProperties
}
def getAndroidRuntimeJar(androidSdkApiLevel) {
def androidHome = getAndroidHome()
def androidJar = new File("$androidHome/platforms/android-$androidSdkApiLevel/android.jar")
if (androidJar.isFile()) {
return androidJar
} else {
throw new Exception("Can't find android.jar for API level $androidSdkApiLevel at $androidHome/platforms/android-$androidSdkApiLevel/android.jar. Please install corresponding SDK platform package")
}
}
def getAndroidHome() {
def androidHomeEnv = System.getenv("ANDROID_HOME")
if (androidHomeEnv == null) {
throw new Exception("ANDROID_HOME environment variable is not set")
}
def androidHome = new File(androidHomeEnv)
if (!androidHome.isDirectory()) throw new Exception("Environment variable ANDROID_HOME is not pointing to a directory")
return androidHome
}
def getGitCommit() {
def projectDirFile = new File("$projectDir")
def dotGit = new File("$projectDir/.git")