Skip to content

SBM works with windows #91

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

Merged
merged 51 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c9170ec
Fix paths to use os path separator
fabapp2 Mar 29, 2022
0b3fbfd
Fix tests in `core` module when building with Windows
fabapp2 Mar 30, 2022
fb480a8
wip
fabapp2 Mar 30, 2022
27035eb
wip
fabapp2 Apr 5, 2022
53abfe6
Removed reflection
fabapp2 Apr 6, 2022
91637e5
Replaced deprecated calls and useless throws
fabapp2 Apr 6, 2022
248deeb
Remove duplicate dependency
fabapp2 Apr 6, 2022
98c679f
Fix test
fabapp2 Apr 6, 2022
592acc2
Remove emojis in banner.txt as these are not properly displayed on Wi…
fabapp2 Apr 6, 2022
991294a
Add license header
fabapp2 Apr 6, 2022
6aec67e
Add contributing section to developer docs
fabapp2 Apr 6, 2022
c997743
Replaced Spring's AntPathMatcher with OsAgnosticPathMatcher
fabapp2 Apr 6, 2022
c56d9b0
Remove bug
fabapp2 Apr 6, 2022
20530cd
Add note in README for Windows users
fabapp2 Apr 6, 2022
f990d29
Fix check for Windows
fabapp2 Apr 6, 2022
85edfe6
Fix copyright header
fabapp2 Apr 6, 2022
fbddf01
Remove old logging classes
fabapp2 Apr 6, 2022
b65f9cd
Fix exclude patterns, adds documentation
fabapp2 Apr 6, 2022
cc87884
Fix copyright header
fabapp2 Apr 6, 2022
b3b6047
Fix copyright header
fabapp2 Apr 6, 2022
7b07476
Fix copyright header
fabapp2 Apr 7, 2022
2fe6f2b
wip
fabapp2 Apr 7, 2022
f61fde9
Ignore problematic dependencies
fabapp2 Apr 8, 2022
38ea5d0
Extracted class to unify Windows and Linux path to be reused
fabapp2 Apr 8, 2022
5567fe4
Add documentation regarding testing for all OS
fabapp2 Apr 14, 2022
e68f200
Fix copyright
fabapp2 Apr 19, 2022
3773e7b
Fix copyright
fabapp2 Apr 19, 2022
87adb17
Bump lombok from 1.18.20 to 1.18.22 (#44)
dependabot[bot] Mar 29, 2022
9cf0537
closes #62 Unmarshal EJB 2.1 ejb-jar.xml deployment descriptor (#64)
fabapp2 Mar 29, 2022
7db7b2a
Bump jackson.version from 2.12.2 to 2.13.2 (#43)
dependabot[bot] Mar 30, 2022
ae24ac0
Bump jackson-databind from 2.12.2 to 2.12.6.1 (#59)
dependabot[bot] Mar 30, 2022
1714647
Set ignored dependencies for dependabot
fabapp2 Mar 30, 2022
23ef502
Bump build-helper-maven-plugin from 3.2.0 to 3.3.0 (#65)
dependabot[bot] Mar 30, 2022
7021a74
Bump maven-jar-plugin from 2.2 to 3.2.2 (#67)
dependabot[bot] Mar 30, 2022
73ca0f7
Windows support (#79)
sanagaraj-pivotal Mar 31, 2022
0eccfa9
closes #80 prepare demo for mule to boot migration (#81)
fabapp2 Apr 4, 2022
5c26a09
We support only dwl set payload transformations, any other transforma…
sanagaraj-pivotal Apr 5, 2022
7d3fbed
Add mule db schema and generated JAXB model (#87)
sanagaraj-pivotal Apr 5, 2022
7bad0b4
Fixes error when DWL file contains dashes as part of file names (#93)
sanagaraj-pivotal Apr 11, 2022
3fc31d1
Add support for Http outbound component (#95)
sanagaraj-pivotal Apr 14, 2022
d4f1743
Fix tests in `core` module when building with Windows
fabapp2 Mar 30, 2022
d4ddcb1
Organize imports
fabapp2 Apr 19, 2022
a88f2eb
Remove exclude of JUnit 4 to make testcontainers work again
fabapp2 Apr 19, 2022
2eb6c04
Merge branch 'main' into 58-verify-sbm-works-with-windows
fabapp2 Apr 19, 2022
dac0d63
Merge branch 'main' into 58-verify-sbm-works-with-windows
fabapp2 Apr 19, 2022
382effd
Merge branch 'main' into 58-verify-sbm-works-with-windows
fabapp2 Apr 19, 2022
df1deac
fix changelog
fabapp2 Apr 19, 2022
c254437
Fix test
fabapp2 Apr 19, 2022
f90cc85
cleanup
fabapp2 Apr 19, 2022
ffc7bb6
Fix build and run on Windows
fabapp2 Apr 19, 2022
8f1471a
Exclude JUnit 4
fabapp2 Apr 11, 2022
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
4 changes: 3 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ e.g.: `apply initialize-spring-boot-migration` +
Spring Boot Migrator will now apply the migrations defined in the recipe to the codebase.
* To get help when using SBM use the `help` command

WARNING: **The OpenRewrite `rewrite-java-11` module uses JDK internals and thus requires the project to run with JDK 11.**
NOTE: When using Windows you must either escape `\` or use `/` as path separator, e.g. `C:\\my\\app` or `C:/my/app`

NOTE: **The OpenRewrite `rewrite-java-11` module uses JDK internals and thus requires the project to run with JDK 11.**


=== Building from source
Expand Down
10 changes: 0 additions & 10 deletions applications/spring-shell/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@
<artifactId>sbm-recipes-spring-cloud</artifactId>
<version>0.10.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,45 +35,47 @@
@RequiredArgsConstructor
public class ScanShellCommand {

private final ScanCommand scanCommand;
private final ScanCommand scanCommand;

private final ApplicableRecipeListRenderer applicableRecipeListRenderer;
private final ApplicableRecipeListRenderer applicableRecipeListRenderer;

private final ApplicableRecipeListCommand applicableRecipeListCommand;
private final ApplicableRecipeListCommand applicableRecipeListCommand;

private final ProjectContextHolder contextHolder;
private final ProjectContextHolder contextHolder;
private final PreconditionVerificationRenderer preconditionVerificationRenderer;
private final ScanCommandHeaderRenderer scanCommandHeaderRenderer;
private final ConsolePrinter consolePrinter;
private final ScanCommandHeaderRenderer scanCommandHeaderRenderer;
private final ConsolePrinter consolePrinter;

@ShellMethod(key = { "scan", "s" },
value = "Scans the target project directory and get the list of applicable recipes.")
public AttributedString scan(@ShellOption(defaultValue = ".",
help = "The root directory of the target application.") String projectRoot) {
@ShellMethod(key = {"scan", "s"},
value = "Scans the target project directory and get the list of applicable recipes.")
public String scan(
@ShellOption(defaultValue = ".", help = "The root directory of the target application.")
//@Pattern(regexp = "")
String projectRoot) {


List<Resource> resources = scanCommand.scanProjectRoot(projectRoot);
String scanCommandHeader = scanCommandHeaderRenderer.renderHeader(projectRoot);
PreconditionVerificationResult result = scanCommand.checkPreconditions(projectRoot, resources);
String renderedPreconditionCheckResults = preconditionVerificationRenderer.renderPreconditionCheckResults(result);
AttributedStringBuilder stringBuilder = new AttributedStringBuilder();
String output = stringBuilder
.append(scanCommandHeader)
.append(renderedPreconditionCheckResults)
.toAnsi();
List<Resource> resources = scanCommand.scanProjectRoot(projectRoot);
String scanCommandHeader = scanCommandHeaderRenderer.renderHeader(projectRoot);
PreconditionVerificationResult result = scanCommand.checkPreconditions(projectRoot, resources);
String renderedPreconditionCheckResults = preconditionVerificationRenderer.renderPreconditionCheckResults(result);
AttributedStringBuilder stringBuilder = new AttributedStringBuilder();
String output = stringBuilder
.append(scanCommandHeader)
.ansiAppend(renderedPreconditionCheckResults)
.toAttributedString().toAnsi();

consolePrinter.println(output);
consolePrinter.println(output);

stringBuilder = new AttributedStringBuilder();
if ( ! result.hasError()) {
stringBuilder = new AttributedStringBuilder();
if (!result.hasError()) {
ProjectContext projectContext = scanCommand.execute(projectRoot);
contextHolder.setProjectContext(projectContext);
List<Recipe> recipes = applicableRecipeListCommand.execute(projectContext);
AttributedString recipeList = applicableRecipeListRenderer.render(recipes);
stringBuilder.append(recipeList);
}

return stringBuilder.toAttributedString();
}
return stringBuilder.toAttributedString().toAnsi();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2021 - 2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.sbm.shell.converter;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.nio.file.Path;

@Component
public class StringToPathConverter implements Converter<String, Path> {
@Override
public Path convert(String source) {
return Path.of(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public String render() {
AttributedStringBuilder builder = new AttributedStringBuilder();
builder.style(AttributedStyle.DEFAULT.bold().foreground(Colors.rgbColor("green")));
builder.append("[ok]");
return " ".repeat(indent.get()) + " " + builder.toAnsi() + " " + logMessage;
return " ".repeat(indent.get()) + " " + builder.toAttributedString().toAnsi() + " " + logMessage;
}

public String renderError() {
Expand All @@ -51,7 +51,7 @@ public String renderError() {
.style(AttributedStyle.DEFAULT)
.append(" ")
.append(logMessage);
return builder.toAnsi();
return builder.toAttributedString().toAnsi();
}

public String renderWarning() {
Expand All @@ -63,6 +63,6 @@ public String renderWarning() {
.style(AttributedStyle.DEFAULT)
.append(" ")
.append(logMessage);
return builder.toAnsi();
return builder.toAttributedString().toAnsi();
}
}
18 changes: 12 additions & 6 deletions applications/spring-shell/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
|_| |___/ |___/

Find us...
on GitHub: https://github.com/pivotal/spring-boot-migrator
on GitHub: https://github.com/spring-projects-experimental/spring-boot-migrator
on Slack: https://vmware.slack.com/archives/CKB9VJE68 #spring-boot-migrator

This project contains a lot of ❤️❤️❤️️ but still, there will be 🐞🐞🐞
So please, give us Feedback: https://github.com/pivotal/spring-boot-migrator/issues
Also if you 👍 or 👎 something or have an 💡
This project contains a lot of love. But still, there will be bugs...
So please, give us Feedback: https://github.com/spring-projects-experimental/spring-boot-migrator/issues
Also, if you like the project please give a star on GitHub.

THANK YOU!

Use "help" command to list all of the available commands.

Properties:
-----------
Git Support enabled: ${sbm.gitSupportEnabled}
Expand All @@ -40,4 +38,12 @@ Base Package: ${sbm.defaultBasePackage}

Use -Dsbm.defaultBasePackage=com.acme.packagename as VM parameter on startup to set the property.


Get Started:
------------
Type

"help" - to display a list all of the available commands.
"scan <dir>" - to scan an application

--------------------------------------------------------------------------------------------------
Loading