Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Link and --no-configuration-cache to spotlessApply Executino #19

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ from within the IDE on the current file selected in the editor.
You may find the spotless action via <kbd>Code</kbd> > <kbd>Reformat Code with Spotless</kbd>.

![spotlessdemo](https://user-images.githubusercontent.com/15261525/147841908-d5cc3bda-56c8-4cbd-ba29-13ebe29f6a1d.gif)

Report bugs or contribute enhancements on GitHub [(ragurney/spotless-intellij-gradle)](https://github.com/ragurney/spotless-intellij-gradle)
<!-- Plugin description end -->

## Features
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pluginGroup = com.github.ragurney.spotless
pluginName = Spotless Gradle
# SemVer format -> https://semver.org
pluginVersion = 1.0.2
pluginVersion = 1.0.3

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ private void reformatFilePreservingScrollPosition(PsiFile fileToProcess, Documen
ExternalSystemTaskExecutionSettings settings = constructTaskExecutionSettings(fileToProcess);

// Execute gradle task
ExternalSystemUtil.runTask(settings, DefaultRunExecutor.EXECUTOR_ID, myProject, GradleConstants.SYSTEM_ID,
null, ProgressExecutionMode.IN_BACKGROUND_ASYNC, false);
ExternalSystemUtil.runTask(settings, DefaultRunExecutor.EXECUTOR_ID, myProject, GradleConstants.SYSTEM_ID, null,
ProgressExecutionMode.IN_BACKGROUND_ASYNC, false);
}));
}

Expand All @@ -95,7 +95,8 @@ private ExternalSystemTaskExecutionSettings constructTaskExecutionSettings(PsiFi
ExternalSystemTaskExecutionSettings settings = new ExternalSystemTaskExecutionSettings();
settings.setExternalProjectPath(myProject.getBasePath());
settings.setTaskNames(List.of("spotlessApply"));
settings.setScriptParameters(String.format("-PspotlessIdeHook=\"%s\"", fileToProcess.getVirtualFile().getPath()));
settings.setScriptParameters(
String.format("-PspotlessIdeHook=\"%s\" --no-configuration-cache", fileToProcess.getVirtualFile().getPath()));
settings.setVmOptions("");
settings.setExternalSystemIdString(GradleConstants.SYSTEM_ID.getId());
return settings;
Expand Down