linglong/docs/pages/en/guide/building/demo.md

157 lines
3.2 KiB
Markdown
Raw Permalink Normal View History

<!--
SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
SPDX-License-Identifier: LGPL-3.0-or-later
-->
# Building Example Demonstration
## Initialize a Linyaps Application Project
```bash
ll-builder create org.deepin.demo
```
## Edit linglong.yaml Configuration File
### Configure Package Metadata Information
```yaml
package:
id: org.deepin.demo
name: demo
kind: app
version: 1.0.0.0
description: |
A simple demo app.
```
2024-07-02 14:35:39 +08:00
### Configure Application Launch Command
```yaml
command:
- demo
```
2024-07-02 14:35:39 +08:00
### Configure Base System and Runtime Environment
```yaml
base: org.deepin.base/23.1.0
runtime: org.deepin.runtime.dtk/23.1.0
```
2024-07-02 14:35:39 +08:00
### Configure Source Code Information
Fetch source code using Git
```yaml
sources:
- kind: git
url: "https://github.com/linuxdeepin/linglong-builder-demo.git"
commit: master
name: linglong-builder-demo
```
### Configure Build Rules
```yaml
build: |
cd /project/linglong/sources/linglong-builder-demo
rm -rf build || true
mkdir build
cd build
qmake ..
make
make install
```
### Complete linglong.yaml Configuration File
```yaml
version: "1"
2024-07-02 14:35:39 +08:00
package:
id: org.deepin.demo
name: demo
kind: app
version: 1.0.0.0
description: |
A simple demo app.
command:
- demo
base: org.deepin.base/23.1.0
runtime: org.deepin.runtime.dtk/23.1.0
sources:
- kind: git
url: "https://github.com/linuxdeepin/linglong-builder-demo.git"
commit: master
name: linglong-builder-demo
build: |
cd /project/linglong/sources/linglong-builder-demo
rm -rf build || true
mkdir build
cd build
qmake ..
make
make install
```
2024-07-02 14:35:39 +08:00
For more configuration file field definitions, refer to [Configuration File Reference](./manifests.md)
## Execute the Build Process
Execute the build command in the Linyaps project root directory:
```bash
ll-builder build
```
2024-07-02 14:35:39 +08:00
## Run the Application
After successful build, execute the run command in the Linyaps project directory to directly run the application without installation.
```bash
ll-builder run
```
## Export Build Artifacts
Execute the export command in the Linyaps project root directory to export the build contents.
```bash
2024-07-02 14:35:39 +08:00
ll-builder export --layer
```
2024-07-02 14:35:39 +08:00
The exported directory structure is as follows:
```text
├── linglong
├── linglong.yaml
├── org.deepin.demo_1.0.0.0_x86_64_binary.layer
└── org.deepin.demo_1.0.0.0_x86_64_develop.layer
2024-07-02 14:35:39 +08:00
```
2025-08-01 16:41:51 +08:00
## Additional Reference Examples
2025-08-01 16:41:51 +08:00
[qt5](https://github.com/linglongdev/cn.org.linyaps.demo.qt5) - qt5 program
2025-08-01 16:41:51 +08:00
[dtk5](https://github.com/linglongdev/cn.org.linyaps.demo.dtk5.qmake) - dtk5 + qmake
[dtk5](https://github.com/linglongdev/cn.org.linyaps.demo.dtk5.cmake) - dtk5 + cmake
[dtkdeclarative5](https://github.com/linglongdev/cn.org.linyaps.demo.dtkdeclarative5) - dtk5 + qml
[electron](https://github.com/myml/electron-vue-linyaps-app) - electron + vue example
2025-08-01 16:41:51 +08:00
[plantuml](https://github.com/linglongdev/com.plantuml.gpl) - a Java application for programmatic flowchart creation
2025-08-01 16:41:51 +08:00
[org.sumatrapdfreader](https://github.com/linglongdev/org.sumatrapdfreader) - a Wine application, PDF reader
## More Complete Example
[Complete Example](../start/build_your_first_app.md) - Contains a complete workflow example of how to build applications, export build contents, install, and run.