-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
This page gives you the fastest reliable path to a first Aparoksha app.
The simplest way to begin today is:
- create a standard Swift executable package
- add the main Aparoksha package as a dependency
- import
Aparoksha - let the package choose the default backend for your platform
- only force a backend manually when testing or debugging
This is the best starting point because the umbrella package already contains the backend selection logic.
- Swift 6 toolchain
- network access the first time Swift Package Manager resolves dependencies
Install GTK 4 and libadwaita development packages.
sudo dnf install gtk4-devel libadwaita-develsudo apt install libgtk-4-dev libadwaita-1-dev- install Xcode
- make sure the Swift toolchain is working
- the default backend on macOS is typically
APPKIT
If you want to experiment with the Adwaita backend on macOS too:
brew install libadwaita- install Swift for Windows
- install the Windows App SDK
- use PowerShell or your preferred editor environment to build and run
mkdir MyAparokshaApp
cd MyAparokshaApp
swift package init --type executable// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "MyAparokshaApp",
platforms: [
.macOS(.v13)
],
products: [
.executable(name: "MyAparokshaApp", targets: ["MyAparokshaApp"])
],
dependencies: [
.package(url: "https://git.aparoksha.dev/aparoksha/aparoksha", branch: "main")
],
targets: [
.executableTarget(
name: "MyAparokshaApp",
dependencies: ["Aparoksha"],
path: "Sources"
)
],
swiftLanguageModes: [.v5]
)Create Sources/MyAparokshaApp.swift:
import Aparoksha
@main
struct MyAparokshaApp: App {
let app = Aparoksha(
id: "com.example.myaparokshaapp",
name: "My Aparoksha App",
settings: "Settings",
about: "About My Aparoksha App",
developer: "Your Name",
version: "0.1.0",
quit: "Quit My Aparoksha App",
website: .init(string: "https://example.com")!,
websiteLabel: "Website",
issues: .init(string: "https://example.com/issues")!,
issuesLabel: "Issues",
services: "Services"
)
.hideMenu(
hideApp: "Hide My Aparoksha App",
hideOthers: "Hide Others",
showAll: "Show All"
)
var scene: Scene {
Window("My Aparoksha App", icon: .headphones, id: "main") {
ContentView()
}
}
}
struct ContentView: WindowView {
var view: Body {
VStack {
Text("Hello from Aparoksha")
.padding(10)
}
.padding(20)
}
}swift runThat should use the native default backend for the current platform.
The upstream ecosystem currently has some inconsistency between older versioned dependency examples and the current umbrella package setup. For a new project, the most practical path is to follow the current umbrella package style and use branch: "main".
Continue with Starter Template if you want a GitHub-ready starter layout, or Project Structure and Core Concepts if you want to understand how the framework fits together.