adwaita-template/README.md

63 lines
3.9 KiB
Markdown
Raw Permalink Normal View History

2023-11-26 22:16:54 +01:00
<p align="center">
<img width="256" alt="Adwaita Template Icon" src="data/icons/io.github.AparokshaUI.AdwaitaTemplate.svg">
<h1 align="center">Adwaita Template</h1>
</p>
_Adwaita Template_ is a template application for the [Adwaita for Swift package](https://adwaita-swift.aparoksha.dev/documentation/adwaita/).
2023-11-26 22:16:54 +01:00
## Table of Contents
- [Installation](#Installation)
- [Usage](#Usage)
- [Thanks](#Thanks)
## Installation
Install the [GNOME Builder](https://flathub.org/apps/org.gnome.Builder) IDE.
2023-11-26 22:16:54 +01:00
For designing an app icon, [App Icon Preview](https://flathub.org/apps/org.gnome.design.AppIconPreview) and [Inkscape](https://flathub.org/apps/org.inkscape.Inkscape) are recommended.
2023-11-26 22:16:54 +01:00
> [!NOTE]
> You do not have to install any dependencies of Adwaita for Swift, including Swift, on your system.
> The Adwaita template runs in a [Flatpak](https://flatpak.org/).
> The GNOME Builder will automatically download dependencies from [Flathub](https://flathub.org).
2024-06-14 09:21:19 +02:00
> You can also use [Visual Studio Code](https://code.visualstudio.com/) with a Docker [dev container](https://code.visualstudio.com/docs/devcontainers/containers) hosting the Swift toolchain and Adwaita libraries.
2023-11-26 22:16:54 +01:00
## Usage
1. Open this project in the GNOME Builder. It will start downloading the dependencies.
2024-06-14 09:21:19 +02:00
- GNOME Builder will start downloading dependencies when opened.
2024-06-14 09:32:43 +02:00
- For Visual Studio Code, enable the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers), the [Swift extension](https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang) and the [CodeLLDB extension](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) and reopen the project window with the dev container. It may take a couple minutes to build.
2024-06-14 09:21:19 +02:00
2. Build and run the application.
- For GNOME Builder, use the "run" icon in the toolbar.
- For Visual Studio Code, select the "run and debug" tab in the leftmost sidebar, and then tap the run icon next to "Debug AdwaitaTemplate".
2023-11-26 22:16:54 +01:00
3. Change the app's name and other information about the application in the following files (and file names):
- `README.md`
- `Package.swift`
- `io.github.AparokshaUI.AdwaitaTemplate.json`
- `Sources/AdwaitaTemplate.swift`
- `data/io.github.AparokshaUI.AdwaitaTemplate.metainfo.xml`
- `data/io.github.AparokshaUI.AdwaitaTemplate.desktop`
- `data/icons/io.github.AparokshaUI.AdwaitaTemplate.Source.svg`
- `data/icons/io.github.AparokshaUI.AdwaitaTemplate.svg`
- `data/icons/io.github.AparokshaUI.AdwaitaTemplate-symbolic.svg`
4. Edit the code. Help is available [here](https://adwaita-swift.aparoksha.dev/), ask questions in the [forums](https://forums.aparoksha.dev/).
5. You can edit the app's icons using the previously installed tools according to [this](https://blogs.gnome.org/tbernard/2019/12/30/designing-an-icon-for-your-app/) tutorial.
6. In GNOME Builder, click on the dropdown next to the hammer and then on `Export`. Wait until the file manager appears, open the `.flatpak` file and install the app on your device!
7. If you want to publish your app, replace `debug` in the following build commands by `release`:
```
"swift build -c debug --static-swift-stdlib",
"install -Dm755 .build/debug/AdwaitaTemplate /app/bin/AdwaitaTemplate",
```
2023-11-26 22:16:54 +01:00
### Flatpak SPM Generator
If you want to e.g. publish your app on Flathub where no internet connection is allowed while running the build commands,
you can use [this tool](https://github.com/flatpak/flatpak-builder-tools/tree/master/spm) that lets you generate a Flatpak manifest JSON from a Swift package.
2023-11-26 22:16:54 +01:00
## Thanks
### Dependencies
- [Adwaita for Swift](https://git.aparoksha.dev/aparoksha/adwaita-swift) licensed under the [MIT License](https://git.aparoksha.dev/aparoksha/adwaita-swift/src/branch/main/LICENSE.md)
- [Localized](https://git.aparoksha.dev/aparoksha/localized) licensed under the [MIT License](https://git.aparoksha.dev/aparoksha/localized/src/branch/main/LICENSE.md)