From 3366f8c0a54e69d5dc13e83b8a3e86b9ab9c0c5c Mon Sep 17 00:00:00 2001 From: arunkumar9t2 Date: Tue, 16 Jul 2024 17:05:32 +0800 Subject: [PATCH] Optimize dependency resolution code path and introduce experiment to limit parallelism (#140) Fixes #140 --- build.gradle | 3 + .../kotlin/com/grab/grazel/GrazelExtension.kt | 34 +++++++ .../com/grab/grazel/bazel/exec/Bazel.kt | 6 +- .../grazel/extension/ExperimentsExtension.kt | 40 +++++++++ .../grazel/gradle/variant/AndroidVariants.kt | 33 +++---- .../variant/ConfigurationParsingVariant.kt | 2 +- .../com/grab/grazel/gradle/variant/Variant.kt | 4 + .../grazel/gradle/variant/VariantBuilder.kt | 90 +++++++++---------- .../ComputeWorkspaceDependenciesTask.kt | 3 + .../ResolveVariantDependenciesTask.kt | 68 +++++++++----- .../grazel/tasks/internal/TasksManager.kt | 5 +- .../variant/DefaultVariantBuilderTest.kt | 4 +- .../grab/grazel/gradle/variant/VariantTest.kt | 4 +- maven_install.json | 32 +++---- 14 files changed, 221 insertions(+), 107 deletions(-) create mode 100644 grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/extension/ExperimentsExtension.kt diff --git a/build.gradle b/build.gradle index 51af8663..6ffbc213 100644 --- a/build.gradle +++ b/build.gradle @@ -143,6 +143,9 @@ grazel { sha = "154cdfa4f6f552a9873e2b4448f7a80415cb3427c4c771a50c6a8a8b434ffd0a" } } + experiments { + limitDependencyResolutionParallelism.set(true) + } } idea { diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/GrazelExtension.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/GrazelExtension.kt index fe7956dd..e3e55387 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/GrazelExtension.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/GrazelExtension.kt @@ -18,6 +18,7 @@ package com.grab.grazel import com.grab.grazel.extension.AndroidExtension import com.grab.grazel.extension.DependenciesExtension +import com.grab.grazel.extension.ExperimentsExtension import com.grab.grazel.extension.HybridExtension import com.grab.grazel.extension.RulesExtension import groovy.lang.Closure @@ -55,6 +56,8 @@ open class GrazelExtension( val hybrid = HybridExtension(rootProject.objects) + val experiments = ExperimentsExtension(rootProject.objects) + /** * Android specific configuration used to configure parameters for android_binary or other android related * rules @@ -190,4 +193,35 @@ open class GrazelExtension( closure.delegate = hybrid closure.call() } + + /** + * Extension to configure experiments + * + * ``` + * experiments { + * + * } + * ``` + * @see ExperimentsExtension + * @param block Configuration block with [ExperimentsExtension] as the receiver + */ + fun experiments(block: ExperimentsExtension.() -> Unit) { + block(experiments) + } + + /** + * Extension to configure experiments + * + * ``` + * experiments { + * + * } + * ``` + * @see ExperimentsExtension + * @param closure Closure block with [ExperimentsExtension] as the delegate + */ + fun experiments(closure: Closure<*>) { + closure.delegate = experiments + closure.call() + } } diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/exec/Bazel.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/exec/Bazel.kt index f3bf5690..94f2f700 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/exec/Bazel.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/bazel/exec/Bazel.kt @@ -62,7 +62,11 @@ internal fun ExecOperations.bazelCommand( add("--noshow_progress") add("--color=yes") } - logger.quiet("${"Running".ansiGreen} ${commands.joinToString(separator = " ").ansiYellow}") + logger.quiet( + "${"Running".ansiGreen} ${ + commands.toList().dropLast(2).joinToString(separator = " ").ansiYellow + }" + ) return exec { commandLine(*commands.toTypedArray()) standardOutput = outputStream ?: LogOutputStream(logger, LogLevel.QUIET) diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/extension/ExperimentsExtension.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/extension/ExperimentsExtension.kt new file mode 100644 index 00000000..2632d28e --- /dev/null +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/extension/ExperimentsExtension.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2024 Grabtaxi Holdings PTE LTD (GRAB) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.grab.grazel.extension + +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.Property +import org.gradle.kotlin.dsl.property + +/** + * Additional experiments configuration + */ +data class ExperimentsExtension(private val objects: ObjectFactory) { + + /** + * Limits the no of concurrent Gradle dependency resolution requests by establishing inter task dependencies + * mirroring project dependency graph such that successors are always resolved first before predecessor + * project is resolved. This is useful for large project with large dependency which can be memory intensive + * to compute. + * + * Enabling this does not actually control the no of parallel requests, for that + * please use `--max-workers` property from Gradle. + */ + val limitDependencyResolutionParallelism: Property = objects + .property() + .convention(false) +} \ No newline at end of file diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/AndroidVariants.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/AndroidVariants.kt index 6f02ec95..fb5200b8 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/AndroidVariants.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/AndroidVariants.kt @@ -93,14 +93,26 @@ abstract class AndroidNonVariant( override val name get() = backingVariant.name + when (variantType) { - AndroidTest -> AndroidTest.name - Test -> Test.name + AndroidTest, Test -> variantType.testSuffix Lint -> Lint.name else -> "" } override val baseName get() = backingVariant.name.capitalize() + override val extendsFrom: Set by lazy { + buildList { + add(DEFAULT_VARIANT) + if (variantType.isTest) { + add(backingVariant.name) + add(TEST_VARIANT) + if (variantType.isAndroidTest) { + add(ANDROID_TEST_VARIANT) + } + } + }.toSet() + } + override val variantConfigurations: Set get() = super.variantConfigurations .asSequence() @@ -159,13 +171,7 @@ class AndroidBuildType( backingVariant = backingVariant, variantType = variantType, toIgnoreKeywords = flavors -) { - override val extendsFrom: Set = buildList { - add(DEFAULT_VARIANT) - if (variantType.isTest) add(backingVariant.name) - if (variantType == Test) add(TEST_VARIANT) - }.toSet() -} +) /** * A [Variant] implementation to denote a [ProductFlavor] with [toIgnoreKeywords] set to buildTypes @@ -187,13 +193,7 @@ class AndroidFlavor( backingVariant = backingVariant, variantType = variantType, toIgnoreKeywords = buildTypes -) { - override val extendsFrom: Set = buildList { - add(DEFAULT_VARIANT) - if (variantType.isTest) add(backingVariant.name) - if (variantType == Test) add(TEST_VARIANT) - }.toSet() -} +) data class DefaultVariantData( val project: Project, @@ -225,6 +225,7 @@ class AndroidDefaultVariant( override val backingVariant: DefaultVariantData get() = defaultVariantData override val project: Project get() = defaultVariantData.project override val variantType: VariantType get() = defaultVariantData.variantType + override val extendsFrom: Set = buildSet { if (variantType.isTest) add(DEFAULT_VARIANT) if (variantType.isAndroidTest) add(TEST_VARIANT) diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/ConfigurationParsingVariant.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/ConfigurationParsingVariant.kt index a7e79024..69d2f6ea 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/ConfigurationParsingVariant.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/ConfigurationParsingVariant.kt @@ -79,7 +79,7 @@ interface ConfigurationParsingVariant : Variant { AndroidBuild -> configName.startsWith("kapt${namePattern.capitalize()}") AndroidTest -> configName.startsWith("kaptAndroidTest${basePattern.capitalize()}") Test -> configName.startsWith("kaptTest${basePattern.capitalize()}") - VariantType.Lint -> false + Lint -> false JvmBuild -> error("Invalid variant type ${JvmBuild.name} for Android variant") } }.addTo(this) diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/Variant.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/Variant.kt index 15e27f55..3ebf1962 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/Variant.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/Variant.kt @@ -31,6 +31,7 @@ import org.gradle.api.artifacts.Configuration */ interface Variant { val name: String + val backingVariant: T val project: Project @@ -95,12 +96,15 @@ fun BaseVariant.toVariantType(): VariantType = when (this) { val Variant<*>.isBase get() = name == DEFAULT_VARIANT +val Variant<*>.id get() = name + variantType.toString() + /** * Bridge function to map [ConfigurationScope] to [VariantType] * Not required once fully migrated to [Variant] APIs * * @return whether this [VariantType] corresponds to [ConfigurationScope] */ +@Deprecated(message = "Deprecated, new code should use Variant API directly") fun VariantType.isConfigScope( project: Project, configurationScope: ConfigurationScope diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/VariantBuilder.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/VariantBuilder.kt index e49398fb..b0ff9c41 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/VariantBuilder.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/gradle/variant/VariantBuilder.kt @@ -70,7 +70,7 @@ constructor( ), AndroidDefaultVariant( project = project, - variantType = VariantType.Lint, + variantType = Lint, ignoreKeywords = flavorsBuildTypes ) ) @@ -96,7 +96,7 @@ constructor( } (parsedAndroidVariants + defaultVariants) .asSequence() - .distinctBy { it.name + it.variantType } + .distinctBy { it.id } .sortedBy { it.name.length } .toSet() } else if (project.isJvm) { @@ -118,80 +118,77 @@ constructor( override fun onVariants(project: Project, action: (Variant<*>) -> Unit) { project.afterEvaluate { + val variantCache = ConcurrentHashMap>() if (project.isAndroid) { - val flavors = variantDataSource.getFlavors(project) - val flavorNames = flavors.map { it.name }.toSet() - val buildTypes = variantDataSource.getBuildTypes(project) - val buildTypeNames = buildTypes.map { it.name }.toSet() - val flavorsBuildTypes = (flavorNames + buildTypeNames).toSet() - action( + val allFlavors = variantDataSource.getFlavors(project) + val allFlavorNames = allFlavors.map { it.name }.toSet() + val allBuildTypes = variantDataSource.getBuildTypes(project) + val allBuildTypeNames = allBuildTypes.map { it.name }.toSet() + val allFlavorBuildTypes = (allFlavorNames + allBuildTypeNames).toSet() + + fun variantAction(variant: Variant<*>) { + if (!variantCache.containsKey(variant.id)) { + action(variant) + variantCache[variant.id] = variant + } + } + + variantAction( AndroidDefaultVariant( project = project, variantType = AndroidBuild, - ignoreKeywords = flavorsBuildTypes + ignoreKeywords = allFlavorBuildTypes ) ) - action( + variantAction( AndroidDefaultVariant( project = project, variantType = Test, - ignoreKeywords = flavorsBuildTypes + ignoreKeywords = allFlavorBuildTypes ) ) - action( + variantAction( AndroidDefaultVariant( project = project, variantType = AndroidTest, - ignoreKeywords = flavorsBuildTypes + ignoreKeywords = allFlavorBuildTypes ) ) - action( + variantAction( AndroidDefaultVariant( project = project, variantType = Lint, - ignoreKeywords = flavorsBuildTypes + ignoreKeywords = allFlavorBuildTypes ) ) variantDataSource.migratableVariants(project) { variant -> action(AndroidVariant(project, variant)) - } - - - if (flavors.isNotEmpty()) { - // Special case, if this module does not have flavors declared then variants - // will be just buildTypes. Since we already would have passed buildType variants - // above we don't need to pass it again here. - buildTypes - .asSequence() - .flatMap { buildType -> - VariantType.values() - .filter { it != JvmBuild && it != Lint } - .map { variantType -> + if (allFlavors.isNotEmpty()) { + VariantType.values() + .asSequence() + .filter { it != JvmBuild && it != Lint } + .forEach { variantType -> + variantAction( AndroidBuildType( project = project, - backingVariant = buildType, + backingVariant = variant.buildType, variantType = variantType, - flavors = flavorNames + flavors = allFlavorNames ) - } - }.distinctBy { it.name + it.variantType } - .forEach(action) - - VariantType - .values() - .asSequence() - .filter { it != JvmBuild && it != Lint } - .flatMap { variantType -> - flavors.map { flavor -> - AndroidFlavor( - project, - flavor, - variantType, - buildTypeNames ) + variant.productFlavors.forEach { flavor -> + variantAction( + AndroidFlavor( + project = project, + backingVariant = flavor, + variantType = variantType, + buildTypes = allBuildTypeNames + ) + ) + } } - }.forEach(action) + } } } else if (project.isJvm) { action(JvmVariant(project = project, variantType = JvmBuild)) @@ -199,5 +196,6 @@ constructor( action(JvmVariant(project = project, variantType = Lint)) } } + variantCache.clear() } } \ No newline at end of file diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ComputeWorkspaceDependenciesTask.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ComputeWorkspaceDependenciesTask.kt index 25bd3c23..b8c6fdd7 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ComputeWorkspaceDependenciesTask.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ComputeWorkspaceDependenciesTask.kt @@ -26,6 +26,7 @@ import org.gradle.api.Project import org.gradle.api.file.RegularFile import org.gradle.api.file.RegularFileProperty import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.Property import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.OutputFile @@ -60,6 +61,7 @@ abstract class ComputeWorkspaceDependenciesTask : DefaultTask() { internal fun register( rootProject: Project, variantBuilderProvider: Lazy, + limitDependencyResolutionParallelism: Property, ): TaskProvider { val computeTask = rootProject.tasks .register(TASK_NAME) { @@ -70,6 +72,7 @@ abstract class ComputeWorkspaceDependenciesTask : DefaultTask() { ResolveVariantDependenciesTask.register( rootProject, variantBuilderProvider, + limitDependencyResolutionParallelism, ) { taskProvider -> computeTask.configure { compileDependenciesJsons.add(taskProvider.flatMap { it.resolvedDependencies }) diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ResolveVariantDependenciesTask.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ResolveVariantDependenciesTask.kt index 2c800180..520d6c1b 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ResolveVariantDependenciesTask.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/ResolveVariantDependenciesTask.kt @@ -24,6 +24,7 @@ import com.grab.grazel.gradle.dependencies.model.ResolvedDependency import com.grab.grazel.gradle.variant.Variant import com.grab.grazel.gradle.variant.VariantBuilder import com.grab.grazel.gradle.variant.isBase +import com.grab.grazel.gradle.variant.isTest import com.grab.grazel.util.Json import com.grab.grazel.util.dependsOn import com.grab.grazel.util.fromJson @@ -33,6 +34,7 @@ import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.artifacts.ExternalDependency +import org.gradle.api.artifacts.ProjectDependency import org.gradle.api.artifacts.result.ResolvedComponentResult import org.gradle.api.file.RegularFile import org.gradle.api.file.RegularFileProperty @@ -171,6 +173,7 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() { internal fun register( rootProject: Project, variantBuilderProvider: Lazy, + limitDependencyResolutionParallelism: Property, subprojectTaskConfigure: (TaskProvider) -> Unit ) { // Register a lifecycle to aggregate all subproject tasks @@ -189,15 +192,20 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() { // First pass to create all tasks variantBuilder.onVariants(project) { variant -> processVariant( - project, - variant, - rootResolveDependenciesTask, - projectResolveDependenciesTask + project = project, + variant = variant, + rootResolveDependenciesTask = rootResolveDependenciesTask, + projectResolveDependenciesTask = projectResolveDependenciesTask ) } // Second pass to establish inter-dependencies based on extendsFrom property variantBuilder.onVariants(project) { variant -> - configureVariantTaskDependencies(project, variant, subprojectTaskConfigure) + configureVariantTaskDependencies( + project = project, + variant = variant, + limitDependencyResolutionParallelism = limitDependencyResolutionParallelism, + subprojectTaskConfigure = subprojectTaskConfigure + ) } } } @@ -226,10 +234,6 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() { ) { val compileConfigurationProvider = project.provider { variant.compileConfiguration } - val compileConfigurationComponents = compileConfigurationProvider.map { configs -> - configs.map { it.incoming.resolutionResult.root }.toList() - } - val externalDependencies = compileConfigurationProvider.map { configs -> configs .asSequence() @@ -259,7 +263,11 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() { ) { variantName.set(variant.name) base.set(variant.isBase) - compileConfiguration.set(compileConfigurationComponents) + + variant.compileConfiguration.forEach { + compileConfiguration.add(it.incoming.resolutionResult.rootComponent) + } + compileDirectDependencies.set(directDependenciesCompile) compileExcludeRules.set(excludeRulesCompile) resolvedDependencies.set(resolvedDependenciesJson) @@ -272,23 +280,39 @@ internal abstract class ResolveVariantDependenciesTask : DefaultTask() { private fun configureVariantTaskDependencies( project: Project, variant: Variant<*>, + limitDependencyResolutionParallelism: Property, subprojectTaskConfigure: (TaskProvider) -> Unit ) { val tasks = project.tasks - val taskName = variant.name + "ResolveDependencies" - val resolveTask = tasks.named(taskName) - resolveTask.configure { + val variantResolveTaskName = variant.name + "ResolveDependencies" + val resolveTask = tasks.named(variantResolveTaskName) { val variantTask = this variant.extendsFrom.forEach { extends -> - try { - val extendsTasksName = extends + "ResolveDependencies" - val extendsTask = tasks.named( - extendsTasksName - ) - variantTask.baseDependenciesJsons.add(extendsTask.flatMap { it.resolvedDependencies }) - } catch (e: Exception) { - // TODO(arun) Handle gracefully - } + val extendsTasksName = extends + "ResolveDependencies" + val extendsTask = tasks.named( + extendsTasksName + ) + variantTask.baseDependenciesJsons.add(extendsTask.flatMap { it.resolvedDependencies }) + } + } + + if (!variant.variantType.isTest && limitDependencyResolutionParallelism.get()) { + // Make dependency resolution task of this project dependent on successor projects + variant.compileConfiguration.forEach { configuration -> + configuration.allDependencies + .asSequence() + .filterIsInstance() + .map { it.dependencyProject } + .filter { it != project } + .forEach { depProject -> + resolveTask.configure { + dependsOn(depProject.tasks.named("defaultResolveDependencies")) + try { + dependsOn(depProject.tasks.named(variantResolveTaskName)) + } catch (ignore: Exception) { + } + } + } } } subprojectTaskConfigure(resolveTask) diff --git a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/TasksManager.kt b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/TasksManager.kt index 6b220d80..4e859b28 100644 --- a/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/TasksManager.kt +++ b/grazel-gradle-plugin/src/main/kotlin/com/grab/grazel/tasks/internal/TasksManager.kt @@ -50,8 +50,9 @@ constructor( */ fun configTasks() { val computeWorkspaceDependenciesTask = ComputeWorkspaceDependenciesTask.register( - rootProject, - grazelComponent.variantBuilder(), + rootProject = rootProject, + variantBuilderProvider = grazelComponent.variantBuilder(), + limitDependencyResolutionParallelism = grazelComponent.extension().experiments.limitDependencyResolutionParallelism ) // Root bazel file generation task that should run at the start of migration val rootGenerateBazelScriptsTasks = GenerateRootBazelScriptsTask.register( diff --git a/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/DefaultVariantBuilderTest.kt b/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/DefaultVariantBuilderTest.kt index 5b3a0382..65905b42 100644 --- a/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/DefaultVariantBuilderTest.kt +++ b/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/DefaultVariantBuilderTest.kt @@ -102,7 +102,7 @@ class DefaultVariantBuilderTest { variants = androidVariants.filter { it.variantType == VariantType.Test }, size = 2, message = "BuiltType build variants are built", - "debugTest", "releaseTest" + "debugUnitTest", "releaseUnitTest" ) assertEquals( @@ -133,7 +133,7 @@ class DefaultVariantBuilderTest { variants = flavorVariants.filter { it.variantType == VariantType.Test }, size = 2, message = "Flavor test variants are built", - "paidTest", "freeTest" + "paidUnitTest", "freeUnitTest" ) assert( diff --git a/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/VariantTest.kt b/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/VariantTest.kt index 87f4378f..238f8954 100644 --- a/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/VariantTest.kt +++ b/grazel-gradle-plugin/src/test/kotlin/com/grab/grazel/gradle/variant/VariantTest.kt @@ -308,7 +308,7 @@ class VariantTest { ) @Test - fun `assert android non extends from are parsed`() { + fun `assert android non variant extendsfrom are parsed`() { setupAndroidVariantProject(androidProject) androidBuildType( @@ -326,6 +326,8 @@ class VariantTest { assertThat(androidTestVariant.extendsFrom).containsExactly( "default", "debug", + "test", + "androidTest" ) } androidBuildType( diff --git a/maven_install.json b/maven_install.json index 3dd527af..d5540863 100755 --- a/maven_install.json +++ b/maven_install.json @@ -1,13 +1,13 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": -963884179, - "__RESOLVED_ARTIFACTS_HASH": -1204912076, + "__INPUT_ARTIFACTS_HASH": -963884179, + "__RESOLVED_ARTIFACTS_HASH": -1204912076, "conflict_resolution": { "androidx.annotation:annotation:1.5.0": "androidx.annotation:annotation:1.6.0", - "androidx.databinding:databinding-adapters:7.2.2": "androidx.databinding:databinding-adapters:8.1.4", - "androidx.databinding:databinding-common:7.2.2": "androidx.databinding:databinding-common:8.1.4", - "androidx.databinding:databinding-runtime:7.2.2": "androidx.databinding:databinding-runtime:8.1.4", - "androidx.databinding:viewbinding:7.2.2": "androidx.databinding:viewbinding:8.1.4", + "androidx.databinding:databinding-adapters:7.2.2": "androidx.databinding:databinding-adapters:8.1.4", + "androidx.databinding:databinding-common:7.2.2": "androidx.databinding:databinding-common:8.1.4", + "androidx.databinding:databinding-runtime:7.2.2": "androidx.databinding:databinding-runtime:8.1.4", + "androidx.databinding:viewbinding:7.2.2": "androidx.databinding:viewbinding:8.1.4", "org.jetbrains.kotlin:kotlin-reflect:1.8.10": "org.jetbrains.kotlin:kotlin-reflect:1.9.20" }, "artifacts": { @@ -283,33 +283,33 @@ }, "androidx.databinding:databinding-adapters:aar": { "shasums": { - "jar": "7909833618f8628b5afadc764949a5e764906320864730bec124392337585f8e" + "jar": "7909833618f8628b5afadc764949a5e764906320864730bec124392337585f8e" }, - "version": "8.1.4" + "version": "8.1.4" }, "androidx.databinding:databinding-common": { "shasums": { - "jar": "66cab82639dac0f6c2433464c093b074d608c4bb887ec38a9b8bc4ac98126732" + "jar": "66cab82639dac0f6c2433464c093b074d608c4bb887ec38a9b8bc4ac98126732" }, - "version": "8.1.4" + "version": "8.1.4" }, "androidx.databinding:databinding-ktx:aar": { "shasums": { - "jar": "f209c99c1796df3015719600a6cc781bf4095578d1564d949cac2df8d90262cb" + "jar": "f209c99c1796df3015719600a6cc781bf4095578d1564d949cac2df8d90262cb" }, - "version": "8.1.4" + "version": "8.1.4" }, "androidx.databinding:databinding-runtime:aar": { "shasums": { - "jar": "dd2d8598912be8a4fd250f7b302c8341a0eaec389dcc000a8744a0ac5ae83a32" + "jar": "dd2d8598912be8a4fd250f7b302c8341a0eaec389dcc000a8744a0ac5ae83a32" }, - "version": "8.1.4" + "version": "8.1.4" }, "androidx.databinding:viewbinding:aar": { "shasums": { - "jar": "e71da76a17b18be4fc00c539644a46f8e4610764ca94868ee10d3be736f0cc68" + "jar": "e71da76a17b18be4fc00c539644a46f8e4610764ca94868ee10d3be736f0cc68" }, - "version": "8.1.4" + "version": "8.1.4" }, "androidx.drawerlayout:drawerlayout:aar": { "shasums": {