summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
Diffstat (limited to 'xmake')
-rw-r--r--xmake/rules/ndk/install.lua1
-rw-r--r--xmake/rules/ndk/package.lua1
-rw-r--r--xmake/rules/ndk/run.lua18
-rw-r--r--xmake/rules/ndk/xmake.lua3
4 files changed, 20 insertions, 3 deletions
diff --git a/xmake/rules/ndk/install.lua b/xmake/rules/ndk/install.lua
index 20f213f05..672a623ce 100644
--- a/xmake/rules/ndk/install.lua
+++ b/xmake/rules/ndk/install.lua
@@ -19,7 +19,6 @@
--
-- imports
-import("core.tool.toolchain")
import("run", {alias = "run_app"})
-- main entry
diff --git a/xmake/rules/ndk/package.lua b/xmake/rules/ndk/package.lua
index 5b4921ddb..797efa22e 100644
--- a/xmake/rules/ndk/package.lua
+++ b/xmake/rules/ndk/package.lua
@@ -19,7 +19,6 @@
--
-- imports
-import("core.tool.toolchain")
import("utils.progress")
-- main entry
diff --git a/xmake/rules/ndk/run.lua b/xmake/rules/ndk/run.lua
index d85af1de9..612d18c7e 100644
--- a/xmake/rules/ndk/run.lua
+++ b/xmake/rules/ndk/run.lua
@@ -18,6 +18,9 @@
-- @file run.lua
--
+-- imports
+import("core.base.tty")
+
-- main entry
function main(target)
@@ -32,4 +35,19 @@ function main(target)
cprint("running %s ...", package_name)
os.vrunv(adb, run_argv)
+
+ -- show logcat
+ local logcat_argv = {"logcat"}
+ if io.isatty() and (tty.has_color8() or tty.has_color256()) then
+ table.insert(logcat_argv, "-v")
+ table.insert(logcat_argv, "color")
+ end
+ local logcat_filters = conf.logcat_filters
+ if logcat_filters then
+ table.insert(logcat_argv, "-s")
+ for _, filter in ipairs(logcat_filters) do
+ table.insert(logcat_argv, filter)
+ end
+ end
+ os.execv(adb, logcat_argv)
end
diff --git a/xmake/rules/ndk/xmake.lua b/xmake/rules/ndk/xmake.lua
index 783abac65..0c58d7d09 100644
--- a/xmake/rules/ndk/xmake.lua
+++ b/xmake/rules/ndk/xmake.lua
@@ -30,7 +30,8 @@
-- android_assets = "android/assets",
-- keystore = "android/debug.jks",
-- keystore_pass = "123456",
--- package_name = "com.raylib.demo"
+-- package_name = "com.raylib.demo",
+-- logcat_filters = {"raydemo_android", "raylib"}
-- })
-- @endcode
--