An open API service indexing awesome lists of open source software.

https://github.com/crramirez/casciian-app-template

base project to develop casciian based applications, include native build, deb and rpm generation
https://github.com/crramirez/casciian-app-template

Last synced: 5 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# Casciian App Template

Application template for building [Casciian](https://github.com/crramirez/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

```bash
./gradlew clean build
```

This creates a JAR file in `build/libs/casciianapp-.jar`

### Running the Application

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

Or with Java directly:

```bash
export JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64
java -jar build/libs/casciianapp-.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:

```bash
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](https://www.graalvm.org/downloads/).

#### Building Native Binary

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

```bash
./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

```bash
# 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:

```bash
./gradlew buildPackages
```

Or build individually:

```bash
./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:**
```bash
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:**
```bash
sudo rpm -ivh build/distributions/rpm/casciianapp-0.1.0-1.x86_64.rpm
```

After installation, you can run the application:
```bash
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

- [Casciian 1.1](https://github.com/crramirez/casciian) - Java Text User Interface library