Skip to content

Commit

Permalink
Rename package sbm to rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
fabapp2 committed Dec 13, 2023
1 parent 015feec commit 940e11c
Show file tree
Hide file tree
Showing 121 changed files with 373 additions and 359 deletions.
6 changes: 2 additions & 4 deletions spring-rewrite-commons-examples/boot-3-upgrade-atomic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>sbm-support-rewrite</artifactId>
<version>0.1.0-SNAPSHOT</version>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons-launcher</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.0.10</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,23 @@
*/
package com.acme.example;

import org.openrewrite.*;
import org.openrewrite.ExecutionContext;
import org.openrewrite.Recipe;
import org.openrewrite.SourceFile;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.event.EventListener;
import org.springframework.core.io.Resource;
import org.springframework.sbm.parsers.ProjectScanner;
import org.springframework.sbm.parsers.RewriteProjectParser;
import org.springframework.sbm.parsers.RewriteProjectParsingResult;
import org.springframework.sbm.parsers.events.StartedParsingResourceEvent;
import org.springframework.sbm.project.RewriteSourceFileWrapper;
import org.springframework.sbm.project.resource.*;
import org.springframework.sbm.recipes.RewriteRecipeDiscovery;
import org.springframework.rewrite.parsers.ProjectScanner;
import org.springframework.rewrite.parsers.RewriteProjectParser;
import org.springframework.rewrite.parsers.RewriteProjectParsingResult;
import org.springframework.rewrite.parsers.events.StartedParsingResourceEvent;
import org.springframework.rewrite.project.resource.ProjectResourceSet;
import org.springframework.rewrite.project.resource.ProjectResourceSetFactory;
import org.springframework.rewrite.project.resource.ProjectResourceSetSerializer;
import org.springframework.rewrite.recipes.RewriteRecipeDiscovery;

import java.nio.file.Path;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@

<parent>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons</artifactId>
<artifactId>spring-rewrite-commons-examples</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.example</groupId>
<artifactId>boot-3-upgrade-iterative</artifactId>
<version>0.0.1-SNAPSHOT</version>
Expand All @@ -24,8 +25,8 @@
</dependency>

<dependency>
<groupId>org.springframework.experimental</groupId>
<artifactId>sbm-support-rewrite</artifactId>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons-launcher</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@
import org.openrewrite.shaded.jgit.api.errors.GitAPIException;
import org.openrewrite.shaded.jgit.lib.Ref;
import org.openrewrite.shaded.jgit.revwalk.RevCommit;
import org.openrewrite.shaded.jgit.transport.*;
import org.openrewrite.shaded.jgit.transport.UsernamePasswordCredentialsProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.event.EventListener;
import org.springframework.core.io.Resource;
import org.springframework.sbm.parsers.ProjectScanner;
import org.springframework.sbm.parsers.RewriteProjectParser;
import org.springframework.sbm.parsers.RewriteProjectParsingResult;
import org.springframework.sbm.parsers.events.StartedParsingResourceEvent;
import org.springframework.sbm.project.resource.ProjectResourceSet;
import org.springframework.sbm.project.resource.ProjectResourceSetFactory;
import org.springframework.sbm.project.resource.ProjectResourceSetSerializer;
import org.springframework.sbm.recipes.RewriteRecipeDiscovery;
import org.springframework.rewrite.parsers.ProjectScanner;
import org.springframework.rewrite.parsers.RewriteProjectParser;
import org.springframework.rewrite.parsers.RewriteProjectParsingResult;
import org.springframework.rewrite.parsers.events.StartedParsingResourceEvent;
import org.springframework.rewrite.project.resource.ProjectResourceSet;
import org.springframework.rewrite.project.resource.ProjectResourceSetFactory;
import org.springframework.rewrite.project.resource.ProjectResourceSetSerializer;
import org.springframework.rewrite.recipes.RewriteRecipeDiscovery;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.FileSystemUtils;
Expand All @@ -57,7 +57,10 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
* @author Fabian Krüger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.io.Resource;
import org.springframework.sbm.parsers.ProjectScanner;
import org.springframework.sbm.parsers.RewriteProjectParser;
import org.springframework.sbm.parsers.RewriteProjectParsingResult;
import org.springframework.sbm.recipes.RewriteRecipeDiscovery;
import org.springframework.rewrite.parsers.ProjectScanner;
import org.springframework.rewrite.parsers.RewriteProjectParser;
import org.springframework.rewrite.parsers.RewriteProjectParsingResult;
import org.springframework.rewrite.recipes.RewriteRecipeDiscovery;

import java.nio.file.Path;
import java.util.Arrays;
Expand Down
70 changes: 50 additions & 20 deletions spring-rewrite-commons-examples/pom.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>spring-rewrite-commons-examples</artifactId>
<packaging>pom</packaging>
<artifactId>spring-rewrite-commons-examples</artifactId>
<packaging>pom</packaging>

<name>Spring Rewrite Commons Examples</name>
<description>Examples using Spring Rewrite Commons</description>
<name>Spring Rewrite Commons Examples</name>
<description>Examples using Spring Rewrite Commons</description>

<modules>
<module>boot-3-upgrade-atomic</module>
<module>boot-3-upgrade-iterative</module>
<module>list-applicable-recipes-example</module>
</modules>
<modules>
<module>boot-3-upgrade-atomic</module>
<module>boot-3-upgrade-iterative</module>
<module>list-applicable-recipes-example</module>
</modules>

<properties>
<java.version>17</java.version>
</properties>
<properties>
<java.version>17</java.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons-launcher</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
<version>5.0.10</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.rewrite</groupId>
<artifactId>spring-rewrite-commons-launcher</artifactId>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-spring</artifactId>
</dependency>
</dependencies>
</project>
1 change: 0 additions & 1 deletion spring-rewrite-commons-functional-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

