Don't run dx test in emulator
This commit is contained in:
@@ -1,7 +1,4 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
ext {
|
|
||||||
isD8Enabled = project.findProperty('android.enableD8').toBoolean()
|
|
||||||
}
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
@@ -60,11 +57,9 @@ android {
|
|||||||
resultsDir = "build/test/results"
|
resultsDir = "build/test/results"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isD8Enabled) {
|
compileOptions {
|
||||||
compileOptions {
|
sourceCompatibility = 1.8
|
||||||
sourceCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "box"
|
flavorDimensions "box"
|
||||||
@@ -86,15 +81,12 @@ android {
|
|||||||
dimension "box"
|
dimension "box"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
jvm80 {
|
||||||
|
dimension "box"
|
||||||
|
}
|
||||||
|
|
||||||
if (isD8Enabled) {
|
reflectjvm80 {
|
||||||
jvm80 {
|
dimension "box"
|
||||||
dimension "box"
|
|
||||||
}
|
|
||||||
|
|
||||||
reflectjvm80 {
|
|
||||||
dimension "box"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
#don't try to download android specific tools within gradle: licence acceptance will be required
|
#don't try to download android specific tools within gradle: licence acceptance will be required
|
||||||
android.builder.sdkDownload=false
|
android.builder.sdkDownload=false
|
||||||
android.enableD8=true
|
|
||||||
-20
@@ -55,16 +55,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
|
|||||||
runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply {
|
runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply {
|
||||||
rootSuite.addTest(this)
|
rootSuite.addTest(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
renameFlavorFolder()
|
|
||||||
enableD8(false)
|
|
||||||
runTestsOnEmulator(gradleRunner, TestSuite("DX")).apply {
|
|
||||||
(0 until this.countTestCases()).forEach {
|
|
||||||
val testCase = testAt(it) as TestCase
|
|
||||||
testCase.name += "_DX"
|
|
||||||
}
|
|
||||||
rootSuite.addTest(this)
|
|
||||||
}
|
|
||||||
} catch (e: RuntimeException) {
|
} catch (e: RuntimeException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
throw e
|
throw e
|
||||||
@@ -81,16 +71,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P
|
|||||||
return rootSuite
|
return rootSuite
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun enableD8(enable: Boolean) {
|
|
||||||
val file = File(pathManager.androidTmpFolder, "gradle.properties")
|
|
||||||
val lines = file.readLines().map {
|
|
||||||
if (it.startsWith("android.enableD8=")) {
|
|
||||||
"android.enableD8=$enable"
|
|
||||||
} else it
|
|
||||||
}
|
|
||||||
file.writeText(lines.joinToString("\n"))
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun processReport(suite: TestSuite, resultOutput: String) {
|
private fun processReport(suite: TestSuite, resultOutput: String) {
|
||||||
val reportFolder = File(flavorFolder())
|
val reportFolder = File(flavorFolder())
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user