Skip to content

Commit d396282

Browse files
committed
Move terminal ui framework to a dedicated module
Resolves #847
1 parent 8b1ad75 commit d396282

File tree

227 files changed

+1005
-1064
lines changed

Some content is hidden

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

227 files changed

+1005
-1064
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282

8383
<modules>
8484
<module>spring-shell-table</module>
85+
<module>spring-shell-tui</module>
8586
<module>spring-shell-core</module>
8687
<module>spring-shell-standard</module>
8788
<module>spring-shell-test</module>

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ComponentFlowAutoConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
import org.springframework.context.annotation.Scope;
2828
import org.springframework.core.annotation.Order;
2929
import org.springframework.core.io.ResourceLoader;
30-
import org.springframework.shell.component.flow.ComponentFlow;
31-
import org.springframework.shell.component.flow.ComponentFlow.Builder;
32-
import org.springframework.shell.style.TemplateExecutor;
30+
import org.springframework.shell.tui.component.flow.ComponentFlow;
31+
import org.springframework.shell.tui.component.flow.ComponentFlow.Builder;
32+
import org.springframework.shell.tui.style.TemplateExecutor;
3333

3434
/**
3535
* {@link EnableAutoConfiguration Auto-configuration} for {@link ComponentFlow}.

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ComponentFlowCustomizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package org.springframework.shell.boot;
1717

18-
import org.springframework.shell.component.flow.ComponentFlow;
18+
import org.springframework.shell.tui.component.flow.ComponentFlow;
1919

2020
/**
2121
* Callback interface that can be used to customize a {@link ComponentFlow.Builder}.

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/StandardCommandsAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.springframework.shell.standard.commands.Script;
4141
import org.springframework.shell.standard.commands.Stacktrace;
4242
import org.springframework.shell.standard.commands.Version;
43-
import org.springframework.shell.style.TemplateExecutor;
43+
import org.springframework.shell.tui.style.TemplateExecutor;
4444

4545
/**
4646
* Creates beans for standard commands.

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/TerminalUIAutoConfiguration.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2424
import org.springframework.context.annotation.Bean;
2525
import org.springframework.context.annotation.Scope;
26-
import org.springframework.shell.component.ViewComponentBuilder;
27-
import org.springframework.shell.component.ViewComponentExecutor;
28-
import org.springframework.shell.component.view.TerminalUI;
29-
import org.springframework.shell.component.view.TerminalUIBuilder;
30-
import org.springframework.shell.component.view.TerminalUICustomizer;
31-
import org.springframework.shell.style.ThemeActive;
32-
import org.springframework.shell.style.ThemeResolver;
26+
import org.springframework.shell.tui.component.ViewComponentBuilder;
27+
import org.springframework.shell.tui.component.ViewComponentExecutor;
28+
import org.springframework.shell.tui.component.view.TerminalUI;
29+
import org.springframework.shell.tui.component.view.TerminalUIBuilder;
30+
import org.springframework.shell.tui.component.view.TerminalUICustomizer;
31+
import org.springframework.shell.tui.style.ThemeActive;
32+
import org.springframework.shell.tui.style.ThemeResolver;
3333

3434
@AutoConfiguration
3535
@ConditionalOnClass(TerminalUI.class)

spring-shell-autoconfigure/src/main/java/org/springframework/shell/boot/ThemingAutoConfiguration.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
2121
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2222
import org.springframework.context.annotation.Bean;
23-
import org.springframework.shell.style.TemplateExecutor;
24-
import org.springframework.shell.style.Theme;
25-
import org.springframework.shell.style.ThemeActive;
26-
import org.springframework.shell.style.ThemeRegistry;
27-
import org.springframework.shell.style.ThemeResolver;
28-
import org.springframework.shell.style.ThemeSettings;
23+
import org.springframework.shell.tui.style.TemplateExecutor;
24+
import org.springframework.shell.tui.style.Theme;
25+
import org.springframework.shell.tui.style.ThemeActive;
26+
import org.springframework.shell.tui.style.ThemeRegistry;
27+
import org.springframework.shell.tui.style.ThemeResolver;
28+
import org.springframework.shell.tui.style.ThemeSettings;
2929
import org.springframework.util.StringUtils;
3030

3131
@AutoConfiguration

spring-shell-autoconfigure/src/test/java/org/springframework/shell/boot/TerminalUIAutoConfigurationTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2626
import org.springframework.context.annotation.Bean;
2727
import org.springframework.context.annotation.Configuration;
28-
import org.springframework.shell.component.view.TerminalUI;
29-
import org.springframework.shell.component.view.TerminalUIBuilder;
30-
import org.springframework.shell.component.view.TerminalUICustomizer;
31-
import org.springframework.shell.style.ThemeActive;
32-
import org.springframework.shell.style.ThemeRegistry;
33-
import org.springframework.shell.style.ThemeResolver;
28+
import org.springframework.shell.tui.component.view.TerminalUI;
29+
import org.springframework.shell.tui.component.view.TerminalUIBuilder;
30+
import org.springframework.shell.tui.component.view.TerminalUICustomizer;
31+
import org.springframework.shell.tui.style.ThemeActive;
32+
import org.springframework.shell.tui.style.ThemeRegistry;
33+
import org.springframework.shell.tui.style.ThemeResolver;
3434
import org.springframework.test.util.ReflectionTestUtils;
3535

3636
import static org.assertj.core.api.Assertions.assertThat;

spring-shell-autoconfigure/src/test/java/org/springframework/shell/boot/ThemingAutoConfigurationTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2626
import org.springframework.context.annotation.Bean;
2727
import org.springframework.context.annotation.Configuration;
28-
import org.springframework.shell.style.FigureSettings;
29-
import org.springframework.shell.style.SpinnerSettings;
30-
import org.springframework.shell.style.StyleSettings;
31-
import org.springframework.shell.style.TemplateExecutor;
32-
import org.springframework.shell.style.Theme;
33-
import org.springframework.shell.style.ThemeRegistry;
34-
import org.springframework.shell.style.ThemeResolver;
35-
import org.springframework.shell.style.ThemeSettings;
28+
import org.springframework.shell.tui.style.FigureSettings;
29+
import org.springframework.shell.tui.style.SpinnerSettings;
30+
import org.springframework.shell.tui.style.StyleSettings;
31+
import org.springframework.shell.tui.style.TemplateExecutor;
32+
import org.springframework.shell.tui.style.Theme;
33+
import org.springframework.shell.tui.style.ThemeRegistry;
34+
import org.springframework.shell.tui.style.ThemeResolver;
35+
import org.springframework.shell.tui.style.ThemeSettings;
3636
import org.springframework.util.StringUtils;
3737

3838
import static org.assertj.core.api.Assertions.assertThat;

spring-shell-core/pom.xml

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,11 @@
3131
</scm>
3232

3333
<dependencies>
34-
<!-- TODO move TerminalSizeAware to core and remove this dependency -->
3534
<dependency>
3635
<groupId>org.springframework.shell</groupId>
3736
<artifactId>spring-shell-table</artifactId>
3837
<version>${project.parent.version}</version>
3938
</dependency>
40-
<dependency>
41-
<groupId>io.projectreactor</groupId>
42-
<artifactId>reactor-core</artifactId>
43-
<version>${reactor.version}</version>
44-
</dependency>
4539
<dependency>
4640
<groupId>org.springframework</groupId>
4741
<artifactId>spring-context</artifactId>
@@ -57,16 +51,6 @@
5751
<artifactId>jline</artifactId>
5852
<version>${jline.version}</version>
5953
</dependency>
60-
<dependency>
61-
<groupId>org.antlr</groupId>
62-
<artifactId>ST4</artifactId>
63-
<version>${antlr-st4.version}</version>
64-
</dependency>
65-
<dependency>
66-
<groupId>commons-io</groupId>
67-
<artifactId>commons-io</artifactId>
68-
<version>${commons-io.version}</version>
69-
</dependency>
7054
<dependency>
7155
<groupId>org.slf4j</groupId>
7256
<artifactId>slf4j-api</artifactId>
@@ -79,6 +63,12 @@
7963
</dependency>
8064

8165
<!-- Test dependencies -->
66+
<dependency>
67+
<groupId>org.springframework.shell</groupId>
68+
<artifactId>spring-shell-tui</artifactId>
69+
<version>${project.parent.version}</version>
70+
<scope>test</scope>
71+
</dependency>
8272
<dependency>
8373
<groupId>org.springframework.boot</groupId>
8474
<artifactId>spring-boot-test</artifactId>
@@ -103,24 +93,6 @@
10393
<version>${mockito.version}</version>
10494
<scope>test</scope>
10595
</dependency>
106-
<dependency>
107-
<groupId>com.google.jimfs</groupId>
108-
<artifactId>jimfs</artifactId>
109-
<version>${jimfs.version}</version>
110-
<scope>test</scope>
111-
</dependency>
112-
<dependency>
113-
<groupId>io.projectreactor</groupId>
114-
<artifactId>reactor-test</artifactId>
115-
<version>${reactor.version}</version>
116-
<scope>test</scope>
117-
</dependency>
118-
<dependency>
119-
<groupId>org.awaitility</groupId>
120-
<artifactId>awaitility</artifactId>
121-
<version>${awaitility.version}</version>
122-
<scope>test</scope>
123-
</dependency>
12496
<dependency>
12597
<groupId>org.hibernate.validator</groupId>
12698
<artifactId>hibernate-validator</artifactId>

spring-shell-core/src/test/java/org/springframework/shell/jline/InteractiveShellRunnerTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import org.junit.jupiter.api.Disabled;
3131
import org.junit.jupiter.api.Test;
3232

33-
import org.springframework.boot.ApplicationArguments;
34-
import org.springframework.boot.DefaultApplicationArguments;
3533
import org.springframework.shell.ExitRequest;
3634

3735
import static org.assertj.core.api.Assertions.assertThat;
@@ -152,8 +150,4 @@ void testExitWithCtrlD() throws Exception {
152150
writeThread.join();
153151
}
154152

155-
private static ApplicationArguments ofApplicationArguments(String... args) {
156-
return new DefaultApplicationArguments(args);
157-
}
158-
159153
}

0 commit comments

Comments
 (0)