mirror of
https://gitee.com/zhangsken/AndroidIDE.git
synced 2026-10-16 07:49:44 +08:00
tests(tooling-api): do add unresolved dependency when config cache is enabled
This commit is contained in:
+3
-1
@@ -59,7 +59,9 @@ class MultiModuleAndroidProjectTest {
|
||||
// Issue #1173
|
||||
|
||||
val taskPaths = mutableListOf<String>()
|
||||
val client = object : MultiVersionTestClient() {
|
||||
|
||||
// do not add unresolved dependency so that teh configuration cache is properly created
|
||||
val client = object : MultiVersionTestClient(excludeUnresolvedDependency = true) {
|
||||
|
||||
override fun getBuildArguments(): CompletableFuture<List<String>> {
|
||||
return CompletableFuture.completedFuture(super.getBuildArguments().get().toMutableList()
|
||||
|
||||
+12
-1
@@ -128,7 +128,8 @@ class ToolingApiTestLauncher {
|
||||
var agpVersion: String = DEFAULT_AGP_VERSION,
|
||||
var gradleVersion: String = DEFAULT_GRADLE_VERSION,
|
||||
private val log: ILogger = ILogger.newInstance(MultiVersionTestClient::class.simpleName),
|
||||
private val extraArgs : List<String> = emptyList()
|
||||
private val extraArgs : List<String> = emptyList(),
|
||||
private var excludeUnresolvedDependency: Boolean = false
|
||||
) : IToolingApiClient {
|
||||
|
||||
val gradleDistParams: GradleDistributionParams
|
||||
@@ -139,6 +140,9 @@ class ToolingApiTestLauncher {
|
||||
const val buildFile = "build.gradle"
|
||||
const val buildFileIn = "$buildFile.in"
|
||||
|
||||
const val appBuildFile = "app/build.gradle"
|
||||
const val appBuildFileIn = "$appBuildFile.in"
|
||||
|
||||
const val DEFAULT_AGP_VERSION = "7.2.0"
|
||||
const val DEFAULT_GRADLE_VERSION = "7.3.3"
|
||||
|
||||
@@ -163,6 +167,12 @@ class ToolingApiTestLauncher {
|
||||
projectDir.resolve(buildFileIn)
|
||||
.replaceContents(dest = projectDir.resolve(buildFile),
|
||||
candidate = "@@TOOLING_API_TEST_AGP_VERSION@@" to this.agpVersion)
|
||||
|
||||
if (!excludeUnresolvedDependency) {
|
||||
projectDir.resolve(appBuildFileIn)
|
||||
.replaceContents(dest = projectDir.resolve(appBuildFile),
|
||||
candidate = "@@UNRESOLVED_DEPENDENCY@@" to "implementation 'unresolved:unresolved:unresolved'")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBuildSuccessful(result: BuildResult) {
|
||||
@@ -175,6 +185,7 @@ class ToolingApiTestLauncher {
|
||||
|
||||
private fun onBuildResult(result: BuildResult) {
|
||||
projectDir.resolve(buildFile).deleteIfExists()
|
||||
projectDir.resolve(appBuildFile).deleteIfExists()
|
||||
}
|
||||
|
||||
override fun onProgressEvent(event: ProgressEvent) {}
|
||||
|
||||
@@ -64,9 +64,10 @@ dependencies {
|
||||
implementation 'com.google.android.material:material:1.8.0-alpha01'
|
||||
|
||||
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
|
||||
implementation 'unresolved:unresolved:unresolved'
|
||||
implementation project (path: ':another-android-library')
|
||||
|
||||
implementation platform('com.google.firebase:firebase-bom:30.5.0')
|
||||
|
||||
@@UNRESOLVED_DEPENDENCY@@
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user