Skip to content

Commit

Permalink
[#104] Demo projects, first cut
Browse files Browse the repository at this point in the history
  • Loading branch information
susanw1 committed Aug 31, 2023
1 parent 322676c commit 6af65e2
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 0 deletions.
55 changes: 55 additions & 0 deletions demo/demo-01/client/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.zscript.demo</groupId>
<artifactId>demo-01</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>demo-01-client</artifactId>
<packaging>jar</packaging>
<name>Demo 01 Client</name>

<dependencies>
<dependency>
<groupId>net.zscript</groupId>
<artifactId>zscript-java-client-connection</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.zscript</groupId>
<artifactId>zscript-java-client-command-builders</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>18.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>18.0.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<!-- To run, use: mvn -pl net.zscript.demo:demo-01-client install javafx:run -->
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<configuration>
<mainClass>net.zscript.demo01.client.ui.UiMain</mainClass>
<jlinkImageName>zscript_demo_01</jlinkImageName>
<launcher>launcher</launcher>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.zscript.demo01.client;

import net.zscript.model.modules.base.CoreModule;

public class Main {
public static void main(String[] args) {
CoreModule.activate()
.build();

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package net.zscript.demo01.client.ui;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class UiMain extends Application {
public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.setTitle("Hello World?");
Button btn = new Button();
btn.setText("Say 'Hello World'");
btn.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
System.out.println("Hello World!");
}
});

StackPane root = new StackPane();
root.getChildren().add(btn);
primaryStage.setScene(new Scene(root, 300, 250));
primaryStage.show();
}
}
15 changes: 15 additions & 0 deletions demo/demo-01/firmware/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.zscript.demo</groupId>
<artifactId>demo-01</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>demo-01-firmware</artifactId>
<packaging>pom</packaging>
<name>Demo 01 Firmware</name>
</project>
21 changes: 21 additions & 0 deletions demo/demo-01/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.zscript.demo</groupId>
<artifactId>demo-all</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>demo-01</artifactId>
<packaging>pom</packaging>
<name>Demo 01</name>

<modules>
<module>client</module>
<module>firmware</module>
</modules>

</project>
43 changes: 43 additions & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.zscript</groupId>
<artifactId>zscript-all</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<groupId>net.zscript.demo</groupId>
<artifactId>demo-all</artifactId>
<packaging>pom</packaging>
<name>Zscript Demos</name>

<modules>
<module>demo-01</module>
</modules>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
</dependency>
</dependencies>
</project>
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<module>acceptance-tests</module>
<module>simulator</module>
<module>util</module>
<module>demo</module>
</modules>

<dependencyManagement>
Expand Down

0 comments on commit 6af65e2

Please sign in to comment.