Skip to content

Commit

Permalink
Merge branch 'develop' into update-from-template-merged
Browse files Browse the repository at this point in the history
  • Loading branch information
xdev-gh-bot committed Sep 30, 2024
2 parents 72ffbf2 + 716d4d3 commit 005215b
Show file tree
Hide file tree
Showing 73 changed files with 3,475 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<property name="tabWidth" value="4"/>

<module name="SuppressionFilter">
<property name="file" value=".config/checkstyle/suppressions.xml"/>
<property name="file" value="${config_loc}/suppressions.xml"/>
</module>

<module name="FileLength"/>
Expand Down
5 changes: 5 additions & 0 deletions .config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
<suppressions>
<suppress files="[\\/]src[\\/]test[\\/]resources[\\/].*\.java$" checks=".*"/>
<suppress
files="[\\/]src[\\/]main[\\/]java[\\/]software[\\/]xdev[\\/]saveactions[\\/].*CustomAccessCanBeTightenedInspection\.java$"
checks=".*"/>
<suppress files="[\\/]src[\\/]test[\\/]java[\\/].*\.java$" checks="MethodName"/>
</suppressions>
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ body:
attributes:
label: "Checklist"
options:
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/template-placeholder/releases/latest)"
- label: "I am able to reproduce the bug with the [latest version](https://github.com/xdev-software/intellij-plugin-openrewriter/releases/latest)"
required: true
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the feature request will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
attributes:
label: "Checklist"
options:
- 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."
- 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."
required: true
- label: "I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise."
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: plugin-files-java-${{ matrix.java }}
path: build/libs/template-placeholder-*.jar
path: build/libs/intellij-plugin-openrewriter-*.jar
if-no-files-found: error

