Status Update
Comments
js...@google.com <js...@google.com> #2
// TODO(b/283870344) - fix 3 LintErrors in reportFile
@Test
fun `test K2 UAST`() {
...
val reportFile =
File(project.getSubproject("app").buildDir, "reports/lint-results-debug.txt")
...
}
so... how can we investigate that file? Or, could you post what LintErrors we need to fix?
OOC, with backtick, is it possible to pass a test filter to run that specific test?
sp...@google.com <sp...@google.com> #3
so... how can we investigate that file? Or, could you post what LintErrors we need to fix?
Pasted below:
/Volumes/android/studio-main/out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/androidLib: Error: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: Collection contains no element matching the predicate.
Stack: NoSuchElementException:KtModuleProviderImpl.getKtModuleForKtElement(KtModuleProviderImpl.kt:80)←ProjectStructureProviderKt.getKtModule(ProjectStructureProvider.kt:24)←FirKotlinUastLanguagePlugin.isSupportedElement(FirKotlinUastLanguagePlugin.kt:49)←FirKotlinUastLanguagePlugin.convertElementWithParent(FirKotlinUastLanguagePlugin.kt:58)←UastFacade.convertElementWithParent(UastContext.kt:64)←DefaultUastParser.parse(DefaultUastParser.kt:165)←LintDriver$checkBuildScripts$1.run(LintDriver.kt:1524)←LintClient.runReadAction(LintClient.kt:1700)←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2871)←LintDriver.checkBuildScripts(LintDriver.kt:1522)←LintDriver.runFileDetectors(LintDriver.kt:1401)←LintDriver.checkProject(LintDriver.kt:1148)←LintDriver.checkProjectRoot(LintDriver.kt:619)←LintDriver.access$checkProjectRoot(LintDriver.kt:170)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:444)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)←LintDriver.doAnalyze(LintDriver.kt:500)←LintDriver.analyzeOnly(LintDriver.kt:441)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient.run(LintCliClient.kt:276)←LintCliClient.run$default(LintCliClient.kt:259)←LintCliClient.analyzeOnly(LintCliClient.kt:234)←Main.run(Main.java:1737)←Main.run(Main.java:284)←GeneratedMethodAccessor587.invoke(null:-1)←DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)←Method.invoke(Method.java:568)←AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:98)←AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:87)←AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:62)←DefaultWorkerServer.execute(DefaultWorkerServer.java:63)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)←ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)←NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)←AbstractWorker$1.call(AbstractWorker.java:44)←AbstractWorker$1.call(AbstractWorker.java:41)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)←DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)←AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)←NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)←DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:169)←FutureTask.run(FutureTask.java:264)←DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)←DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)←DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)←Factories$1.create(Factories.java:31)←DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)←DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)←DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)←Executors$RunnableAdapter.call(Executors.java:539)←FutureTask.run(FutureTask.java:264)←ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)←ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)←ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)←ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)←Thread.run(Thread.java:833)
You can run with --stacktrace or set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
/Volumes/android/studio-main/out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/app: Error: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: Collection contains no element matching the predicate.
Stack: NoSuchElementException:KtModuleProviderImpl.getKtModuleForKtElement(KtModuleProviderImpl.kt:80)←ProjectStructureProviderKt.getKtModule(ProjectStructureProvider.kt:24)←FirKotlinUastLanguagePlugin.isSupportedElement(FirKotlinUastLanguagePlugin.kt:49)←FirKotlinUastLanguagePlugin.convertElementWithParent(FirKotlinUastLanguagePlugin.kt:58)←UastFacade.convertElementWithParent(UastContext.kt:64)←DefaultUastParser.parse(DefaultUastParser.kt:165)←LintDriver$checkBuildScripts$1.run(LintDriver.kt:1524)←LintClient.runReadAction(LintClient.kt:1700)←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2871)←LintDriver.checkBuildScripts(LintDriver.kt:1522)←LintDriver.runFileDetectors(LintDriver.kt:1401)←LintDriver.checkProject(LintDriver.kt:1148)←LintDriver.checkProjectRoot(LintDriver.kt:619)←LintDriver.access$checkProjectRoot(LintDriver.kt:170)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:444)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)←LintDriver.doAnalyze(LintDriver.kt:500)←LintDriver.analyzeOnly(LintDriver.kt:441)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient.run(LintCliClient.kt:276)←LintCliClient.run$default(LintCliClient.kt:259)←LintCliClient.analyzeOnly(LintCliClient.kt:234)←Main.run(Main.java:1737)←Main.run(Main.java:284)←GeneratedMethodAccessor587.invoke(null:-1)←DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)←Method.invoke(Method.java:568)←AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:98)←AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:87)←AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:62)←DefaultWorkerServer.execute(DefaultWorkerServer.java:63)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)←ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)←NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)←AbstractWorker$1.call(AbstractWorker.java:44)←AbstractWorker$1.call(AbstractWorker.java:41)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)←DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)←AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)←NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)←DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:169)←FutureTask.run(FutureTask.java:264)←DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)←DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)←DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)←Factories$1.create(Factories.java:31)←DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)←DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)←DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)←Executors$RunnableAdapter.call(Executors.java:539)←FutureTask.run(FutureTask.java:264)←ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)←ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)←ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)←ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)←Thread.run(Thread.java:833)
You can run with --stacktrace or set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
/Volumes/android/studio-main/out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/kmpFirstLib: Error: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
Message: Collection contains no element matching the predicate.
Stack: NoSuchElementException:KtModuleProviderImpl.getKtModuleForKtElement(KtModuleProviderImpl.kt:80)←ProjectStructureProviderKt.getKtModule(ProjectStructureProvider.kt:24)←FirKotlinUastLanguagePlugin.isSupportedElement(FirKotlinUastLanguagePlugin.kt:49)←FirKotlinUastLanguagePlugin.convertElementWithParent(FirKotlinUastLanguagePlugin.kt:58)←UastFacade.convertElementWithParent(UastContext.kt:64)←DefaultUastParser.parse(DefaultUastParser.kt:165)←LintDriver$checkBuildScripts$1.run(LintDriver.kt:1524)←LintClient.runReadAction(LintClient.kt:1700)←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2871)←LintDriver.checkBuildScripts(LintDriver.kt:1522)←LintDriver.runFileDetectors(LintDriver.kt:1401)←LintDriver.checkProject(LintDriver.kt:1148)←LintDriver.checkProjectRoot(LintDriver.kt:619)←LintDriver.access$checkProjectRoot(LintDriver.kt:170)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:444)←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)←LintDriver.doAnalyze(LintDriver.kt:500)←LintDriver.analyzeOnly(LintDriver.kt:441)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient$analyzeOnly$1.invoke(LintCliClient.kt:234)←LintCliClient.run(LintCliClient.kt:276)←LintCliClient.run$default(LintCliClient.kt:259)←LintCliClient.analyzeOnly(LintCliClient.kt:234)←Main.run(Main.java:1737)←Main.run(Main.java:284)←GeneratedMethodAccessor587.invoke(null:-1)←DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)←Method.invoke(Method.java:568)←AndroidLintWorkAction.invokeLintMainRunMethod(AndroidLintWorkAction.kt:98)←AndroidLintWorkAction.runLint(AndroidLintWorkAction.kt:87)←AndroidLintWorkAction.execute(AndroidLintWorkAction.kt:62)←DefaultWorkerServer.execute(DefaultWorkerServer.java:63)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)←NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)←ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)←NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)←AbstractWorker$1.call(AbstractWorker.java:44)←AbstractWorker$1.call(AbstractWorker.java:41)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)←DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)←DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)←DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)←DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)←DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)←AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)←NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)←DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:169)←FutureTask.run(FutureTask.java:264)←DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)←DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)←DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)←Factories$1.create(Factories.java:31)←DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)←DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)←DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)←DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)←Executors$RunnableAdapter.call(Executors.java:539)←FutureTask.run(FutureTask.java:264)←ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)←ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)←ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)←ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)←Thread.run(Thread.java:833)
You can run with --stacktrace or set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
OOC, with backtick, is it possible to pass a test filter to run that specific test?
I don't know how to do it, but let me know if you figure it out :)
js...@google.com <js...@google.com> #4
OOC, with backtick, is it possible to pass a test filter to run that specific test?
I don't know how to do it, but let me know if you figure it out :)
For gradle, it's surprisingly simple:
tools $ ./gradlew :base:build-system:integration-test:lint:test --tests='KotlinMultiplatformAndroidLintTest.*K2 UAST*'
For bazel, duh, I was chasing a wrong target:
Anyhow, the following seems to work:
studio-main $ tools/base/bazel/bazel test //tools/base/build-system/integration-test/lint:kotlin-multiplatform-tests --test_filter="KotlinMultiplatformAndroidLintTest.*K2 UAST.*"
js...@google.com <js...@google.com> #5
how can we investigate that file?
Answer to myself:
studio-main $ find out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/ | grep "lint-result"
out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/app/build/reports/lint-results-debug.html
out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/app/build/reports/lint-results-debug.xml
out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/app/build/reports/lint-results-debug.txt
There, that lint-results-debug.txt
has three errors mentioned at
js...@google.com <js...@google.com> #6
This module membership failure inside Analysis API module structure is usually due to a wrong project structure. So I tried to see how UastEnvironment.Module
is created.
Alas, I was not able to set a debugging point on Lint cli source for both options (./gradlew
and bazel
run), e.g.,
tools $ DEBUG_INNER_TEST=1 ./gradlew :base:build-system:integration-test:lint:test --tests='KotlinMultiplatformAndroidLintTest.*K2 UAST*' --no-daemon -Dorg.gradle.debug=true
or
studio-main $ tools/base/bazel/bazel test //tools/base/build-system/integration-test/lint:kotlin-multiplatform-tests --test_filter="KotlinMultiplatformAndroidLintTest.*K2 UAST.*" --java_debug
since, I guess, gradle task runner is wrapping everything. (I do remember that, with a similar reason, I was not able to fully profile Lint and Metalava from ./gradlew
.)
As per the error message,
You can run with --stacktrace or set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout. [LintError]
I tried that too, but there is nothing I can see.
So, old school debugging:
UastFacade.convertElementWithParent(UastContext.kt:64)←DefaultUastParser.parse(DefaultUastParser.kt:165)
around that line, added:
try {
return UastFacade.convertElementWithParent(psiFile, UFile::class.java) as? UFile
} catch (e : NoSuchElementException) {
throw IllegalStateException(psiFile.virtualFile.path, e)
}
One more thing to note is, bazel
run didn't pick up my change, and only ./gradlew
run did so. There, I found a surprising output:
Message: .../studio-main/out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/androidLib/build.gradle.kts
Stack: IllegalStateException:DefaultUastParser.parse(DefaultUastParser.kt:168)
←LintDriver$checkBuildScripts$1.run(LintDriver.kt:1524)
←LintClient.runReadAction(LintClient.kt:1700)
←LintDriver$LintClientWrapper.runReadAction(LintDriver.kt:2871)
←LintDriver.checkBuildScripts(LintDriver.kt:1522)
←LintDriver.runFileDetectors(LintDriver.kt:1401)
←LintDriver.checkProject(LintDriver.kt:1148)
←LintDriver.checkProjectRoot(LintDriver.kt:619)
←LintDriver.access$checkProjectRoot(LintDriver.kt:170)
←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:444)
←LintDriver$analyzeOnly$1.invoke(LintDriver.kt:441)
... [LintError]
Why surprising? Because, after GradleDetectorTest
pass w/ K2 UAST (kinda // This should never happen
).
I chased where/how such build.gradle.kts
is specified/conveyed to project model. E.g., from out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/kmpFirstLib/build/intermediates/lint_model/androidMain/module.xml
:
<lint-module
format="1"
dir=".../studio-main/out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/kmpFirstLib"
name=":kmpFirstLib"
type="LIBRARY"
maven="Kotlin Multiplatform:kmpFirstLib:"
agpVersion="8.2.0-dev"
buildFolder="build"
bootClassPath=".../studio-main/prebuilts/studio/sdk/linux/platforms/android-33/android.jar:.../studio-main/prebuilts/studio/sdk/linux/build-tools/34.0.0-rc3/core-lambda-stubs.jar"
javaSourceLevel="1.8"
compileTarget="android-33"
neverShrinking="true">
<lintOptions
enable="ByteOrderMark"
absolutePaths="true"
checkReleaseBuilds="true"
explainIssues="true">
<severities>
<severity
id="ByteOrderMark"
severity="DEFAULT_ENABLED" />
</severities>
</lintOptions>
<variant name="androidMain"/>
</lint-module>
that dir
could be one root
candidate. And from out/build/base/build-system/integration-test/lint/build/tests/KotlinMultiplatformAndroidLintTest/test_K2_UAST_lintAnalysisPerComponent_true_/kotlinMultiplatform/kmpFirstLib/build/intermediates/lint_model/androidMain/androidMain.xml
(as per <variant name="androidMain"/>
):
<variant
name="androidMain"
package="com.example.kmpfirstlib"
minSdkVersion="22"
targetSdkVersion="22"
mergedManifest="build/intermediates/merged_manifest/androidMain/AndroidManifest.xml"
manifestMergeReport="build/outputs/logs/manifest-merger-main-report.txt"
proguardFiles="build/intermediates/default_proguard_files/global/proguard-android.txt-8.2.0-dev"
partialResultsDir="build/intermediates/lint_partial_results/androidMain/out">
<buildFeatures
namespacing="REQUIRED"/>
<sourceProviders>
<sourceProvider
manifests="src/androidMain/AndroidManifest.xml"
javaDirectories="src/androidMain/kotlin:src/commonMain/kotlin"/>
</sourceProviders>
<testSourceProviders>
</testSourceProviders>
<testFixturesSourceProviders>
</testFixturesSourceProviders>
<artifact
classOutputs="build/classes/kotlin/android/main"
type="MAIN"
applicationId="com.example.kmpfirstlib"
desugaredMethodsFiles=".../studio-main/out/build/base/build-system/integration-test/lint/build/GRADLE_USER_HOME/3/caches/transforms-3/04bd09521e42daf114dd1a450924f0c2/transformed/D8BackportedDesugaredMethods.txt">
</artifact>
</variant>
sourceProvider.javaDirectories
seem like another root
candidate, but if it's given, the previous dir
will be ignored, where build.gradle.kts
is usually sitting. While tracking javaDirectories
, I finally found a simple fix:
sp...@google.com <sp...@google.com> #7
Alas, I was not able to set a debugging point on Lint cli source for both options (./gradlew and bazel run), e.g.,
tools $ DEBUG_INNER_TEST=1 ./gradlew :base:build-system:integration-test:lint:test --tests='KotlinMultiplatformAndroidLintTest.*K2 UAST*' --no-daemon -Dorg.gradle.debug=true
I'm able to debug using the following command:
DEBUG_INNER_TEST=1 ./gradlew :base:build-system:integration-test:lint:test --tests='KotlinMultiplatformAndroidLintTest.*K2 UAST*'
With the Android Studio
project (not the tools-gradle
) project open in Intellij, I run a remote debugger with port 5006 (not 5005).
Does that work for you?
js...@google.com <js...@google.com> #8
Duh! Why did I add additional flags? :'( Yeah, having only DEBUG_INNER_TEST=1
addition works! And now I can clearly see how module structure / roots are passing around and my fix works.
Re: port 5006, fortunately(?), that's the only available process/port at that moment, so I didn't pay attention, but thanks for the reminder.
js...@google.com <js...@google.com>
js...@google.com <js...@google.com> #9
Just a note for myself (or others): while investigating
tools $ gradlew.bat :base:build-system:integration-test:lint:test --tests='LintStandaloneTest'
complained it can't find that...
...
> Task :base:build-system:integration-test:lint:test FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':base:build-system:integration-test:lint:test'.
> No tests found for given includes: ['LintStandaloneTest'](--tests filter)
...
which seems like quotes are added to --tests
filter verbatim.
ya...@jetbrains.com <ya...@jetbrains.com> #10
Hi, in which releases the fix is available?
Description
Currently, there are LintErrors when running lint with K2 UAST via Gradle on a KMP project.
See the test added to KotlinMultiplatformAndroidLintTest.kt here .