summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-07-01 20:59:49 +0000
committerXin Li <delphij@google.com>2019-07-01 20:59:49 +0000
commit600b0068b2c05e75bed5101cd120326d5ab0c952 (patch)
tree4a55778ad6cd0b4aaad13e376160e8c36b3e544b
parent0af363100de92b20cbcdb19c17db2eec416a9a2e (diff)
parent745fa74857d2833e4d2dc3b0d6ab6e6cb6ff25f2 (diff)
downloadmultidex-600b0068b2c05e75bed5101cd120326d5ab0c952.tar.gz
DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-mastertemp_140451723
Bug: 134405016 Change-Id: Ia823681c5104d6b1986330db6205eebb5af3f307
-rw-r--r--.gitignore4
-rw-r--r--build.gradle32
-rw-r--r--gradle.properties6
-rw-r--r--gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--instrumentation/build.gradle2
-rw-r--r--library/build.gradle18
-rw-r--r--settings.gradle3
7 files changed, 37 insertions, 30 deletions
diff --git a/.gitignore b/.gitignore
index 639cdd5..cd8d22c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
local.properties
+.gradle
+.idea
+*.iml
+library
diff --git a/build.gradle b/build.gradle
index c30a000..45d505b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -19,34 +19,28 @@ import org.gradle.internal.os.OperatingSystem
buildscript {
repositories {
maven { url '../../prebuilts/gradle-plugin' }
- maven { url '../../prebuilts/tools/common/m2/repository' }
- maven { url '../../prebuilts/tools/common/m2/internal' }
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
+ classpath 'com.android.tools.build:gradle:3.0.1'
}
}
apply from: 'version.gradle'
-final String platform = OperatingSystem.current().isMacOsX() ? 'darwin' : 'linux'
-System.setProperty('android.dir', "${rootDir}/../../")
-final String fullSdkPath = "${rootDir}/../../prebuilts/fullsdk-${platform}"
-if (file(fullSdkPath).exists()) {
- gradle.ext.currentSdk = 26
- ext.buildToolsVersion = '26.0.0'
- project.ext.androidJar = files("${fullSdkPath}/platforms/android-${gradle.currentSdk}/android.jar")
- System.setProperty('android.home', "${rootDir}/../../prebuilts/fullsdk-${platform}")
- File props = file("local.properties")
- props.write "sdk.dir=${fullSdkPath}"
-} else {
- gradle.ext.currentSdk = 'current'
- ext.buildToolsVersion = '26.0.0'
- project.ext.androidJar = files("${project.rootDir}/../../prebuilts/sdk/current/public/android.jar")
- File props = file("local.properties")
- props.write "android.dir=../../"
+String platform = OperatingSystem.current().isMacOsX() ? 'darwin' : 'linux'
+File fullSdkPath = file("${rootDir}/../../prebuilts/fullsdk-${platform}")
+if (!fullSdkPath.exists()) {
+ throw GradleException("missing fullsdk")
}
+gradle.ext.currentSdk = 28
+ext.buildToolsVersion = '27.0.3'
+project.ext.fullSdkPath = fullSdkPath
+project.ext.androidJar = files("${fullSdkPath}/platforms/android-${gradle.currentSdk}/android.jar")
+
+File props = file("local.properties")
+props.write "sdk.dir=${fullSdkPath.getAbsolutePath()}"
+
/*
* With the build server you are given two env variables.
* The OUT_DIR is a temporary directory you can use to put things during the build.
diff --git a/gradle.properties b/gradle.properties
new file mode 100644
index 0000000..2b49a88
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,6 @@
+org.gradle.jvmargs=-Xmx4g
+org.gradle.daemon=true
+org.gradle.configureondemand=true
+org.gradle.parallel=true
+org.gradle.caching=true
+android.builder.sdkDownload=false
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 84939b4..3d7397a 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=../../../../tools/external/gradle/gradle-3.3-bin.zip
+distributionUrl=../../../../tools/external/gradle/gradle-4.8-bin.zip
diff --git a/instrumentation/build.gradle b/instrumentation/build.gradle
index 1e6fd98..fe6d8ee 100644
--- a/instrumentation/build.gradle
+++ b/instrumentation/build.gradle
@@ -21,7 +21,7 @@ dependencies {
}
android {
- compileSdkVersion 4
+ compileSdkVersion gradle.currentSdk
defaultConfig {
minSdkVersion 4
diff --git a/library/build.gradle b/library/build.gradle
index 1f17008..fe707f0 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -55,15 +55,21 @@ android {
manifest.srcFile 'AndroidManifest.xml'
}
}
+}
+
+android.libraryVariants.all { variant ->
+ variant.getJavaCompiler().dependsOn(makeVersionFile)
- lintOptions {
- // TODO: fix errors and reenable.
- abortOnError false
+ if (!name.equals(com.android.builder.core.BuilderConstants.RELEASE)) {
+ return // Skip non-release
}
-}
-android.libraryVariants.all {
- v -> v.getJavaCompiler().dependsOn(makeVersionFile)
+
+ def sourceJar = project.tasks.create(name: "sourceJarRelease", type: Jar) {
+ classifier = 'sources'
+ from android.sourceSets.main.java.srcDirs
+ }
+ artifacts.add("archives", sourceJar)
}
uploadArchives {
diff --git a/settings.gradle b/settings.gradle
index 7fffc9b..f4605ce 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -16,6 +16,3 @@
include ':multidex'
project(':multidex').projectDir = new File(rootDir, 'library')
-
-include ':multidex-instrumentation'
-project(':multidex-instrumentation').projectDir = new File(rootDir, 'instrumentation')