LTUI is a cross-platform character terminal UI interface library based on lua.
This framework originates from the requirement of graphical menu configuration in xmake, similar to the menuconf of linux kernel to configure the compilation parameters, so based on curses and lua, a complete set of cross Character terminal ui library of the platform. The style and style are basically completely referenced by kconfig-frontends. Of course, users can also customize different ui styles.
In addition, LTUI is completely cross-platform, and the terminal terminal on Windows is also fully supported. On Windows, ltui will use pdcurses to draw windows.
However, the previous version did not support the layout adjustment with the size of the terminal window to automatically adjust the layout. If the window becomes larger, the entire view there will still retain the original size. In the current v1.7 version, I have carried out partial refactoring to support the window Resize and adaptive adjustment of all views layout.
previous version:
new version:
This version mainly expands the built-in build rules, and adds relevant rules to support the construction of iOS / MacOS related App application projects, Framework and Bundle programs.
It also supports App signing, and provides related engineering templates to quickly create applications. In addition, this version has also made many improvements to Qt development and construction, adding support for Qt5.14.0 new version SDK and packaging and deployment support for Android It has also improved a lot.
In addition to processing, xmake also provides a special xmake.cli
build rule, through the integration of libxmake engine library to expand the development of xmake engine-based programs, such as: make a customized version of xmake, you can also write some lua based on this Script program.
xmake-gradle is a gradle plugin that integrates xmake seamlessly.
At present, there are two ways to do integrated development of android jni in gradle. It is supported by ndkBuild or CMake. Gradle also has built-in integration of these two tools.
However, maintaining Android.mk is still very tedious, especially for large projects, and the dsl syntax of cmake is not simple and intuitive, and I personally don’t like it very much. Therefore, I have used xmake to implement cross-platform development. It’s simple, fast, friendly to novices, and it’s also very powerful. You can go to the xmake project homepage to see the introduction.
In the past, if you want to use xmake to compile the android so library, you can only use the command line, such as:
xmake f -p android --ndk=xxxx
xmake
Although it is very simple, but if you want to package and integrate with android apk/aar, still need a lot of extra work. In order to improve the efficiency of developers, I recently reorganized this gradle plugin to seamlessly integrate into the entire gradle build System.
In this way, users can easily use xmake to compile the jni library in android studio, and automatic integration.
In addition, the relevant gradle configuration is basically the same as cmake and ndkbuild, most of them are compatible, and the switching cost will also be reduced a lot.
Everyone is welcome to try it, the newly released plugin, if you want to know more, please refer to:
XMake installed on the system. Available here.
plugins {
id 'org.tboox.gradle-xmake-plugin' version '1.0.7'
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'org.tboox:gradle-xmake-plugin:1.0.7'
}
repositories {
mavenCentral()
}
}
apply plugin: "org.tboox.gradle-xmake-plugin"
We add xmake.lua
to projectdir/jni/xmake.lua
and enable xmake in build.gradle.
android {
externalNativeBuild {
xmake {
path "jni/xmake.lua"
}
}
}
This version focuses on refactoring and optimization of the internal parallel build mechanism, enabling parallel compilation of source files between multiple targets, and support for parallel links. It also optimizes some internal losses of xmake and fixes some bugs that affect compilation speed. Through testing and comparison, the current overall build speed is basically the same as ninja. Compared to cmake/make, meson/ninja is much faster, because they have an extra step to generate makefile / build.ninja.
In addition, xmake also adds support for the sdcc compilation toolchain for compiling embedded programs such as 51/stm8.
For more optimization details, please see: issue #589
We did some comparison tests on termux and macOS. The test project is at: xmake-core
For a relatively large number of target projects, the new version of xmake improves its build speed even more.
buildsystem | Termux (8core/-j12) | buildsystem | MacOS (8core/-j12) |
---|---|---|---|
xmake | 24.890s | xmake | 12.264s |
ninja | 25.682s | ninja | 11.327s |
cmake(gen+make) | 5.416s+28.473s | cmake(gen+make) | 1.203s+14.030s |
cmake(gen+ninja) | 4.458s+24.842s | cmake(gen+ninja) | 0.988s+11.644s |
buildsystem | Termux (-j1) | buildsystem | MacOS (-j1) |
---|---|---|---|
xmake | 1m57.707s | xmake | 39.937s |
ninja | 1m52.845s | ninja | 38.995s |
cmake(gen+make) | 5.416s+2m10.539s | cmake(gen+make) | 1.203s+41.737s |
cmake(gen+ninja) | 4.458s+1m54.868s | cmake(gen+ninja) | 0.988s+38.022s |
There are not many changes in functions and features in this version. The main improvement is the scheduling module of the coroutine, which enables unified scheduling support for the three objects: process, socket, and pipe. We can operate processes in the coroutine at the same time. There are pipes.
This relies on the poller module provided by tbox, which uniformly encapsulates interfaces such as epoll/kqueue/select/poll/iocp to achieve cross-platform wait for socket/pipe object events. By providing consistent reactors, unified dispatching in coroutines is achieved. .
In addition, poller also adds support for waiting for process events. You can also wait for the exit event of the process at the same time through the same wait interface. Actually, there are still a lot of things about this.
E.g:
The relevant poller interfaces mainly include the following four, where object can be a process/pipe/socket object, and then set the corresponding event to wait at the same time.
tb_bool_t tb_poller_insert(tb_poller_ref_t poller, tb_poller_object_ref_t object, tb_size_t events, tb_cpointer_t priv);
tb_bool_t tb_poller_remove(tb_poller_ref_t poller, tb_poller_object_ref_t object);
tb_bool_t tb_poller_modify(tb_poller_ref_t poller, tb_poller_object_ref_t object, tb_size_t events, tb_cpointer_t priv);
tb_long_t tb_poller_wait(tb_poller_ref_t poller, tb_poller_event_func_t func, tb_long_t timeout);