Skip to content

base project to develop casciian based applications, include native build, deb and rpm generation

License

Notifications You must be signed in to change notification settings

crramirez/casciian-app-template

Repository files navigation

Casciian App Template

Application template for building Casciian TUI-based applications. This template includes support for native builds, DEB and RPM package generation.

Description

This is a starter template for creating text-based user interface (TUI) applications using the Casciian Java library. It includes a simple "Hello World" demonstration that you can customize for your own application.

Prerequisites

  • Java 21 or later
  • Gradle 9.2.1 or later (included via wrapper)
  • For native image compilation: GraalVM Java 25 with native-image
  • For packaging: fpm (installed via gem install fpm)

Building

Standard JAR Build

./gradlew clean build

This creates a JAR file in build/libs/casciianapp-<version>.jar

Running the Application

./gradlew installDist
./build/install/casciianapp/bin/casciianapp

Or with Java directly:

export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
java -jar build/libs/casciianapp-<version>.jar

Native Image Compilation (Required for Packaging)

The DEB and RPM packages require a native binary. You need GraalVM Java 25 with native-image installed.

Installing GraalVM

You can install GraalVM using SDKMAN:

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 25.0.0.r25-graalce

Or download directly from GraalVM Downloads.

Building Native Binary

  1. Ensure GraalVM Java 25 is installed and configured
  2. Run:
./gradlew nativeCompile

This creates a native executable at build/native/nativeCompile/casciianapp

Creating DEB and RPM Packages

Important: The packages require a native binary. You must first compile the native binary using GraalVM (see above).

Prerequisites for Packaging

# Install fpm and dependencies
sudo apt-get install ruby ruby-dev build-essential rpm
sudo gem install fpm

Building Packages

After compiling the native binary, build both DEB and RPM packages:

./gradlew buildPackages

Or build individually:

./gradlew buildDeb    # Creates DEB package in build/distributions/deb/
./gradlew buildRpm    # Creates RPM package in build/distributions/rpm/

The packages will include only:

  • /usr/bin/casciianapp - Native executable binary

Installing the Packages

Debian/Ubuntu:

sudo dpkg -i build/distributions/deb/casciianapp_0.1.0-1_amd64.deb
sudo apt-get install -f  # Install dependencies if needed

RedHat/CentOS/Fedora:

sudo rpm -ivh build/distributions/rpm/casciianapp-0.1.0-1.x86_64.rpm

After installation, you can run the application:

casciianapp

Customizing the Template

This template is designed to be a starting point for your own Casciian-based application:

  1. Rename the project: Update settings.gradle to change the project name
  2. Update package names: Modify the package structure in src/main/java/ to match your organization
  3. Customize the application: Edit HelloWorld.java or create new classes for your application logic
  4. Update metadata:
    • Edit build.gradle to update group, description, URLs, and maintainer information
    • Update gradle.properties to set your version
  5. Update documentation: Modify this README to describe your specific application

Project Structure

casciianapp/
├── build.gradle              # Gradle build configuration
├── settings.gradle           # Gradle settings
├── gradle.properties         # Project version and properties
├── src/
│   └── main/
│       └── java/
│           └── io/github/crramirez/casciianapp/
│               └── HelloWorld.java   # Main application (customize this!)
└── README.md

License

Apache License 2.0 - Copyright 2025 [Your Name Here]

Dependencies

About

base project to develop casciian based applications, include native build, deb and rpm generation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages