Skip to content

Commit e206e39

Browse files
committed
Simplify example classes
Empty lib/ and res/ Remove Main class's package Improve action error message
1 parent 68f99d5 commit e206e39

7 files changed

Lines changed: 5 additions & 25 deletions

File tree

bat/compile.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ for /f "usebackq tokens=*" %%N in (`call "%~dp0empty" %REQKEYS%`) do (echo missi
4242
:action
4343
if defined PRINT%~n0ERROR (set "CHECK=") else (set "CHECK=2>nul")
4444
set SOURCESLIST=%TEMPORARY%\sources.txt
45-
for %%A in (%ACTION%) do (call :%%A || (echo error:%%A:!ERRORLEVEL! & exit /b !ERRORLEVEL!))
45+
for %%A in (%ACTION%) do (call :%%A || (echo error:action:%%A:!ERRORLEVEL! & exit /b !ERRORLEVEL!))
4646
goto :EOF
4747

4848
:create

bat/package.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if not defined NAME (set NAME=%AREA%)
5151
set BATFILE=%PACKAGE%\%NAME%.bat
5252
set JARFILE=%PACKAGE%\%NAME%.jar
5353
set MANIFEST=%TEMPORARY%\manifest.txt
54-
for %%A in (%ACTION%) do (call :%%A || (echo error:%%A:!ERRORLEVEL! & exit /b !ERRORLEVEL!))
54+
for %%A in (%ACTION%) do (call :%%A || (echo error:action:%%A:!ERRORLEVEL! & exit /b !ERRORLEVEL!))
5555
goto :EOF
5656

5757
:create

res/resource.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

run.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set ARGS=-i %INIFILE% -a %AREA%
1212

1313
@rem set error level https://superuser.com/a/649329
1414
echo creating
15-
call %SCRIPTS%\compile %ARGS% -c & set LAST=!ERRORLEVEL!
15+
call %SCRIPTS%\compile %ARGS% -r -c & set LAST=!ERRORLEVEL!
1616
echo create:%LAST%
1717
if not %LAST% == 0 (pause & exit /b %LAST%)
1818

src/Main.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,5 @@
1-
package io.github.geetransit.template;
2-
3-
import java.io.*;
4-
import java.util.*;
5-
import java.awt.*;
6-
import java.awt.event.*;
7-
import javax.swing.*;
8-
91
public class Main {
102
public static void main(String[] args) {
11-
System.out.println("template.Main#main");
12-
Other.main(args);
13-
InputStream file = Main.class.getResourceAsStream("/res/resource.txt");
14-
Scanner bob = new Scanner(file);
15-
while (bob.hasNextLine())
16-
System.out.println(bob.nextLine());
3+
System.out.println("Hello, world!");
174
}
185
}

src/Other.java

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/launch/Launcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class Launcher {
1010
// change this string to your main class.
11-
public static final String invoke = "io.github.geetransit.template.Main";
11+
public static final String invoke = "Main";
1212
public static void main(String[] args) throws Throwable {
1313
new JarClassLoader().invokeMain(invoke, args);
1414
}

0 commit comments

Comments
 (0)