diff options
author | Karima Ichou <karimai@google.com> | 2022-01-06 12:33:38 +0000 |
---|---|---|
committer | Karima Ichou <karimai@google.com> | 2022-01-19 10:16:01 +0000 |
commit | 98c6d5c52a053030ee9e7c03b86f8eb25355b05f (patch) | |
tree | 3087dcf0915cbd345db2deda2b36d2f0ae863151 /android-lint/src | |
parent | cae37685a41cbfbab15da0553f033ec03bc7e1c6 (diff) | |
download | idea-98c6d5c52a053030ee9e7c03b86f8eb25355b05f.tar.gz |
Rework IdeBaseArtifact properties
classFolders and additionalClassesfolders are 2 prroperties mutually
used in the IDE and this change merges them into 2 properties to
correspond more to V2 design.
ClassFolder property showed a problematic usage: it is used to set the
compiler output path which is used by Platform and us.
the next steps would be to clean our internal usage of the compiler
output property : b/214217361, b/214032039.
The usage by Intellij which might affects us is related to unit tests
code coverage: This can be also deleted once we have support for Jacoco
runner.
Bug: 201055230
Test: existing
Change-Id: Icdf3d09c6aa78481e7c911e715cdb8559d5f114a
Diffstat (limited to 'android-lint/src')
-rw-r--r-- | android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt b/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt index 433bc0a0bf0..0b73d7abaf6 100644 --- a/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt +++ b/android-lint/src/com/android/tools/idea/lint/model/LintModelFactory.kt @@ -309,7 +309,7 @@ class LintModelFactory : LintModelModuleLoader { dependencies = getDependencies(artifact), generatedSourceFolders = artifact.generatedSourceFolders, generatedResourceFolders = artifact.generatedResourceFolders, - classOutputs = artifact.getClassFolders() + classOutputs = artifact.classesFolder.toList() ) } @@ -318,21 +318,10 @@ class LintModelFactory : LintModelModuleLoader { ): LintModelJavaArtifact { return DefaultLintModelJavaArtifact( dependencies = getDependencies(artifact), - classFolders = artifact.getClassFolders() + classFolders = artifact.classesFolder.toList() ) } - private fun IdeBaseArtifact.getClassFolders(): List<File> { - return if (additionalClassesFolders.isEmpty()) { - listOf(classesFolder) - } else { - val folders = ArrayList<File>(additionalClassesFolders.size + 1) - folders.add(classesFolder) - folders.addAll(additionalClassesFolders) - folders - } - } - private fun getBuildType(project: IdeAndroidProject, variant: IdeVariant): IdeBuildType { val buildTypeName = variant.buildType return project.buildTypes.first { it.buildType.name == buildTypeName }.buildType |