Skip to content

Commit 0a64628

Browse files
Merge pull request #108 from anshumanjadiya1102/feature/add-terminal-gui
Feature/add terminal gui
2 parents e43bd32 + 60c9008 commit 0a64628

File tree

22 files changed

+460
-552
lines changed

22 files changed

+460
-552
lines changed

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 🧱 Build MyCMD-GUI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
name: 🔨 Build and Package
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: 🧩 Checkout source code
16+
uses: actions/checkout@v4
17+
18+
- name: ☕ Set up Java
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: 'temurin'
22+
java-version: '21'
23+
cache: maven
24+
25+
- name: 🧰 Build using Maven Wrapper
26+
run: ./mvnw -B clean package
27+
28+
- name: 📦 Upload built JAR artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: MyCMD-GUI
32+
path: target/*.jar

.gitignore

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
target/
1+
2+
*.class
3+
4+
5+
*.log
6+
7+
8+
*.ctxt
9+
10+
11+
.mtj.tmp/
12+
13+
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# IntelliJ / VS Code / Eclipse
23+
.idea/
24+
.vscode/
25+
*.iml
26+
.project
27+
.classpath
28+
.settings/
29+
30+
31+
target/
32+
out/
33+
34+
35+
.mvn/wrapper/maven-wrapper.jar
36+
37+
38+
.DS_Store
39+
Thumbs.db
40+
41+
42+
javafx_cache/
43+
44+
45+
launcher/*.exe
46+
launcher/*.lnk
47+
installer/output/
48+
49+
50+
.idea/
51+
.vscode/

launcher/MyCMD.bat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
@echo off
2+
setlocal
3+
set MYCMD_LAUNCHED=true
4+
5+
:: Hide CMD window by using javaw instead of java
6+
javaw -jar target\MyCMD-GUI-1.0-SNAPSHOT.jar
7+
8+
endlocal
9+
exit

lib/.gitkeep

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

mvnw

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

mvnw.cmd

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

pom.xml

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<project xmlns="http://maven.apache.org/POM/4.0.0"
23
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
4-
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
56
<modelVersion>4.0.0</modelVersion>
67

78
<groupId>com.mycmd</groupId>
8-
<artifactId>MyCMD</artifactId>
9-
<version>1.0</version>
10-
<packaging>jar</packaging>
11-
12-
<name>MyCMD</name>
13-
<description>A custom CMD shell written in Java</description>
9+
<artifactId>MyCMD-GUI</artifactId>
10+
<version>1.0.0</version>
11+
<name>MyCMD-GUI</name>
12+
<description>Dark futuristic JavaFX shell for MyCMD</description>
1413

1514
<properties>
15+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1616
<maven.compiler.source>17</maven.compiler.source>
1717
<maven.compiler.target>17</maven.compiler.target>
18+
<javafx.version>21</javafx.version>
1819
</properties>
1920

2021
<dependencies>
22+
<!-- JavaFX -->
2123
<dependency>
22-
<groupId>org.projectlombok</groupId>
23-
<artifactId>lombok</artifactId>
24-
<version>1.18.42</version>
25-
<scope>provided</scope>
24+
<groupId>org.openjfx</groupId>
25+
<artifactId>javafx-controls</artifactId>
26+
<version>${javafx.version}</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>org.openjfx</groupId>
30+
<artifactId>javafx-fxml</artifactId>
31+
<version>${javafx.version}</version>
2632
</dependency>
2733
</dependencies>
34+
2835
<build>
2936
<plugins>
37+
<!-- Compiler -->
3038
<plugin>
3139
<groupId>org.apache.maven.plugins</groupId>
3240
<artifactId>maven-compiler-plugin</artifactId>
33-
<version>3.14.1</version>
41+
<version>3.10.1</version>
3442
<configuration>
3543
<source>${maven.compiler.source}</source>
3644
<target>${maven.compiler.target}</target>
37-
<annotationProcessorPaths>
38-
<path>
39-
<groupId>org.projectlombok</groupId>
40-
<artifactId>lombok</artifactId>
41-
<version>1.18.42</version>
42-
</path>
43-
</annotationProcessorPaths>
4445
</configuration>
4546
</plugin>
46-
47+
48+
<!-- JavaFX Plugin -->
4749
<plugin>
48-
<groupId>org.apache.maven.plugins</groupId>
49-
<artifactId>maven-jar-plugin</artifactId>
50-
<version>3.4.2</version>
50+
<groupId>org.openjfx</groupId>
51+
<artifactId>javafx-maven-plugin</artifactId>
52+
<version>${javafx.version}</version>
5153
<configuration>
52-
<archive>
53-
<manifest>
54-
<mainClass>com.mycmd.App</mainClass>
55-
</manifest>
56-
</archive>
54+
<mainClass>com.mycmd.gui.MainApp</mainClass>
5755
</configuration>
5856
</plugin>
5957

60-
<!-- Spotless code formatter -->
6158
<plugin>
62-
<groupId>com.diffplug.spotless</groupId>
63-
<artifactId>spotless-maven-plugin</artifactId>
64-
<version>3.0.0</version>
65-
<configuration>
66-
<java>
67-
<googleJavaFormat>
68-
<version>1.17.0</version>
69-
<style>AOSP</style>
70-
</googleJavaFormat>
71-
</java>
72-
</configuration>
59+
<groupId>org.apache.maven.plugins</groupId>
60+
<artifactId>maven-shade-plugin</artifactId>
61+
<version>3.3.0</version>
62+
<executions>
63+
<execution>
64+
<phase>package</phase>
65+
<goals>
66+
<goal>shade</goal>
67+
</goals>
68+
<configuration>
69+
<transformers>
70+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
71+
<mainClass>com.mycmd.gui.MainApp</mainClass>
72+
</transformer>
73+
</transformers>
74+
</configuration>
75+
</execution>
76+
</executions>
7377
</plugin>
7478
</plugins>
7579
</build>
76-
</project>
80+
</project>

scripts/build-linux.sh

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
#!/bin/bash
2-
echo "=== Building MyCMD for Linux ==="
2+
echo "🏗️ Building MyCMD for Linux..."
33

4-
mvn clean package
4+
# Clean and package with Maven Wrapper
5+
./mvnw clean package
56

6-
rm -rf dist
7-
mkdir -p dist/bin dist/lib dist/icons
7+
# Move JAR to dist folder
8+
mkdir -p dist
9+
cp target/MyCMD-GUI*.jar dist/MyCMD-GUI.jar
810

9-
cp target/MyCMD-1.0.jar dist/lib/dependencies.jar
10-
cp icons/mycmd.ico dist/icons/mycmd.ico
11-
12-
# Example jpackage usage
13-
jpackage \
14-
--name MyCMD \
15-
--input dist/lib \
16-
--main-jar dependencies.jar \
17-
--main-class com.mycmd.App \
18-
--icon icons/mycmd.ico \
19-
--type deb \
20-
--dest dist
21-
22-
echo "Build complete. Installer is in dist/"
11+
echo "✅ Build complete! File located in dist/MyCMD-GUI.jar"

scripts/build-windows.bat

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
@echo off
2-
echo === Building MyCMD for Windows ===
2+
echo 🏗️ Building MyCMD for Windows...
33

4-
REM Clean and build jar
5-
mvn clean package
4+
REM Clean and package using Maven Wrapper
5+
call mvnw.cmd clean package
66

7-
REM Create dist structure
8-
rmdir /s /q dist
9-
mkdir dist\bin
10-
mkdir dist\lib
11-
mkdir dist\icons
7+
REM Move output JARs to /dist folder
8+
if not exist dist mkdir dist
9+
copy target\MyCMD-GUI*.jar dist\MyCMD-GUI.jar
1210

13-
REM Copy jar + icon
14-
copy target\MyCMD-1.0.jar dist\lib\dependencies.jar
15-
copy icons\mycmd.ico dist\icons\mycmd.ico
16-
17-
echo Build complete. Use Launch4j + Inno Setup to package installer.
11+
echo ✅ Build complete! File located in dist\MyCMD-GUI.jar
12+
pause

0 commit comments

Comments
 (0)