Skip to content

Commit 0ec1436

Browse files
committed
update docs
1 parent 34d7454 commit 0ec1436

File tree

19 files changed

+1896
-10
lines changed

19 files changed

+1896
-10
lines changed

docs/api/description/builtin-policies.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,3 +589,26 @@ Sets uiAccess for Windows UAC, defaults to false if it is not set.
589589
```lua
590590
set_policy("windows.manifest.uac.ui", true)
591591
```
592+
593+
## build.progress_style <Badge type="tip" text="v3.0.5" />
594+
595+
Sets the build progress output style. Supports two styles:
596+
597+
- `"single"` (default): Single-row progress output, only updates one line of progress information
598+
- `"multirow"`: Multi-row progress output, displays multiple concurrent build tasks with their individual progress
599+
600+
Multi-row progress output provides a significantly better visual experience during long-running builds, making it easier to monitor parallel compilation.
601+
602+
You can enable multi-row progress output in two ways:
603+
604+
1. **Via theme configuration**: Use the `soong` theme which includes multi-row progress by default:
605+
```bash
606+
$ xmake g --theme=soong
607+
```
608+
609+
2. **Via project policy**: Enable it directly in your `xmake.lua`:
610+
```lua
611+
set_policy("build.progress_style", "multirow")
612+
```
613+
614+
This provides better visibility into parallel build progress, makes it easier to identify slow compilation units, and improves the overall user experience for large projects with many source files or parallel builds with multiple compilation units.

docs/api/description/project-target.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6136,6 +6136,20 @@ target("test")
61366136
add_runenvs("LD_LIBRARY_PATH", "/lib")
61376137
```
61386138

6139+
#### Realtime output support
6140+
6141+
Starting from v3.0.5, you can enable realtime output support for tests, allowing test output to be displayed in real-time as tests run, rather than buffering output until the test completes. This is particularly useful for long-running tests or tests that produce continuous output.
6142+
6143+
To enable realtime output for a test, set `realtime_output = true` in the test configuration:
6144+
6145+
```lua
6146+
target("test")
6147+
set_kind("binary")
6148+
add_tests("stub_n", {realtime_output = true, files = "tests/stub_n*.cpp", defines = "STUB_N"})
6149+
```
6150+
6151+
When `realtime_output` is enabled, the test output will be streamed directly to the terminal as the test runs, making it easier to monitor test progress and debug issues in real-time.
6152+
61396153
#### Matching output results
61406154

61416155
By default, `xmake test` will determine whether the test passed based on whether the exit code of the test run is 0.

docs/api/scripts/builtin-modules/os.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ Since v3.0.4, the parameter `{copy_if_different = true}` is added to copy files
7878
os.cp("$(scriptdir)/config.h", "$(builddir)/inc/config.h", {copy_if_different = true})
7979
```
8080

81+
Starting from v3.0.5, async operations are supported:
82+
83+
```lua
84+
-- Async copy files (blocking wait)
85+
os.cp("src/*.h", "dest/", {async = true})
86+
87+
-- Async copy files (non-blocking, background execution)
88+
os.cp("src/*.h", "dest/", {async = true, detach = true})
89+
```
90+
8191
## os.mv
8292

8393
- Move to rename a file or directory
@@ -118,7 +128,7 @@ os.mv("$(builddir)/libtest.a", "$(builddir)/libdemo.a")
118128

119129
::: tip API
120130
```lua
121-
os.rm(path: <string>)
131+
os.rm(path: <string>, options?: <table>)
122132
```
123133
:::
124134

@@ -128,6 +138,7 @@ os.rm(path: <string>)
128138
| Parameter | Description |
129139
|-----------|-------------|
130140
| path | File or directory path |
141+
| options | Optional options table, supports `async` and `detach` parameters |
131142

132143
#### Usage
133144

@@ -138,6 +149,16 @@ os.rm("$(builddir)/inc/**.h")
138149
os.rm("$(builddir)/lib/")
139150
```
140151

152+
Starting from v3.0.5, async operations are supported:
153+
154+
```lua
155+
-- Async delete file (blocking wait)
156+
os.rm("/tmp/xxx.txt", {async = true})
157+
158+
-- Async delete file (non-blocking, background execution)
159+
os.rm("/tmp/xxx.txt", {async = true, detach = true})
160+
```
161+
141162
## os.trycp
142163

143164
- Try copying files or directories
@@ -519,7 +540,7 @@ end
519540

520541
::: tip API
521542
```lua
522-
os.files(pattern: <string>)
543+
os.files(pattern: <string>, options?: <table>)
523544
```
524545
:::
525546

@@ -529,6 +550,7 @@ os.files(pattern: <string>)
529550
| Parameter | Description |
530551
|-----------|-------------|
531552
| pattern | File pattern |
553+
| options | Optional options table, supports `async` parameter |
532554

533555
#### Usage
534556

@@ -541,6 +563,13 @@ for _, filepath in ipairs(os.files("$(builddir)/inc/*.h")) do
541563
end
542564
```
543565

566+
Starting from v3.0.5, async operations are supported:
567+
568+
```lua
569+
-- Async find files (blocking wait for return value)
570+
local files = os.files("src/*.c", {async = true})
571+
```
572+
544573
## os.filedirs
545574

546575
- Traverse to get all files and directories under the specified directory

