Skip to content

Commit

Permalink
Fix turnstile and showcase sample
Browse files Browse the repository at this point in the history
Signed-off-by: Henning Pöttker <[email protected]>
  • Loading branch information
hpoettker committed Feb 9, 2025
1 parent bcf39df commit 4271090
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 24 deletions.
1 change: 1 addition & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
implementation("org.springframework:spring-core")
implementation 'org.asciidoctor:asciidoctor-gradle-jvm:3.3.2'
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.29.0'
implementation "org.springframework.boot:org.springframework.boot.gradle.plugin:${springBootVersion}"
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.PluginManager;
import org.springframework.boot.gradle.plugin.SpringBootPlugin;

/**
* @author Janne Valkealahti
Expand All @@ -30,6 +31,7 @@ public void apply(Project project) {
PluginManager pluginManager = project.getPluginManager();
pluginManager.apply(JavaPlugin.class);
pluginManager.apply(ManagementConfigurationPlugin.class);
pluginManager.apply(SpringBootPlugin.class);
new JavaConventions().apply(project);
new EclipseConventions().apply(project);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ description = 'Spring Statemachine BOM'

dependencies {
api platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
api platform("org.springframework.shell:spring-shell-dependencies:$springShellVersion")
constraints {
api "com.google.code.findbugs:jsr305:$findbugsVersion"
api "com.esotericsoftware:kryo-shaded:$kryoVersion"
api "org.springframework.shell:spring-shell-core:$springShellVersion"
api "jakarta.persistence:jakarta.persistence-api:$jakartaPersistenceVersion"
api "org.eclipse.uml2:uml:$eclipseUml2UmlVersion"
api "org.eclipse.uml2:types:$eclipseUml2TypesVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
management platform(project(":spring-statemachine-platform"))
implementation project(':spring-statemachine-samples-common')
implementation project(':spring-statemachine-core')
implementation 'org.springframework.shell:spring-shell-core'
implementation 'org.springframework.shell:spring-shell-starter'
testImplementation(testFixtures(project(':spring-statemachine-core')))
testImplementation (project(':spring-statemachine-test'))
testImplementation 'org.hamcrest:hamcrest-core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.shell.command.annotation.CommandScan;
import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.statemachine.config.EnableStateMachine;
Expand All @@ -30,7 +32,8 @@
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;
import org.springframework.statemachine.guard.Guard;

@Configuration
@CommandScan
@SpringBootApplication(scanBasePackages = "demo")
public class Application {

private final static Log log = LogFactory.getLog(Application.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.shell.command.annotation.Command;
import org.springframework.shell.command.annotation.Option;
import org.springframework.stereotype.Component;

import demo.AbstractStateMachineCommands;
import demo.showcase.Application.Events;
import demo.showcase.Application.States;
import reactor.core.publisher.Mono;

@Component
@Command
public class StateMachineCommands extends AbstractStateMachineCommands<States, Events> {

@Command(command = "sm event", description = "Sends an event to a state machine")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.shell.interactive.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ dependencies {
implementation 'org.springframework.shell:spring-shell-core'
implementation 'org.springframework.boot:spring-boot-starter'
}

tasks.named("bootJar") {
enabled = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
management platform(project(":spring-statemachine-platform"))
implementation project(':spring-statemachine-samples-common')
implementation project(':spring-statemachine-core')
implementation 'org.springframework.shell:spring-shell-core'
implementation 'org.springframework.shell:spring-shell-starter'
testImplementation(testFixtures(project(':spring-statemachine-core')))
testImplementation (project(':spring-statemachine-test'))
testImplementation 'org.hamcrest:hamcrest-core'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
import java.util.EnumSet;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.shell.command.annotation.CommandScan;
import org.springframework.statemachine.config.EnableStateMachine;
import org.springframework.statemachine.config.EnumStateMachineConfigurerAdapter;
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;

@Configuration
@CommandScan
@SpringBootApplication(scanBasePackages = "demo")
public class Application {

//tag::snippetA[]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.shell.interactive.enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void reset(int c1, int c2, int c3, int c4) {
@BeforeEach
public void setup() {
context = new AnnotationConfigApplicationContext();
context.register(CommonConfiguration.class, Application.class, Config.class, StateMachineCommands.class);
context.register(CommonConfiguration.class, Application.class, Config.class);
context.refresh();
machine = context.getBean(StateMachineSystemConstants.DEFAULT_ID_STATEMACHINE, ObjectStateMachine.class);
listener = context.getBean(TestListener.class);
Expand Down

0 comments on commit 4271090

Please sign in to comment.