feat: add first simple jakartaee10-servlet project
jakarta project has to be cleaned up and some smaller errors have to be fixed
This commit is contained in:
parent
fe83dc1f33
commit
04ecd56598
8 changed files with 114 additions and 4 deletions
76
build.sh
Executable file
76
build.sh
Executable file
|
|
@ -0,0 +1,76 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Prüfe auf erforderliches Versions-Argument
|
||||
if [ -z "$1" ]; then
|
||||
echo "Fehler: App-Version muss als Parameter angegeben werden (z.B. ./build.sh 0.0.1)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
APP_VERSION="$1"
|
||||
APP_ID="com.hegenberg.javastarter"
|
||||
APP_BUILD="1"
|
||||
NAME="jws"
|
||||
ICON="Icon.png"
|
||||
SDK_PATH="./MacOSX11.3.sdk"
|
||||
|
||||
# Lösche vorhandenen packages-Ordner und erstelle neu
|
||||
if [ -d "packages" ]; then
|
||||
echo "Entferne vorhandenen packages-Ordner..."
|
||||
rm -rf packages
|
||||
fi
|
||||
mkdir -p packages
|
||||
|
||||
# Build-Funktion für Mac
|
||||
build_mac() {
|
||||
local arch="$1"
|
||||
echo "Baue Mac $arch Version..."
|
||||
fyne-cross darwin \
|
||||
-app-id "$APP_ID" \
|
||||
-app-build "$APP_BUILD" \
|
||||
-app-version "$APP_VERSION" \
|
||||
-icon "$ICON" \
|
||||
-name "$NAME" \
|
||||
-arch "$arch" \
|
||||
-macosx-sdk-path "$SDK_PATH" \
|
||||
-ldflags "-s" \
|
||||
-ldflags "-w" \
|
||||
./cmd/jws
|
||||
|
||||
# Verpacke die App
|
||||
local dist_dir="fyne-cross/dist/darwin-${arch}/jws.app"
|
||||
tar -cJf "packages/jws_mac_${arch}.tar.xz" "$dist_dir"
|
||||
}
|
||||
|
||||
# Bauen für Mac-Architekturen
|
||||
for arch in arm64 amd64; do
|
||||
build_mac "$arch"
|
||||
done
|
||||
|
||||
# Build Windows
|
||||
echo "Baue Windows Version..."
|
||||
fyne-cross windows \
|
||||
-app-id "$APP_ID" \
|
||||
-app-build "$APP_BUILD" \
|
||||
-app-version "$APP_VERSION" \
|
||||
-icon "$ICON" \
|
||||
-name "$NAME.exe" \
|
||||
-ldflags "-s" \
|
||||
-ldflags "-w" \
|
||||
./cmd/jws
|
||||
|
||||
mv fyne-cross/dist/windows-amd64/jws.exe.zip packages/jws_windows.zip
|
||||
|
||||
# Build Linux
|
||||
echo "Baue Linux Version..."
|
||||
# Erstelle selbstentpackendes Bundle
|
||||
fyne package --target linux --exe ./jws --name "$NAME" --appVersion "$APP_VERSION" --sourceDir ./cmd/jws
|
||||
# Erstelle einfache Executable
|
||||
fyne build ./cmd/jws
|
||||
|
||||
# Verpacke Linux-Versionen
|
||||
tar -cJf packages/jws_linux_exe.tar.xz ./jws
|
||||
tar -cJf packages/jws_linux_bundle.tar.xz ./jws.tar.xz
|
||||
|
||||
echo "Build abgeschlossen! Dateien finden sich im packages-Ordner:"
|
||||
ls -lh packages/
|
||||
|
|
@ -32,7 +32,7 @@ var (
|
|||
func main() {
|
||||
config, err := config.LoadConfig()
|
||||
if err != nil {
|
||||
fmt.Printf("Error loading config: %v\n", err)
|
||||
fmt.Printf("error loading config: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ func main() {
|
|||
|
||||
err = logger.Init(config.LogFilePath, logLevel)
|
||||
if err != nil {
|
||||
fmt.Printf("Error initializing logger: %v\n", err)
|
||||
fmt.Printf("error initializing logger: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Todo App</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Todo App</h1>
|
||||
|
||||
<form method="post" action="todos">
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" required />
|
||||
|
||||
<label for="completed">Completed:</label>
|
||||
<input type="checkbox" id="completed" name="completed" />
|
||||
|
||||
<button type="submit">Add Todo</button>
|
||||
</form>
|
||||
|
||||
<h2>Todos</h2>
|
||||
<ul>
|
||||
<%
|
||||
List<com.example.model.Todo> todos = (List<com.example.model.Todo>) request.getAttribute("todos");
|
||||
if (todos != null) {
|
||||
for (com.example.model.Todo todo : todos) {
|
||||
%>
|
||||
<li><%= todo.getTitle() %> - <%= todo.isCompleted() ? "Completed" : "Pending" %></li>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -26,7 +26,6 @@ func LoadConfig() (*Config, error) {
|
|||
|
||||
if err := viper.ReadInConfig(); err != nil {
|
||||
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
|
||||
// Config file not found, create default config
|
||||
return createDefaultConfig(configPath)
|
||||
}
|
||||
return nil, err
|
||||
|
|
@ -71,5 +70,4 @@ func createDefaultConfig(configPath string) (*Config, error) {
|
|||
}
|
||||
|
||||
return &defaultConfig, nil
|
||||
// ... (Rest der Funktion bleibt gleich)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue