Fix creation of empty source sets in tests

This commit is contained in:
Andrey Uskov
2019-07-11 16:37:20 +03:00
parent 1336f65535
commit 0c1d8e29b9
2 changed files with 27 additions and 1 deletions
@@ -200,7 +200,8 @@ public abstract class ExternalSystemImportingTestCase extends ExternalSystemTest
final Ref<Couple<String>> error = Ref.create();
ExternalSystemUtil.refreshProjects(
new ImportSpecBuilder(myProject, getExternalSystemId())
new TestImportSpecBuilder(myProject, getExternalSystemId())
.setCreateEmptyContentRoots(projectSettings.isCreateEmptyContentRootDirectories())
.use(ProgressExecutionMode.MODAL_SYNC)
.callback(new ExternalProjectRefreshCallback() {
@Override
@@ -0,0 +1,25 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.codeInsight.gradle;
import com.intellij.openapi.externalSystem.importing.ImportSpec;
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
public class TestImportSpecBuilder extends ImportSpecBuilder {
public TestImportSpecBuilder(
@NotNull Project project,
@NotNull ProjectSystemId id
) {
super(project, id);
}
public ImportSpecBuilder setCreateEmptyContentRoots(boolean value) {
return createDirectoriesForEmptyContentRoots();
}
}