checkstyle:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
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.
## Installation
The plugin is listed on the [Marketplace](https://plugins.jetbrains.com/plugin/pluginId).
The plugin is listed on the [Marketplace](https://plugins.jetbrains.com/plugin/23896).
Open the plugin Marketplace in your IDE (``File > Settings > Plugins > Marketplace``), search for the plugin and hit the install button.
Expand Down
2 changes: 1 addition & 1 deletion .idea/saveactions_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 1.0.2
* Drop support for IntelliJ < 2024.2
* Removed deprecated code that was only required for older IDE versions

# 1.0.1
* Workaround scaling problem on "New UI" #19
* Drop support for IntelliJ < 2023.2

# 1.0.0
_Initial release_
* Execute recipes
* with
* Maven
* Gradle
* on a
* (project) module
* external directory
* Supports IntelliJ 2023.1+
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ Start idea and import the `build.gradle` file with "File > Open". Then in the "I
./gradlew cleanIdea idea
```

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:
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:

```bash
# Run the plugin (starts new idea)
./gradlew runIde
```

## 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)
## 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)

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

If the ``develop`` is ready for release, create a pull request to the ``master``-Branch and merge the changes
Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
[![Latest version](https://img.shields.io/jetbrains/plugin/v/pluginId?logo=jetbrains)](https://plugins.jetbrains.com/plugin/pluginId)
[![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)
[![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)
[![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)
[![Latest version](https://img.shields.io/jetbrains/plugin/v/23896?logo=jetbrains)](https://plugins.jetbrains.com/plugin/23896)
[![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)
[![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)
[![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)

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

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

<img alt="Demo" src="assets/demo.png" height="500" />

## Features

* Execute recipes
* with
* Maven
* Gradle
* on a
* (project) module
* external directory

<details>
<summary>Show demo</summary>

![demo](assets/demo.avif)
</details>

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

> [!TIP]
> [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/>
> [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/>
> ``https://plugins.jetbrains.com/plugins/snapshot/list``
## Contributing
See the [contributing guide](./CONTRIBUTING.md) for detailed instructions on how to get started with our project.

<sub>Disclaimer: This is not an official OpenRewrite product and not associated with OpenRewrite</sub>
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## Reporting a Vulnerability

Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/template-placeholder/security/advisories/new).
Please report a security vulnerability [on GitHub Security Advisories](https://github.com/xdev-software/intellij-plugin-openrewriter/security/advisories/new).
Binary file added assets/demo.avif
Binary file not shown.
Binary file added assets/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html
pluginGroup=
pluginName=
pluginGroup=software.xdev.openrewriter
pluginName=OpenRewriter X
# SemVer format -> https://semver.org
pluginVersion=
pluginVersion=1.0.3-SNAPSHOT
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType=IC
platformVersion=2024.2.3
platformSinceBuild=242
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
# Example: platformBundledPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
platformBundledPlugins=
platformBundledPlugins=org.jetbrains.idea.maven,org.jetbrains.plugins.gradle
platformPlugins=
# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion=8.10.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package software.xdev.openrewriter.executor;

import javax.swing.Icon;

import org.jetbrains.annotations.Nullable;

import com.intellij.openapi.project.Project;

import software.xdev.openrewriter.ui.toolwindow.execute.panels.ExecuteRecipeConfigPanel;


public interface PresentableProvider<T> extends Provider
{
Icon icon();

T createDefault(Project project);

Class<T> matchingClass();

@Nullable
ExecuteRecipeConfigPanel<? extends T> createConfigPanel(final Project project);
}
11 changes: 11 additions & 0 deletions src/main/java/software/xdev/openrewriter/executor/Provider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package software.xdev.openrewriter.executor;

public interface Provider
{
String name();

default int orderPriority()
{
return 10;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package software.xdev.openrewriter.executor;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;

import software.xdev.openrewriter.executor.request.ExecutionRequest;


public interface RecipesExecutor<T extends RecipesExecutorConfig> extends PresentableProvider<T>
{
default boolean isAsync()
{
return true;
}

boolean isMatchingModule(Project project, Module module);

@SuppressWarnings("unchecked")
default void execute(final Project project, final ExecutionRequest request)
{
this.execute(project, request, (T)request.getExecutorConfig());
}

void execute(Project project, ExecutionRequest request, T config);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package software.xdev.openrewriter.executor;

public interface RecipesExecutorConfig
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package software.xdev.openrewriter.executor;

import java.util.Collection;
import java.util.Comparator;
import java.util.List;

import com.intellij.openapi.extensions.ExtensionPointName;

import software.xdev.openrewriter.executor.request.recipedata.RecipesDataProvider;
import software.xdev.openrewriter.executor.request.target.ExecutionTargetProvider;


public final class RecipesExecutorEPManager
{
private static final ExtensionPointName<RecipesExecutor<?>> EP_RECIPES_EXECUTORS =
ExtensionPointName.create("software.xdev.openrewriter.recipesExecutor");

private static final ExtensionPointName<ExecutionTargetProvider<?>> EP_EXECUTION_REQUEST_TARGET_PROVIDERS =
ExtensionPointName.create("software.xdev.openrewriter.executionRequestTargetProvider");

private static final ExtensionPointName<RecipesDataProvider<?>> EP_RECIPES_DATA_PROVIDERS =
ExtensionPointName.create("software.xdev.openrewriter.recipesDataProvider");

public static List<RecipesExecutor<?>> recipesExecutors()
{
return order(EP_RECIPES_EXECUTORS.getExtensionList());
}

public static List<ExecutionTargetProvider<?>> executionRequestTargetProviders()
{
return order(EP_EXECUTION_REQUEST_TARGET_PROVIDERS.getExtensionList());
}

@SuppressWarnings("java:S1452")
public static List<RecipesDataProvider<?>> recipesDataProviders()
{
return order(EP_RECIPES_DATA_PROVIDERS.getExtensionList());
}

private static <T extends Provider> List<T> order(final Collection<T> input)
{
return input.stream()
.sorted(Comparator.comparing(Provider::orderPriority))
.toList();
}

private RecipesExecutorEPManager()
{
}
}
Loading

0 comments on commit 005215b

Please sign in to comment.