docs/api/scripts/extension-modules/core/base/tty.md

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,3 +642,223 @@ local oldmode = tty.term_mode("stdout")
642642
tty.term_mode("stdout", newmode)
643643
```
644644

645+
## tty.cursor_move_up <Badge type="tip" text="v3.0.5" />
646+
647+
- Move cursor up by n lines
648+
649+
#### Function Prototype
650+
651+
::: tip API
652+
```lua
653+
tty.cursor_move_up(n: <number>)
654+
```
655+
:::
656+
657+
#### Parameter Description
658+
659+
| Parameter | Description |
660+
|-----------|-------------|
661+
| n | Number of lines to move up |
662+
663+
#### Return Value
664+
665+
| Type | Description |
666+
|------|-------------|
667+
| tty | Returns the tty module for method chaining |
668+
669+
#### Usage
670+
671+
```lua
672+
import("core.base.tty")
673+
674+
tty.cursor_move_up(3) -- Move cursor up 3 lines
675+
```
676+
677+
## tty.cursor_move_down <Badge type="tip" text="v3.0.5" />
678+
679+
- Move cursor down by n lines
680+
681+
#### Function Prototype
682+
683+
::: tip API
684+
```lua
685+
tty.cursor_move_down(n: <number>)
686+
```
687+
:::
688+
689+
#### Parameter Description
690+
691+
| Parameter | Description |
692+
|-----------|-------------|
693+
| n | Number of lines to move down |
694+
695+
#### Return Value
696+
697+
| Type | Description |
698+
|------|-------------|
699+
| tty | Returns the tty module for method chaining |
700+
701+
#### Usage
702+
703+
```lua
704+
import("core.base.tty")
705+
706+
tty.cursor_move_down(2) -- Move cursor down 2 lines
707+
```
708+
709+
## tty.cursor_move_left <Badge type="tip" text="v3.0.5" />
710+
711+
- Move cursor left by n columns
712+
713+
#### Function Prototype
714+
715+
::: tip API
716+
```lua
717+
tty.cursor_move_left(n: <number>)
718+
```
719+
:::
720+
721+
#### Parameter Description
722+
723+
| Parameter | Description |
724+
|-----------|-------------|
725+
| n | Number of columns to move left |
726+
727+
#### Return Value
728+
729+
| Type | Description |
730+
|------|-------------|
731+
| tty | Returns the tty module for method chaining |
732+
733+
#### Usage
734+
735+
```lua
736+
import("core.base.tty")
737+
738+
tty.cursor_move_left(5) -- Move cursor left 5 columns
739+
```
740+
741+
## tty.cursor_move_right <Badge type="tip" text="v3.0.5" />
742+
743+
- Move cursor right by n columns
744+
745+
#### Function Prototype
746+
747+
::: tip API
748+
```lua
749+
tty.cursor_move_right(n: <number>)
750+
```
751+
:::
752+
753+
#### Parameter Description
754+
755+
| Parameter | Description |
756+
|-----------|-------------|
757+
| n | Number of columns to move right |
758+
759+
#### Return Value
760+
761+
| Type | Description |
762+
|------|-------------|
763+
| tty | Returns the tty module for method chaining |
764+
765+
#### Usage
766+
767+
```lua
768+
import("core.base.tty")
769+
770+
tty.cursor_move_right(10) -- Move cursor right 10 columns
771+
```
772+
773+
## tty.cursor_move_to_col <Badge type="tip" text="v3.0.5" />
774+
775+
- Move cursor to specific column
776+
777+
#### Function Prototype
778+
779+
::: tip API
780+
```lua
781+
tty.cursor_move_to_col(n: <number>)
782+
```
783+
:::
784+
785+
#### Parameter Description
786+
787+
| Parameter | Description |
788+
|-----------|-------------|
789+
| n | Column number to move to (1-based) |
790+
791+
#### Return Value
792+
793+
| Type | Description |
794+
|------|-------------|
795+
| tty | Returns the tty module for method chaining |
796+
797+
#### Usage
798+
799+
```lua
800+
import("core.base.tty")
801+
802+
tty.cursor_move_to_col(1) -- Move cursor to start of line
803+
```
804+
805+
## tty.cursor_hide <Badge type="tip" text="v3.0.5" />
806+
807+
- Hide cursor
808+
809+
#### Function Prototype
810+
811+
::: tip API
812+
```lua
813+
tty.cursor_hide()
814+
```
815+
:::
816+
817+
#### Parameter Description
818+
819+
No parameters
820+
821+
#### Return Value
822+
823+
| Type | Description |
824+
|------|-------------|
825+
| tty | Returns the tty module for method chaining |
826+
827+
#### Usage
828+
829+
```lua
830+
import("core.base.tty")
831+
832+
tty.cursor_hide() -- Hide cursor
833+
```
834+
835+
## tty.cursor_show <Badge type="tip" text="v3.0.5" />
836+
837+
- Show cursor
838+
839+
#### Function Prototype
840+
841+
::: tip API
842+
```lua
843+
tty.cursor_show()
844+
```
845+
:::
846+
847+
#### Parameter Description
848+
849+
No parameters
850+
851+
#### Return Value
852+
853+
| Type | Description |
854+
|------|-------------|
855+
| tty | Returns the tty module for method chaining |
856+
857+
#### Usage
858+
859+
```lua
860+
import("core.base.tty")
861+
862+
tty.cursor_show() -- Show cursor
863+
```
864+

0 commit comments

Comments
 (0)