-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #446 from jonesbusy/feature/optimize-jar-2
Add our recipe model and remove OpenRewrite from CLI dependency
- Loading branch information
Showing
25 changed files
with
196 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...er-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/converter/RecipeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...r-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/extractor/MetadataXmlTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package io.jenkins.tools.pluginmodernizer.core.extractor; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
/** | ||
* To transport information form an OpenRewrite XML tag back to plugin modernizer | ||
* This avoid create a dependency between OpenRewrite internals and Plugin Modernizer | ||
*/ | ||
public final class MetadataXmlTag { | ||
|
||
private String name; | ||
private Optional<String> value; | ||
private List<MetadataXmlTag> children = List.of(); | ||
|
||
public MetadataXmlTag() {} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Optional<String> getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(Optional<String> value) { | ||
this.value = value; | ||
} | ||
|
||
public List<MetadataXmlTag> getChildren() { | ||
return children; | ||
} | ||
|
||
public void setChildren(List<MetadataXmlTag> children) { | ||
this.children = children; | ||
} | ||
|
||
public Optional<MetadataXmlTag> getChild(String name) { | ||
return children.stream().filter(c -> c.getName().equals(name)).findFirst(); | ||
} | ||
|
||
public Optional<String> getChildValue(String name) { | ||
return getChild(name).flatMap(MetadataXmlTag::getValue); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...in-modernizer-core/src/main/java/io/jenkins/tools/pluginmodernizer/core/model/Recipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package io.jenkins.tools.pluginmodernizer.core.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import java.util.Set; | ||
|
||
public class Recipe { | ||
|
||
private String name; | ||
private String displayName; | ||
private String description; | ||
private Set<String> tags; | ||
|
||
@JsonIgnore | ||
private Object type; | ||
|
||
@JsonIgnore | ||
private Object recipeList; // Use Object to avoid mapping complex nested structures. | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
|
||
public void setDescription(String description) { | ||
this.description = description; | ||
} | ||
|
||
public Set<String> getTags() { | ||
return tags; | ||
} | ||
|
||
public void setTags(Set<String> tags) { | ||
this.tags = tags; | ||
} | ||
|
||
public Object getType() { | ||
return type; | ||
} | ||
|
||
public void setType(Object type) { | ||
this.type = type; | ||
} | ||
|
||
public Object getRecipeList() { | ||
return recipeList; | ||
} | ||
|
||
public void setRecipeList(Object recipeList) { | ||
this.recipeList = recipeList; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugin-modernizer-core/src/main/jte/pr-title-UpgradeBomVersion.jte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin | ||
@import org.openrewrite.Recipe | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe | ||
@param Plugin plugin | ||
@param Recipe recipe | ||
Bump bom to ${plugin.getMetadata().getBomVersion()} |
2 changes: 1 addition & 1 deletion
2
plugin-modernizer-core/src/main/jte/pr-title-UpgradeNextMajorParentVersion.jte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin | ||
@import org.openrewrite.Recipe | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe | ||
@param Plugin plugin | ||
@param Recipe recipe | ||
Require ${plugin.getMetadata().getJenkinsVersion()} and Java 17 |
2 changes: 1 addition & 1 deletion
2
plugin-modernizer-core/src/main/jte/pr-title-UpgradeParentVersion.jte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin | ||
@import org.openrewrite.Recipe | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe | ||
@param Plugin plugin | ||
@param Recipe recipe | ||
Bump parent pom to ${plugin.getMetadata().getParentVersion()} |
2 changes: 1 addition & 1 deletion
2
plugin-modernizer-core/src/main/jte/pr-title-UpgradeToLatestJava11CoreVersion.jte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin | ||
@import org.openrewrite.Recipe | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe | ||
@param Plugin plugin | ||
@param Recipe recipe | ||
Require ${plugin.getMetadata().getJenkinsVersion()} |
2 changes: 1 addition & 1 deletion
2
plugin-modernizer-core/src/main/jte/pr-title-UpgradeToRecommendCoreVersion.jte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Plugin | ||
@import org.openrewrite.Recipe | ||
@import io.jenkins.tools.pluginmodernizer.core.model.Recipe | ||
@param Plugin plugin | ||
@param Recipe recipe | ||
Require ${plugin.getMetadata().getJenkinsVersion()} |
Oops, something went wrong.