<!-- prod dependencies -->
<spring-boot.version>3.1.3</spring-boot.version>
<!-- <rewrite.version>8.11.1</rewrite.version>-->
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
<jaxb-api.version>2.3.1</jaxb-api.version>
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.sbm.boot.autoconfigure.SbmSupportRewriteConfiguration;
import org.springframework.sbm.parsers.RewriteProjectParser;
import org.springframework.sbm.parsers.RewriteProjectParsingResult;
import org.springframework.sbm.parsers.maven.SbmTestConfiguration;
import org.springframework.rewrite.boot.autoconfigure.SbmSupportRewriteConfiguration;
import org.springframework.rewrite.parsers.RewriteProjectParser;
import org.springframework.rewrite.parsers.RewriteProjectParsingResult;
import org.springframework.rewrite.parsers.maven.SbmTestConfiguration;
import org.springframework.util.FileSystemUtils;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.junit.jupiter.Container;
Expand Down
16 changes: 8 additions & 8 deletions spring-rewrite-commons-launcher/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public MavenPomCache mavenPomCache() {

Example code showing how to apply OpenRewrite's UpgradeSpringBoot_3_1 recipe

[source, java]
[source,java]
.....
package com.example;
Expand All @@ -92,13 +92,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.sbm.parsers.ProjectScanner;
import org.springframework.sbm.parsers.RewriteProjectParser;
import org.springframework.sbm.parsers.RewriteProjectParsingResult;
import org.springframework.sbm.project.resource.ProjectResourceSet;
import org.springframework.sbm.project.resource.ProjectResourceSetFactory;
import org.springframework.sbm.project.resource.ProjectResourceSetSerializer;
import org.springframework.sbm.recipes.RewriteRecipeDiscovery;
import org.springframework.rewrite.parsers.ProjectScanner;
import org.springframework.rewrite.parsers.RewriteProjectParser;
import org.springframework.rewrite.parsers.RewriteProjectParsingResult;
import org.springframework.rewrite.project.resource.ProjectResourceSet;
import org.springframework.rewrite.project.resource.ProjectResourceSetFactory;
import org.springframework.rewrite.project.resource.ProjectResourceSetSerializer;
import org.springframework.rewrite.recipes.RewriteRecipeDiscovery;
import java.nio.file.Path;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.sbm.parsers.ParserProperties;
import org.springframework.sbm.parsers.RewriteParserConfiguration;
import org.springframework.sbm.recipes.RewriteRecipeDiscovery;
import org.springframework.rewrite.parsers.ParserProperties;
import org.springframework.rewrite.parsers.RewriteParserConfiguration;
import org.springframework.rewrite.recipes.RewriteRecipeDiscovery;

/**
* @author Fabian Krüger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.openrewrite.ExecutionContext;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.sbm.project.RewriteSourceFileWrapper;
import org.springframework.sbm.project.resource.ProjectResourceSerializer;
import org.springframework.sbm.project.resource.ProjectResourceSetFactory;
import org.springframework.sbm.project.resource.ProjectResourceSetSerializer;
import org.springframework.sbm.project.resource.RewriteMigrationResultMerger;
import org.springframework.rewrite.project.RewriteSourceFileWrapper;
import org.springframework.rewrite.project.resource.ProjectResourceSerializer;
import org.springframework.rewrite.project.resource.ProjectResourceSetFactory;
import org.springframework.rewrite.project.resource.ProjectResourceSetSerializer;
import org.springframework.rewrite.project.resource.RewriteMigrationResultMerger;

/**
* @author Fabian Krüger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Import;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.core.io.ResourceLoader;
import org.springframework.sbm.parsers.ParserProperties;
import org.springframework.sbm.parsers.ProjectScanner;
import org.springframework.sbm.parsers.RewriteParserConfiguration;
import org.springframework.rewrite.parsers.ParserProperties;
import org.springframework.rewrite.parsers.ProjectScanner;
import org.springframework.rewrite.parsers.RewriteParserConfiguration;

/**
* @author Fabian Krüger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.boot.autoconfigure;
package org.springframework.rewrite.boot.autoconfigure;

import org.openrewrite.ExecutionContext;
import org.openrewrite.InMemoryExecutionContext;
Expand All @@ -22,9 +22,9 @@
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.sbm.scopes.ExecutionScope;
import org.springframework.sbm.scopes.ProjectMetadata;
import org.springframework.sbm.scopes.ScanScope;
import org.springframework.rewrite.scopes.ExecutionScope;
import org.springframework.rewrite.scopes.ProjectMetadata;
import org.springframework.rewrite.scopes.ScanScope;

import java.util.function.Supplier;

Expand Down Expand Up @@ -57,7 +57,7 @@ public static BeanFactoryPostProcessor beanFactoryPostProcessor(ExecutionScope e
}

@Bean
@org.springframework.sbm.scopes.annotations.ScanScope
@org.springframework.rewrite.scopes.annotations.ScanScope
ProjectMetadata projectMetadata() {
return new ProjectMetadata();
}
Expand All @@ -71,7 +71,7 @@ Supplier<ExecutionContext> executionContextSupplier() {
}

@Bean
@org.springframework.sbm.scopes.annotations.ScanScope
@org.springframework.rewrite.scopes.annotations.ScanScope
ExecutionContext executionContext(ProjectMetadata projectMetadata,
Supplier<ExecutionContext> executionContextSupplier, MavenPomCache mavenPomCache) {
ExecutionContext executionContext = executionContextSupplier.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.parsers;
package org.springframework.rewrite.parsers;

import lombok.Getter;
import lombok.Setter;
Expand Down
Loading

0 comments on commit 940e11c

Please sign in to comment.