From 876be2a7c1c6070db320a3daa27fa2913c7f199d Mon Sep 17 00:00:00 2001 From: Sergei Vorobyov Date: Tue, 18 Jun 2024 14:39:14 +0200 Subject: [PATCH] [Gradle|Sync] cleanup: the isCompilerOutputInherited property name and field name are consistent GitOrigin-RevId: dae2b9a27d5cb1763022a7e1dfe4c4237e3f8e6b --- .../GradleSourceSetModelBuilder.java | 14 +++++++------- .../model/DefaultExternalSourceDirectorySet.java | 12 ++++++------ .../ExternalProjectSerializationService.java | 2 +- .../configuration/mpp/populateMppModuleDataNode.kt | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/plugins/gradle/tooling-extension-impl/src/com/intellij/gradle/toolingExtension/impl/model/sourceSetModel/GradleSourceSetModelBuilder.java b/plugins/gradle/tooling-extension-impl/src/com/intellij/gradle/toolingExtension/impl/model/sourceSetModel/GradleSourceSetModelBuilder.java index 45b8af2258ea..28d89710bbd3 100644 --- a/plugins/gradle/tooling-extension-impl/src/com/intellij/gradle/toolingExtension/impl/model/sourceSetModel/GradleSourceSetModelBuilder.java +++ b/plugins/gradle/tooling-extension-impl/src/com/intellij/gradle/toolingExtension/impl/model/sourceSetModel/GradleSourceSetModelBuilder.java @@ -593,7 +593,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { if (sourceDirectorySet.getGradleOutputDirs().isEmpty()) { sourceDirectorySet.setGradleOutputDirs(Collections.singleton(GradleProjectUtil.getBuildDirectory(project))); } - sourceDirectorySet.setInheritedCompilerOutput(sourceSetResolutionContext.isIdeaInheritOutputDirs); + sourceDirectorySet.setCompilerOutputPathInherited(sourceSetResolutionContext.isIdeaInheritOutputDirs); DefaultExternalSourceDirectorySet resourcesDirectorySet = new DefaultExternalSourceDirectorySet(); resourcesDirectorySet.setName(sourceSet.getResources().getName()); @@ -606,7 +606,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { if (resourcesDirectorySet.getGradleOutputDirs().isEmpty()) { resourcesDirectorySet.setGradleOutputDirs(sourceDirectorySet.getGradleOutputDirs()); } - resourcesDirectorySet.setInheritedCompilerOutput(sourceSetResolutionContext.isIdeaInheritOutputDirs); + resourcesDirectorySet.setCompilerOutputPathInherited(sourceSetResolutionContext.isIdeaInheritOutputDirs); DefaultExternalSourceDirectorySet generatedSourceDirectorySet = null; Set generatedSourceDirs = new LinkedHashSet<>(sourceDirectorySet.getSrcDirs()); @@ -619,7 +619,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { generatedSourceDirectorySet.setName("generated " + sourceDirectorySet.getName()); generatedSourceDirectorySet.setSrcDirs(generatedSourceDirs); generatedSourceDirectorySet.setGradleOutputDirs(sourceDirectorySet.getGradleOutputDirs()); - generatedSourceDirectorySet.setInheritedCompilerOutput(sourceDirectorySet.isCompilerOutputPathInherited()); + generatedSourceDirectorySet.setCompilerOutputPathInherited(sourceDirectorySet.isCompilerOutputPathInherited()); } boolean isIdeaTestSourceSet = sourceSetResolutionContext.ideaTestSourceDirs.containsAll(sourceDirectorySet.getSrcDirs()); @@ -707,7 +707,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { else { testSourceDirectorySet.setOutputDir(new File(project.getProjectDir(), "out/test/classes")); } - testSourceDirectorySet.setInheritedCompilerOutput(sourceDirectorySet.isCompilerOutputPathInherited()); + testSourceDirectorySet.setCompilerOutputPathInherited(sourceDirectorySet.isCompilerOutputPathInherited()); externalSourceSet.addSource(ExternalSystemSourceType.TEST, testSourceDirectorySet); } @@ -729,7 +729,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { else { testResourcesDirectorySet.setOutputDir(new File(project.getProjectDir(), "out/test/resources")); } - testResourcesDirectorySet.setInheritedCompilerOutput(resourcesDirectorySet.isCompilerOutputPathInherited()); + testResourcesDirectorySet.setCompilerOutputPathInherited(resourcesDirectorySet.isCompilerOutputPathInherited()); externalSourceSet.addSource(ExternalSystemSourceType.TEST_RESOURCE, testResourcesDirectorySet); } @@ -746,7 +746,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { testGeneratedDirectorySet.setSrcDirs(testGeneratedSourceDirs); testGeneratedDirectorySet.setGradleOutputDirs(Collections.singleton(generatedSourceDirectorySet.getOutputDir())); testGeneratedDirectorySet.setOutputDir(generatedSourceDirectorySet.getOutputDir()); - testGeneratedDirectorySet.setInheritedCompilerOutput(generatedSourceDirectorySet.isCompilerOutputPathInherited()); + testGeneratedDirectorySet.setCompilerOutputPathInherited(generatedSourceDirectorySet.isCompilerOutputPathInherited()); externalSourceSet.addSource(ExternalSystemSourceType.TEST_GENERATED, testGeneratedDirectorySet); } @@ -832,7 +832,7 @@ public class GradleSourceSetModelBuilder extends AbstractModelBuilderService { if (sourceDirectorySet != null) { generatedDirectorySet.setGradleOutputDirs(Collections.singleton(sourceDirectorySet.getOutputDir())); generatedDirectorySet.setOutputDir(sourceDirectorySet.getOutputDir()); - generatedDirectorySet.setInheritedCompilerOutput(sourceDirectorySet.isCompilerOutputPathInherited()); + generatedDirectorySet.setCompilerOutputPathInherited(sourceDirectorySet.isCompilerOutputPathInherited()); } externalSourceSet.addSource(generatedSourceType, generatedDirectorySet); } diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/model/DefaultExternalSourceDirectorySet.java b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/model/DefaultExternalSourceDirectorySet.java index e8702f65df3a..79502182a76a 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/model/DefaultExternalSourceDirectorySet.java +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/model/DefaultExternalSourceDirectorySet.java @@ -19,7 +19,7 @@ public final class DefaultExternalSourceDirectorySet implements ExternalSourceDi private final FilePatternSetImpl patterns; private @NotNull List filters; - private boolean inheritedCompilerOutput; + private boolean isCompilerOutputInherited; public DefaultExternalSourceDirectorySet() { srcDirs = new HashSet<>(0); @@ -70,7 +70,11 @@ public final class DefaultExternalSourceDirectorySet implements ExternalSourceDi @Override public boolean isCompilerOutputPathInherited() { - return inheritedCompilerOutput; + return isCompilerOutputInherited; + } + + public void setCompilerOutputPathInherited(boolean isCompilerOutputInherited) { + this.isCompilerOutputInherited = isCompilerOutputInherited; } @NotNull @@ -104,10 +108,6 @@ public final class DefaultExternalSourceDirectorySet implements ExternalSourceDi this.patterns.setExcludes(patterns.getExcludes()); } - public void setInheritedCompilerOutput(boolean inheritedCompilerOutput) { - this.inheritedCompilerOutput = inheritedCompilerOutput; - } - @NotNull @Override public List getFilters() { diff --git a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/serialization/ExternalProjectSerializationService.java b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/serialization/ExternalProjectSerializationService.java index fbda859f45bc..6b89e116a644 100644 --- a/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/serialization/ExternalProjectSerializationService.java +++ b/plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/serialization/ExternalProjectSerializationService.java @@ -371,7 +371,7 @@ public final class ExternalProjectSerializationService implements SerializationS directorySet.setSrcDirs(readFileSet(reader, SOURCE_DIRECTORY_SRC_DIRS_FIELD)); directorySet.setGradleOutputDirs(readFileList(reader, SOURCE_DIRECTORY_GRADLE_OUTPUTS_FIELD)); directorySet.setOutputDir(assertNotNull(readFile(reader, SOURCE_DIRECTORY_OUTPUT_DIR_FIELD))); - directorySet.setInheritedCompilerOutput(readBoolean(reader, SOURCE_DIRECTORY_INHERIT_COMPILER_OUTPUT_FIELD)); + directorySet.setCompilerOutputPathInherited(readBoolean(reader, SOURCE_DIRECTORY_INHERIT_COMPILER_OUTPUT_FIELD)); directorySet.setPatterns(readPatterns(reader)); directorySet.setFilters(readFilters(reader)); reader.stepOut(); diff --git a/plugins/kotlin/gradle/gradle-java/src/org/jetbrains/kotlin/idea/gradleJava/configuration/mpp/populateMppModuleDataNode.kt b/plugins/kotlin/gradle/gradle-java/src/org/jetbrains/kotlin/idea/gradleJava/configuration/mpp/populateMppModuleDataNode.kt index 5548debb2827..21b31d786cd6 100644 --- a/plugins/kotlin/gradle/gradle-java/src/org/jetbrains/kotlin/idea/gradleJava/configuration/mpp/populateMppModuleDataNode.kt +++ b/plugins/kotlin/gradle/gradle-java/src/org/jetbrains/kotlin/idea/gradleJava/configuration/mpp/populateMppModuleDataNode.kt @@ -439,7 +439,7 @@ private fun createExternalSourceSet( dirSet.outputDir = effectiveClassesDir dirSet.srcDirs = compilation.declaredSourceSets.flatMapTo(LinkedHashSet()) { it.sourceDirs } dirSet.gradleOutputDirs = compilation.output.classesDirs - dirSet.setInheritedCompilerOutput(false) + dirSet.isCompilerOutputPathInherited = false } } if (resourcesDir != null) { @@ -447,7 +447,7 @@ private fun createExternalSourceSet( dirSet.outputDir = resourcesDir dirSet.srcDirs = compilation.declaredSourceSets.flatMapTo(LinkedHashSet()) { it.resourceDirs } dirSet.gradleOutputDirs = listOf(resourcesDir) - dirSet.setInheritedCompilerOutput(false) + dirSet.isCompilerOutputPathInherited = false } }