From e0cb1cff3b5ce34e39b2f9cd2fef0699789f7180 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Thu, 3 Jun 2021 23:24:30 +0200 Subject: [PATCH] Remove build dependency on Android SDK --- .travis.yml | 6 +----- build.gradle | 22 +--------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index f0cc0c05..845460e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/build.gradle b/build.gradle index 414b70f5..32475846 100644 --- a/build.gradle +++ b/build.gradle @@ -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")