Skip to content

Commit 35d0b30

Browse files
committed
Merge branch 'develop' into update-from-template-merged
2 parents ef37ca8 + a731551 commit 35d0b30

File tree

73 files changed

+3479
-23
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3479
-23
lines changed

.config/checkstyle/checkstyle.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<property name="tabWidth" value="4"/>
1010

1111
<module name="SuppressionFilter">
12-
<property name="file" value=".config/checkstyle/suppressions.xml"/>
12+
<property name="file" value="${config_loc}/suppressions.xml"/>
1313
</module>
1414

1515
<module name="FileLength"/>

.config/checkstyle/suppressions.xml

+5
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,9 @@
33
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
44
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
55
<suppressions>
6+
<suppress files="[\\/]src[\\/]test[\\/]resources[\\/].*\.java$" checks=".*"/>
7+
<suppress
8+
files="[\\/]src[\\/]main[\\/]java[\\/]software[\\/]xdev[\\/]saveactions[\\/].*CustomAccessCanBeTightenedInspection\.java$"
9+
checks=".*"/>
10+
<suppress files="[\\/]src[\\/]test[\\/]java[\\/].*\.java$" checks="MethodName"/>
611
</suppressions>

.github/ISSUE_TEMPLATE/bug_report.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ body:
1515
attributes:
1616
label: "Checklist"
1717
options:
18-
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
18+
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/intellij-plugin-openrewriter/releases/latest)"
1919
required: true
20-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
20+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/intellij-plugin-openrewriter/issues) or [closed](https://github.com/xdev-software/intellij-plugin-openrewriter/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
2121
required: true
2222
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
2323
required: true

.github/ISSUE_TEMPLATE/enhancement.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ body:
1313
attributes:
1414
label: "Checklist"
1515
options:
16-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
16+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/intellij-plugin-openrewriter/issues) or [closed](https://github.com/xdev-software/intellij-plugin-openrewriter/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1717
required: true
1818
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
1919
required: true

.github/ISSUE_TEMPLATE/question.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ body:
1212
attributes:
1313
label: "Checklist"
1414
options:
15-
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/template-placeholder/issues) or [closed](https://github.com/xdev-software/template-placeholder/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
15+
- label: "I made sure that there are *no existing issues* - [open](https://github.com/xdev-software/intellij-plugin-openrewriter/issues) or [closed](https://github.com/xdev-software/intellij-plugin-openrewriter/issues?q=is%3Aissue+is%3Aclosed) - which I could contribute my information to."
1616
required: true
1717
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
1818
required: true

.github/workflows/check-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
uses: actions/upload-artifact@v4
7272
with:
7373
name: plugin-files-java-${{ matrix.java }}
74-
path: build/libs/template-placeholder-*.jar
74+
path: build/libs/intellij-plugin-openrewriter-*.jar
7575
if-no-files-found: error
7676

7777
checkstyle:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
9393
9494
## Installation
95-
The plugin is listed on the [Marketplace](https://plugins.jetbrains.com/plugin/pluginId).
95+
The plugin is listed on the [Marketplace](https://plugins.jetbrains.com/plugin/23896).
9696
9797
Open the plugin Marketplace in your IDE (``File > Settings > Plugins > Marketplace``), search for the plugin and hit the install button.
9898

.idea/saveactions_settings.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 1.0.3
2+
* Drop support for IntelliJ < 2024.3
3+
* This is required to fix deprecations
4+
5+
# 1.0.2
6+
* Drop support for IntelliJ < 2024.2
7+
* Removed deprecated code that was only required for older IDE versions
8+
9+
# 1.0.1
10+
* Workaround scaling problem on "New UI" #19
11+
* Drop support for IntelliJ < 2023.2
12+
13+
# 1.0.0
14+
_Initial release_
15+
* Execute recipes
16+
* with
17+
* Maven
18+
* Gradle
19+
* on a
20+
* (project) module
21+
* external directory
22+
* Supports IntelliJ 2023.1+

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ Start idea and import the `build.gradle` file with "File > Open". Then in the "I
4646
./gradlew cleanIdea idea
4747
```
4848

49-
IntelliJ should refresh and the project is now configured as a gradle project. You can find IntelliJ gradle tasks in "Gradle > Gradle projects > template-placeholder > Tasks > intellij". To run the plugin, use the `runIde` task:
49+
IntelliJ should refresh and the project is now configured as a gradle project. You can find IntelliJ gradle tasks in "Gradle > Gradle projects > intellij-plugin-openrewriter > Tasks > intellij". To run the plugin, use the `runIde` task:
5050

5151
```bash
5252
# Run the plugin (starts new idea)
5353
./gradlew runIde
5454
```
5555

56-
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/release.yml?branch=master)](https://github.com/xdev-software/template-placeholder/actions/workflows/release.yml)
56+
## Releasing [![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/intellij-plugin-openrewriter/release.yml?branch=master)](https://github.com/xdev-software/intellij-plugin-openrewriter/actions/workflows/release.yml)
5757

5858
Before releasing:
59-
* Consider doing a [test-deployment](https://github.com/xdev-software/template-placeholder/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
59+
* Consider doing a [test-deployment](https://github.com/xdev-software/intellij-plugin-openrewriter/actions/workflows/test-deploy.yml?query=branch%3Adevelop) before actually releasing.
6060
* Check the [changelog](CHANGELOG.md)
6161

6262
If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes

README.md

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,38 @@
1-
[![Latest version](https://img.shields.io/jetbrains/plugin/v/pluginId?logo=jetbrains)](https://plugins.jetbrains.com/plugin/pluginId)
2-
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/template-placeholder/check-build.yml?branch=develop)](https://github.com/xdev-software/template-placeholder/actions/workflows/check-build.yml?query=branch%3Adevelop)
3-
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_template-placeholder&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_template-placeholder)
4-
[![Feel free to leave a rating](https://img.shields.io/jetbrains/plugin/r/rating/pluginId?style=social&logo=jetbrains&label=Feel%20free%20to%20leave%20a%20rating)](https://plugins.jetbrains.com/plugin/pluginId/reviews)
1+
[![Latest version](https://img.shields.io/jetbrains/plugin/v/23896?logo=jetbrains)](https://plugins.jetbrains.com/plugin/23896)
2+
[![Build](https://img.shields.io/github/actions/workflow/status/xdev-software/intellij-plugin-openrewriter/check-build.yml?branch=develop)](https://github.com/xdev-software/intellij-plugin-openrewriter/actions/workflows/check-build.yml?query=branch%3Adevelop)
3+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xdev-software_intellij-plugin-openrewriter&metric=alert_status)](https://sonarcloud.io/dashboard?id=xdev-software_intellij-plugin-openrewriter)
4+
[![Feel free to leave a rating](https://img.shields.io/jetbrains/plugin/r/rating/23896?style=social&logo=jetbrains&label=Feel%20free%20to%20leave%20a%20rating)](https://plugins.jetbrains.com/plugin/23896/reviews)
55

6-
# <img alt="Plugin icon" src="./src/main/resources/META-INF/pluginIcon.svg" height="30"> template-placeholder
6+
# <img alt="OpenRewriter Plugin icon light" src="./src/main/resources/META-INF/pluginIcon.svg" height="30"> OpenRewriter X
77

8+
Provides support for executing [OpenRewrite](https://github.com/openrewrite) recipes.
89

10+
<img alt="Demo" src="assets/demo.png" height="500" />
11+
12+
## Features
13+
14+
* Execute recipes
15+
* with
16+
* Maven
17+
* Gradle
18+
* on a
19+
* (project) module
20+
* external directory
21+
22+
<details>
23+
<summary>Show demo</summary>
24+
25+
![demo](assets/demo.avif)
26+
</details>
927

1028
## Installation
11-
[Installation guide for the latest release](https://github.com/xdev-software/template-placeholder/releases/latest#Installation)
29+
[Installation guide for the latest release](https://github.com/xdev-software/intellij-plugin-openrewriter/releases/latest#Installation)
1230

1331
> [!TIP]
14-
> [Development versions](https://plugins.jetbrains.com/plugin/pluginId/versions/snapshot) can be installed by [adding the ``snapshot`` release channel as a plugin repository](https://www.jetbrains.com/help/idea/managing-plugins.html#repos):<br/>
32+
> [Development versions](https://plugins.jetbrains.com/plugin/23896/versions/snapshot) can be installed by [adding the ``snapshot`` release channel as a plugin repository](https://www.jetbrains.com/help/idea/managing-plugins.html#repos):<br/>
1533
> ``https://plugins.jetbrains.com/plugins/snapshot/list``
1634
1735
## Contributing
1836
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.
37+
38+
<sub>Disclaimer: This is not an official OpenRewrite product and not associated with OpenRewrite</sub>

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
## Reporting a Vulnerability
44

5-
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
5+
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/intellij-plugin-openrewriter/security/advisories/new).

assets/demo.avif

937 KB
Binary file not shown.

assets/demo.png

21 KB
Loading

gradle.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
2-
pluginGroup=
3-
pluginName=
2+
pluginGroup=software.xdev.openrewriter
3+
pluginName=OpenRewriter X
44
# SemVer format -> https://semver.org
5-
pluginVersion=
5+
pluginVersion=1.0.4-SNAPSHOT
66
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
77
platformType=IC
88
platformVersion=2024.3.5
99
platformSinceBuild=243
1010
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1111
# Example: platformBundledPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
12-
platformBundledPlugins=
12+
platformBundledPlugins=org.jetbrains.idea.maven,org.jetbrains.plugins.gradle
1313
platformPlugins=
1414
# Gradle Releases -> https://github.com/gradle/gradle/releases
1515
gradleVersion=8.13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package software.xdev.openrewriter.executor;
2+
3+
import javax.swing.Icon;
4+
5+
import org.jetbrains.annotations.Nullable;
6+
7+
import com.intellij.openapi.project.Project;
8+
9+
import software.xdev.openrewriter.ui.toolwindow.execute.panels.ExecuteRecipeConfigPanel;
10+
11+
12+
public interface PresentableProvider<T> extends Provider
13+
{
14+
Icon icon();
15+
16+
T createDefault(Project project);
17+
18+
Class<T> matchingClass();
19+
20+
@Nullable
21+
ExecuteRecipeConfigPanel<? extends T> createConfigPanel(final Project project);
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package software.xdev.openrewriter.executor;
2+
3+
public interface Provider
4+
{
5+
String name();
6+
7+
default int orderPriority()
8+
{
9+
return 10;
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package software.xdev.openrewriter.executor;
2+
3+
import com.intellij.openapi.module.Module;
4+
import com.intellij.openapi.project.Project;
5+
6+
import software.xdev.openrewriter.executor.request.ExecutionRequest;
7+
8+
9+
public interface RecipesExecutor<T extends RecipesExecutorConfig> extends PresentableProvider<T>
10+
{
11+
default boolean isAsync()
12+
{
13+
return true;
14+
}
15+
16+
boolean isMatchingModule(Project project, Module module);
17+
18+
@SuppressWarnings("unchecked")
19+
default void execute(final Project project, final ExecutionRequest request)
20+
{
21+
this.execute(project, request, (T)request.getExecutorConfig());
22+
}
23+
24+
void execute(Project project, ExecutionRequest request, T config);
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package software.xdev.openrewriter.executor;
2+
3+
public interface RecipesExecutorConfig
4+
{
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package software.xdev.openrewriter.executor;
2+
3+
import java.util.Collection;
4+
import java.util.Comparator;
5+
import java.util.List;
6+
7+
import com.intellij.openapi.extensions.ExtensionPointName;
8+
9+
import software.xdev.openrewriter.executor.request.recipedata.RecipesDataProvider;
10+
import software.xdev.openrewriter.executor.request.target.ExecutionTargetProvider;
11+
12+
13+
public final class RecipesExecutorEPManager
14+
{
15+
private static final ExtensionPointName<RecipesExecutor<?>> EP_RECIPES_EXECUTORS =
16+
ExtensionPointName.create("software.xdev.openrewriter.recipesExecutor");
17+
18+
private static final ExtensionPointName<ExecutionTargetProvider<?>> EP_EXECUTION_REQUEST_TARGET_PROVIDERS =
19+
ExtensionPointName.create("software.xdev.openrewriter.executionRequestTargetProvider");
20+
21+
private static final ExtensionPointName<RecipesDataProvider<?>> EP_RECIPES_DATA_PROVIDERS =
22+
ExtensionPointName.create("software.xdev.openrewriter.recipesDataProvider");
23+
24+
public static List<RecipesExecutor<?>> recipesExecutors()
25+
{
26+
return order(EP_RECIPES_EXECUTORS.getExtensionList());
27+
}
28+
29+
public static List<ExecutionTargetProvider<?>> executionRequestTargetProviders()
30+
{
31+
return order(EP_EXECUTION_REQUEST_TARGET_PROVIDERS.getExtensionList());
32+
}
33+
34+
@SuppressWarnings("java:S1452")
35+
public static List<RecipesDataProvider<?>> recipesDataProviders()
36+
{
37+
return order(EP_RECIPES_DATA_PROVIDERS.getExtensionList());
38+
}
39+
40+
private static <T extends Provider> List<T> order(final Collection<T> input)
41+
{
42+
return input.stream()
43+
.sorted(Comparator.comparing(Provider::orderPriority))
44+
.toList();
45+
}
46+
47+
private RecipesExecutorEPManager()
48+
{
49+
}
50+
}

0 commit comments

Comments
 (0)