Skip to content

Commit

Permalink
Merge pull request #6 from unv-unv/unv/refactoring
Browse files Browse the repository at this point in the history
Reformat & refactoring
  • Loading branch information
VISTALL authored Aug 9, 2024
2 parents b3f7331 + 9fc5159 commit 7951ee6
Show file tree
Hide file tree
Showing 51 changed files with 5,037 additions and 4,734 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import consulo.externalSystem.service.project.ProjectData;
import consulo.process.ExecutionException;
import consulo.process.cmd.SimpleJavaParameters;
import consulo.util.lang.Pair;
import consulo.util.lang.Couple;
import org.gradle.tooling.model.idea.IdeaModule;
import org.gradle.tooling.model.idea.IdeaProject;

Expand All @@ -44,135 +44,143 @@
*/
public abstract class AbstractProjectResolverExtension implements GradleProjectResolverExtension {

@Nonnull
protected ProjectResolverContext resolverCtx;
@Nonnull
protected GradleProjectResolverExtension nextResolver;

@Override
public void setProjectResolverContext(@Nonnull ProjectResolverContext projectResolverContext) {
resolverCtx = projectResolverContext;
}

@Override
public void setNext(@Nonnull GradleProjectResolverExtension next) {
// there always should be at least gradle basic resolver further in the chain
//noinspection ConstantConditions
assert next != null;
nextResolver = next;
}

@Nullable
@Override
public GradleProjectResolverExtension getNext() {
return nextResolver;
}

@Nonnull
@Override
public ProjectData createProject() {
return nextResolver.createProject();
}

@Nonnull
@Override
public JavaProjectData createJavaProjectData() {
return nextResolver.createJavaProjectData();
}

@Override
public void populateProjectExtraModels(@Nonnull IdeaProject gradleProject, @Nonnull DataNode<ProjectData> ideProject) {
nextResolver.populateProjectExtraModels(gradleProject, ideProject);
}

@Nonnull
@Override
public ModuleData createModule(@Nonnull IdeaModule gradleModule, @Nonnull ProjectData projectData) {
return nextResolver.createModule(gradleModule, projectData);
}

@Override
public void populateModuleExtraModels(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleExtraModels(gradleModule, ideModule);
}

@Override
public void populateModuleContentRoots(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleContentRoots(gradleModule, ideModule);
}


@Override
public void populateModuleCompileOutputSettings(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleCompileOutputSettings(gradleModule, ideModule);
}

@Override
public void populateModuleDependencies(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule,
@Nonnull DataNode<ProjectData> ideProject) {
nextResolver.populateModuleDependencies(gradleModule, ideModule, ideProject);
}

@Nonnull
@Override
public Collection<TaskData> populateModuleTasks(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule,
@Nonnull DataNode<ProjectData> ideProject) throws IllegalArgumentException, IllegalStateException {
return nextResolver.populateModuleTasks(gradleModule, ideModule, ideProject);
}

@Nonnull
@Override
public Collection<TaskData> filterRootProjectTasks(@Nonnull List<TaskData> allTasks) {
return nextResolver.filterRootProjectTasks(allTasks);
}

@Nonnull
@Override
public Set<Class> getExtraProjectModelClasses() {
return Collections.emptySet();
}

@Nonnull
@Override
public Set<Class> getToolingExtensionsClasses() {
return Collections.emptySet();
}

@Nonnull
@Override
public List<Pair<String, String>> getExtraJvmArgs() {
return Collections.emptyList();
}

@Nonnull
@Override
public List<String> getExtraCommandLineArgs() {
return Collections.emptyList();
}

@Nonnull
@Override
public ExternalSystemException getUserFriendlyError(@Nonnull Throwable error,
@Nonnull String projectPath,
@Nullable String buildFilePath) {
return nextResolver.getUserFriendlyError(error, projectPath, buildFilePath);
}

@Override
public void enhanceRemoteProcessing(@Nonnull SimpleJavaParameters parameters) throws ExecutionException {
}

@Override
public void enhanceLocalProcessing(@Nonnull List<URL> urls) {
}

@Override
public void preImportCheck() {
}

@Override
public void enhanceTaskProcessing(@Nonnull List<String> taskNames,
@Nullable String debuggerSetup,
@Nonnull Consumer<String> initScriptConsumer) {
}
@Nonnull
protected ProjectResolverContext resolverCtx;
@Nonnull
protected GradleProjectResolverExtension nextResolver;

@Override
public void setProjectResolverContext(@Nonnull ProjectResolverContext projectResolverContext) {
resolverCtx = projectResolverContext;
}

@Override
public void setNext(@Nonnull GradleProjectResolverExtension next) {
// there always should be at least gradle basic resolver further in the chain
//noinspection ConstantConditions
assert next != null;
nextResolver = next;
}

@Nullable
@Override
public GradleProjectResolverExtension getNext() {
return nextResolver;
}

@Nonnull
@Override
public ProjectData createProject() {
return nextResolver.createProject();
}

@Nonnull
@Override
public JavaProjectData createJavaProjectData() {
return nextResolver.createJavaProjectData();
}

@Override
public void populateProjectExtraModels(@Nonnull IdeaProject gradleProject, @Nonnull DataNode<ProjectData> ideProject) {
nextResolver.populateProjectExtraModels(gradleProject, ideProject);
}

@Nonnull
@Override
public ModuleData createModule(@Nonnull IdeaModule gradleModule, @Nonnull ProjectData projectData) {
return nextResolver.createModule(gradleModule, projectData);
}

@Override
public void populateModuleExtraModels(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleExtraModels(gradleModule, ideModule);
}

@Override
public void populateModuleContentRoots(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleContentRoots(gradleModule, ideModule);
}


@Override
public void populateModuleCompileOutputSettings(@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule) {
nextResolver.populateModuleCompileOutputSettings(gradleModule, ideModule);
}

@Override
public void populateModuleDependencies(
@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule,
@Nonnull DataNode<ProjectData> ideProject
) {
nextResolver.populateModuleDependencies(gradleModule, ideModule, ideProject);
}

@Nonnull
@Override
public Collection<TaskData> populateModuleTasks(
@Nonnull IdeaModule gradleModule, @Nonnull DataNode<ModuleData> ideModule,
@Nonnull DataNode<ProjectData> ideProject
) throws IllegalArgumentException, IllegalStateException {
return nextResolver.populateModuleTasks(gradleModule, ideModule, ideProject);
}

@Nonnull
@Override
public Collection<TaskData> filterRootProjectTasks(@Nonnull List<TaskData> allTasks) {
return nextResolver.filterRootProjectTasks(allTasks);
}

@Nonnull
@Override
public Set<Class> getExtraProjectModelClasses() {
return Collections.emptySet();
}

@Nonnull
@Override
public Set<Class> getToolingExtensionsClasses() {
return Collections.emptySet();
}

@Nonnull
@Override
public List<Couple<String>> getExtraJvmArgs() {
return Collections.emptyList();
}

@Nonnull
@Override
public List<String> getExtraCommandLineArgs() {
return Collections.emptyList();
}

@Nonnull
@Override
public ExternalSystemException getUserFriendlyError(
@Nonnull Throwable error,
@Nonnull String projectPath,
@Nullable String buildFilePath
) {
return nextResolver.getUserFriendlyError(error, projectPath, buildFilePath);
}

@Override
public void enhanceRemoteProcessing(@Nonnull SimpleJavaParameters parameters) throws ExecutionException {
}

@Override
public void enhanceLocalProcessing(@Nonnull List<URL> urls) {
}

@Override
public void preImportCheck() {
}

@Override
public void enhanceTaskProcessing(
@Nonnull List<String> taskNames,
@Nullable String debuggerSetup,
@Nonnull Consumer<String> initScriptConsumer
) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import consulo.externalSystem.rt.model.ExternalSystemException;
import consulo.externalSystem.service.ParametersEnhancer;
import consulo.externalSystem.service.project.ProjectData;
import consulo.util.lang.Pair;
import consulo.util.lang.Couple;
import org.gradle.tooling.model.idea.IdeaModule;
import org.gradle.tooling.model.idea.IdeaProject;

Expand Down Expand Up @@ -111,7 +111,7 @@ Collection<TaskData> populateModuleTasks(@Nonnull IdeaModule gradleModule, @Nonn
Set<Class> getToolingExtensionsClasses();

@Nonnull
List<Pair<String, String>> getExtraJvmArgs();
List<Couple<String>> getExtraJvmArgs();

@Nonnull
List<String> getExtraCommandLineArgs();
Expand Down
Loading

0 comments on commit 7951ee6

Please sign in to comment.