summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-03-02 23:52:25 +0800
committerruki <[email protected]>2026-03-02 23:52:25 +0800
commitb01dcb775c98cc48abe65a91ef9bf093be875682 (patch)
treeaef3e65981edc5506f9d20197be0892ce2957ba1
parent3c1e3d746b7cc0a1a5dec9448a72a13bfe30f246 (diff)
improve template dirs
-rw-r--r--xmake/actions/create/template.lua58
-rw-r--r--xmake/templates/c++/module/binary/.gitignore (renamed from xmake/templates/c++/module.binary/.gitignore)0
-rw-r--r--xmake/templates/c++/module/binary/modules/binary/bar/.gitignore (renamed from xmake/templates/c++/module.binary/modules/binary/bar/.gitignore)0
-rw-r--r--xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp (renamed from xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp)0
-rw-r--r--xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp (renamed from xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp)0
-rw-r--r--xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua (renamed from xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua)0
-rw-r--r--xmake/templates/c++/module/binary/src/main.cpp (renamed from xmake/templates/c++/module.binary/src/main.cpp)0
-rw-r--r--xmake/templates/c++/module/binary/xmake.lua (renamed from xmake/templates/c++/module.binary/xmake.lua)0
-rw-r--r--xmake/templates/c++/module/shared/.gitignore (renamed from xmake/templates/c++/module.shared/.gitignore)0
-rw-r--r--xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp (renamed from xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp)0
-rw-r--r--xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua (renamed from xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua)0
-rw-r--r--xmake/templates/c++/module/shared/src/main.cpp (renamed from xmake/templates/c++/module.shared/src/main.cpp)0
-rw-r--r--xmake/templates/c++/module/shared/xmake.lua (renamed from xmake/templates/c++/module.shared/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/console/src/main.cpp (renamed from xmake/templates/c++/qt.console/src/main.cpp)0
-rw-r--r--xmake/templates/c++/qt/console/xmake.lua (renamed from xmake/templates/c++/qt.console/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/quickapp/src/main.cpp (renamed from xmake/templates/c++/qt.quickapp/src/main.cpp)0
-rw-r--r--xmake/templates/c++/qt/quickapp/src/main.qml (renamed from xmake/templates/c++/qt.quickapp/src/main.qml)0
-rw-r--r--xmake/templates/c++/qt/quickapp/src/qml.qrc (renamed from xmake/templates/c++/qt.quickapp/src/qml.qrc)0
-rw-r--r--xmake/templates/c++/qt/quickapp/xmake.lua (renamed from xmake/templates/c++/qt.quickapp/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/quickapp_static/src/main.cpp (renamed from xmake/templates/c++/qt.quickapp_static/src/main.cpp)0
-rw-r--r--xmake/templates/c++/qt/quickapp_static/src/main.qml (renamed from xmake/templates/c++/qt.quickapp_static/src/main.qml)0
-rw-r--r--xmake/templates/c++/qt/quickapp_static/src/qml.qrc (renamed from xmake/templates/c++/qt.quickapp_static/src/qml.qrc)0
-rw-r--r--xmake/templates/c++/qt/quickapp_static/xmake.lua (renamed from xmake/templates/c++/qt.quickapp_static/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/shared/src/demo.cpp (renamed from xmake/templates/c++/qt.shared/src/demo.cpp)0
-rw-r--r--xmake/templates/c++/qt/shared/src/demo.h (renamed from xmake/templates/c++/qt.shared/src/demo.h)0
-rw-r--r--xmake/templates/c++/qt/shared/src/demo_global.h (renamed from xmake/templates/c++/qt.shared/src/demo_global.h)0
-rw-r--r--xmake/templates/c++/qt/shared/xmake.lua (renamed from xmake/templates/c++/qt.shared/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/static/src/demo.cpp (renamed from xmake/templates/c++/qt.static/src/demo.cpp)0
-rw-r--r--xmake/templates/c++/qt/static/src/demo.h (renamed from xmake/templates/c++/qt.static/src/demo.h)0
-rw-r--r--xmake/templates/c++/qt/static/xmake.lua (renamed from xmake/templates/c++/qt.static/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/widgetapp/src/main.cpp (renamed from xmake/templates/c++/qt.widgetapp/src/main.cpp)0
-rw-r--r--xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp (renamed from xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp)0
-rw-r--r--xmake/templates/c++/qt/widgetapp/src/mainwindow.h (renamed from xmake/templates/c++/qt.widgetapp/src/mainwindow.h)0
-rw-r--r--xmake/templates/c++/qt/widgetapp/src/mainwindow.ui (renamed from xmake/templates/c++/qt.widgetapp/src/mainwindow.ui)0
-rw-r--r--xmake/templates/c++/qt/widgetapp/xmake.lua (renamed from xmake/templates/c++/qt.widgetapp/xmake.lua)0
-rw-r--r--xmake/templates/c++/qt/widgetapp_static/src/main.cpp (renamed from xmake/templates/c++/qt.widgetapp_static/src/main.cpp)0
-rw-r--r--xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp (renamed from xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp)0
-rw-r--r--xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h (renamed from xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h)0
-rw-r--r--xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui (renamed from xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui)0
-rw-r--r--xmake/templates/c++/qt/widgetapp_static/xmake.lua (renamed from xmake/templates/c++/qt.widgetapp_static/xmake.lua)0
-rw-r--r--xmake/templates/c++/xmake/cli/src/lni/main.cpp (renamed from xmake/templates/c++/xmake.cli/src/lni/main.cpp)0
-rw-r--r--xmake/templates/c++/xmake/cli/src/lua/main.lua (renamed from xmake/templates/c++/xmake.cli/src/lua/main.lua)0
-rw-r--r--xmake/templates/c++/xmake/cli/xmake.lua (renamed from xmake/templates/c++/xmake.cli/xmake.lua)0
-rw-r--r--xmake/templates/c/module/binary/.gitignore (renamed from xmake/templates/c/module.binary/.gitignore)0
-rw-r--r--xmake/templates/c/module/binary/modules/binary/bar/.gitignore (renamed from xmake/templates/c/module.binary/modules/binary/bar/.gitignore)0
-rw-r--r--xmake/templates/c/module/binary/modules/binary/bar/src/add.c (renamed from xmake/templates/c/module.binary/modules/binary/bar/src/add.c)0
-rw-r--r--xmake/templates/c/module/binary/modules/binary/bar/src/sub.c (renamed from xmake/templates/c/module.binary/modules/binary/bar/src/sub.c)0
-rw-r--r--xmake/templates/c/module/binary/modules/binary/bar/xmake.lua (renamed from xmake/templates/c/module.binary/modules/binary/bar/xmake.lua)0
-rw-r--r--xmake/templates/c/module/binary/src/main.c (renamed from xmake/templates/c/module.binary/src/main.c)0
-rw-r--r--xmake/templates/c/module/binary/xmake.lua (renamed from xmake/templates/c/module.binary/xmake.lua)0
-rw-r--r--xmake/templates/c/module/shared/.gitignore (renamed from xmake/templates/c/module.shared/.gitignore)0
-rw-r--r--xmake/templates/c/module/shared/modules/shared/foo/src/foo.c (renamed from xmake/templates/c/module.shared/modules/shared/foo/src/foo.c)0
-rw-r--r--xmake/templates/c/module/shared/modules/shared/foo/xmake.lua (renamed from xmake/templates/c/module.shared/modules/shared/foo/xmake.lua)0
-rw-r--r--xmake/templates/c/module/shared/src/main.c (renamed from xmake/templates/c/module.shared/src/main.c)0
-rw-r--r--xmake/templates/c/module/shared/xmake.lua (renamed from xmake/templates/c/module.shared/xmake.lua)0
-rw-r--r--xmake/templates/c/xmake/cli/src/lni/main.c (renamed from xmake/templates/c/xmake.cli/src/lni/main.c)0
-rw-r--r--xmake/templates/c/xmake/cli/src/lua/main.lua (renamed from xmake/templates/c/xmake.cli/src/lua/main.lua)0
-rw-r--r--xmake/templates/c/xmake/cli/xmake.lua (renamed from xmake/templates/c/xmake.cli/xmake.lua)0
-rw-r--r--xmake/templates/objc++/xcode/bundle/src/Info.plist (renamed from xmake/templates/objc++/xcode.bundle/src/Info.plist)0
-rw-r--r--xmake/templates/objc++/xcode/bundle/src/test.h (renamed from xmake/templates/objc++/xcode.bundle/src/test.h)0
-rw-r--r--xmake/templates/objc++/xcode/bundle/src/test.mm (renamed from xmake/templates/objc++/xcode.bundle/src/test.mm)0
-rw-r--r--xmake/templates/objc++/xcode/bundle/xmake.lua (renamed from xmake/templates/objc++/xcode.bundle/xmake.lua)0
-rw-r--r--xmake/templates/objc++/xcode/framework/src/Info.plist (renamed from xmake/templates/objc++/xcode.framework/src/Info.plist)0
-rw-r--r--xmake/templates/objc++/xcode/framework/src/test.h (renamed from xmake/templates/objc++/xcode.framework/src/test.h)0
-rw-r--r--xmake/templates/objc++/xcode/framework/src/test.mm (renamed from xmake/templates/objc++/xcode.framework/src/test.mm)0
-rw-r--r--xmake/templates/objc++/xcode/framework/xmake.lua (renamed from xmake/templates/objc++/xcode.framework/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/bundle/src/Info.plist (renamed from xmake/templates/objc/xcode.bundle/src/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/bundle/src/test.h (renamed from xmake/templates/objc/xcode.bundle/src/test.h)0
-rw-r--r--xmake/templates/objc/xcode/bundle/src/test.m (renamed from xmake/templates/objc/xcode.bundle/src/test.m)0
-rw-r--r--xmake/templates/objc/xcode/bundle/xmake.lua (renamed from xmake/templates/objc/xcode.bundle/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/framework/src/Info.plist (renamed from xmake/templates/objc/xcode.framework/src/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/framework/src/test.h (renamed from xmake/templates/objc/xcode.framework/src/test.h)0
-rw-r--r--xmake/templates/objc/xcode/framework/src/test.m (renamed from xmake/templates/objc/xcode.framework/src/test.m)0
-rw-r--r--xmake/templates/objc/xcode/framework/xmake.lua (renamed from xmake/templates/objc/xcode.framework/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/AppDelegate.h (renamed from xmake/templates/objc/xcode.iosapp/src/AppDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/AppDelegate.m (renamed from xmake/templates/objc/xcode.iosapp/src/AppDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json (renamed from xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json (renamed from xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard (renamed from xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard (renamed from xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/Info.plist (renamed from xmake/templates/objc/xcode.iosapp/src/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h (renamed from xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m (renamed from xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/ViewController.h (renamed from xmake/templates/objc/xcode.iosapp/src/ViewController.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/ViewController.m (renamed from xmake/templates/objc/xcode.iosapp/src/ViewController.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/src/main.m (renamed from xmake/templates/objc/xcode.iosapp/src/main.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp/xmake.lua (renamed from xmake/templates/objc/xcode.iosapp/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/app/main.m (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.h (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.m (renamed from xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m)0
-rw-r--r--xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua (renamed from xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/AppDelegate.h (renamed from xmake/templates/objc/xcode.macapp/src/AppDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/AppDelegate.m (renamed from xmake/templates/objc/xcode.macapp/src/AppDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json (renamed from xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json (renamed from xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard (renamed from xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/Info.plist (renamed from xmake/templates/objc/xcode.macapp/src/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/ViewController.h (renamed from xmake/templates/objc/xcode.macapp/src/ViewController.h)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/ViewController.m (renamed from xmake/templates/objc/xcode.macapp/src/ViewController.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/main.m (renamed from xmake/templates/objc/xcode.macapp/src/main.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp/src/test.entitlements (renamed from xmake/templates/objc/xcode.macapp/src/test.entitlements)0
-rw-r--r--xmake/templates/objc/xcode/macapp/xmake.lua (renamed from xmake/templates/objc/xcode.macapp/xmake.lua)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/Info.plist (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/main.m (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.h (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.m (renamed from xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m)0
-rw-r--r--xmake/templates/objc/xcode/macapp_with_framework/xmake.lua (renamed from xmake/templates/objc/xcode.macapp_with_framework/xmake.lua)0
128 files changed, 44 insertions, 14 deletions
diff --git a/xmake/actions/create/template.lua b/xmake/actions/create/template.lua
index 3162f30b2..701786c48 100644
--- a/xmake/actions/create/template.lua
+++ b/xmake/actions/create/template.lua
@@ -44,13 +44,29 @@ function rootdirs()
end
-- get template root directory
+function _templateid_subdir(templateid)
+ local items = templateid:split(".", {plain = true})
+ if not items or #items == 0 then
+ return
+ end
+ for _, item in ipairs(items) do
+ if #item == 0 then
+ return
+ end
+ end
+ return path.join(table.unpack(items))
+end
+
function templatedir(lang, templateid)
assert(lang)
assert(templateid)
for _, rootdir in ipairs(rootdirs()) do
- local dir = path.join(rootdir, lang, templateid)
- if os.isdir(dir) then
- return dir
+ local subdir = _templateid_subdir(templateid)
+ if subdir then
+ local dir = path.join(rootdir, lang, subdir)
+ if os.isfile(path.join(dir, "xmake.lua")) then
+ return dir
+ end
end
end
end
@@ -122,12 +138,29 @@ function templates(lang)
local found = hashset.new()
for _, rootdir in ipairs(rootdirs()) do
local templateroot = path.join(rootdir, lang)
- local templatedirs = os.dirs(path.join(templateroot, "*"))
- if templatedirs then
- for _, templatedir in ipairs(templatedirs) do
- if os.isfile(path.join(templatedir, "xmake.lua")) then
- local name = path.filename(templatedir)
- found:insert(name)
+ local configfiles = os.files(path.join(templateroot, "**", "xmake.lua"))
+ if configfiles then
+ local templatedirs = {}
+ for _, configfile in ipairs(configfiles) do
+ local templatedir = path.directory(configfile)
+ local relpath = path.relative(templatedir, templateroot)
+ if relpath and relpath ~= "." then
+ table.insert(templatedirs, {dir = templatedir, relpath = relpath})
+ end
+ end
+ table.sort(templatedirs, function(a, b) return #a.relpath < #b.relpath end)
+ local accepted = {}
+ for _, item in ipairs(templatedirs) do
+ local ok = true
+ for _, root in ipairs(accepted) do
+ if item.dir:startswith(root .. path.sep()) then
+ ok = false
+ break
+ end
+ end
+ if ok then
+ table.insert(accepted, item.dir)
+ found:insert((item.relpath:gsub("[/\\]", ".")))
end
end
end
@@ -141,11 +174,8 @@ end
function languages_for_template(templateid)
local accepted = {}
for _, lang in ipairs(languages()) do
- for _, rootdir in ipairs(rootdirs()) do
- if os.isdir(path.join(rootdir, lang, templateid)) then
- table.insert(accepted, lang)
- break
- end
+ if templatedir(lang, templateid) then
+ table.insert(accepted, lang)
end
end
return accepted
diff --git a/xmake/templates/c++/module.binary/.gitignore b/xmake/templates/c++/module/binary/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c++/module.binary/.gitignore
+++ b/xmake/templates/c++/module/binary/.gitignore
diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore
+++ b/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore
diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp b/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp
index 93fdf0ad8..93fdf0ad8 100644
--- a/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp
+++ b/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp
diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp b/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp
index ae7b6d1f2..ae7b6d1f2 100644
--- a/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp
+++ b/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp
diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua
index add3c6e97..add3c6e97 100644
--- a/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua
+++ b/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua
diff --git a/xmake/templates/c++/module.binary/src/main.cpp b/xmake/templates/c++/module/binary/src/main.cpp
index 9b6abffea..9b6abffea 100644
--- a/xmake/templates/c++/module.binary/src/main.cpp
+++ b/xmake/templates/c++/module/binary/src/main.cpp
diff --git a/xmake/templates/c++/module.binary/xmake.lua b/xmake/templates/c++/module/binary/xmake.lua
index d73d457d3..d73d457d3 100644
--- a/xmake/templates/c++/module.binary/xmake.lua
+++ b/xmake/templates/c++/module/binary/xmake.lua
diff --git a/xmake/templates/c++/module.shared/.gitignore b/xmake/templates/c++/module/shared/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c++/module.shared/.gitignore
+++ b/xmake/templates/c++/module/shared/.gitignore
diff --git a/xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp
index adde214ca..adde214ca 100644
--- a/xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp
+++ b/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp
diff --git a/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua
index 9b3423d41..9b3423d41 100644
--- a/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua
+++ b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua
diff --git a/xmake/templates/c++/module.shared/src/main.cpp b/xmake/templates/c++/module/shared/src/main.cpp
index 9b6abffea..9b6abffea 100644
--- a/xmake/templates/c++/module.shared/src/main.cpp
+++ b/xmake/templates/c++/module/shared/src/main.cpp
diff --git a/xmake/templates/c++/module.shared/xmake.lua b/xmake/templates/c++/module/shared/xmake.lua
index 43aafe904..43aafe904 100644
--- a/xmake/templates/c++/module.shared/xmake.lua
+++ b/xmake/templates/c++/module/shared/xmake.lua
diff --git a/xmake/templates/c++/qt.console/src/main.cpp b/xmake/templates/c++/qt/console/src/main.cpp
index e876eea4f..e876eea4f 100644
--- a/xmake/templates/c++/qt.console/src/main.cpp
+++ b/xmake/templates/c++/qt/console/src/main.cpp
diff --git a/xmake/templates/c++/qt.console/xmake.lua b/xmake/templates/c++/qt/console/xmake.lua
index 2ce5aa993..2ce5aa993 100644
--- a/xmake/templates/c++/qt.console/xmake.lua
+++ b/xmake/templates/c++/qt/console/xmake.lua
diff --git a/xmake/templates/c++/qt.quickapp/src/main.cpp b/xmake/templates/c++/qt/quickapp/src/main.cpp
index 7d9cb80df..7d9cb80df 100644
--- a/xmake/templates/c++/qt.quickapp/src/main.cpp
+++ b/xmake/templates/c++/qt/quickapp/src/main.cpp
diff --git a/xmake/templates/c++/qt.quickapp/src/main.qml b/xmake/templates/c++/qt/quickapp/src/main.qml
index 120cdbddd..120cdbddd 100644
--- a/xmake/templates/c++/qt.quickapp/src/main.qml
+++ b/xmake/templates/c++/qt/quickapp/src/main.qml
diff --git a/xmake/templates/c++/qt.quickapp/src/qml.qrc b/xmake/templates/c++/qt/quickapp/src/qml.qrc
index 5f6483ac3..5f6483ac3 100644
--- a/xmake/templates/c++/qt.quickapp/src/qml.qrc
+++ b/xmake/templates/c++/qt/quickapp/src/qml.qrc
diff --git a/xmake/templates/c++/qt.quickapp/xmake.lua b/xmake/templates/c++/qt/quickapp/xmake.lua
index 3f71d1c15..3f71d1c15 100644
--- a/xmake/templates/c++/qt.quickapp/xmake.lua
+++ b/xmake/templates/c++/qt/quickapp/xmake.lua
diff --git a/xmake/templates/c++/qt.quickapp_static/src/main.cpp b/xmake/templates/c++/qt/quickapp_static/src/main.cpp
index 7d9cb80df..7d9cb80df 100644
--- a/xmake/templates/c++/qt.quickapp_static/src/main.cpp
+++ b/xmake/templates/c++/qt/quickapp_static/src/main.cpp
diff --git a/xmake/templates/c++/qt.quickapp_static/src/main.qml b/xmake/templates/c++/qt/quickapp_static/src/main.qml
index 120cdbddd..120cdbddd 100644
--- a/xmake/templates/c++/qt.quickapp_static/src/main.qml
+++ b/xmake/templates/c++/qt/quickapp_static/src/main.qml
diff --git a/xmake/templates/c++/qt.quickapp_static/src/qml.qrc b/xmake/templates/c++/qt/quickapp_static/src/qml.qrc
index 5f6483ac3..5f6483ac3 100644
--- a/xmake/templates/c++/qt.quickapp_static/src/qml.qrc
+++ b/xmake/templates/c++/qt/quickapp_static/src/qml.qrc
diff --git a/xmake/templates/c++/qt.quickapp_static/xmake.lua b/xmake/templates/c++/qt/quickapp_static/xmake.lua
index 0d311a762..0d311a762 100644
--- a/xmake/templates/c++/qt.quickapp_static/xmake.lua
+++ b/xmake/templates/c++/qt/quickapp_static/xmake.lua
diff --git a/xmake/templates/c++/qt.shared/src/demo.cpp b/xmake/templates/c++/qt/shared/src/demo.cpp
index 576c861f0..576c861f0 100644
--- a/xmake/templates/c++/qt.shared/src/demo.cpp
+++ b/xmake/templates/c++/qt/shared/src/demo.cpp
diff --git a/xmake/templates/c++/qt.shared/src/demo.h b/xmake/templates/c++/qt/shared/src/demo.h
index 89f29ec46..89f29ec46 100644
--- a/xmake/templates/c++/qt.shared/src/demo.h
+++ b/xmake/templates/c++/qt/shared/src/demo.h
diff --git a/xmake/templates/c++/qt.shared/src/demo_global.h b/xmake/templates/c++/qt/shared/src/demo_global.h
index d6b1ddf0b..d6b1ddf0b 100644
--- a/xmake/templates/c++/qt.shared/src/demo_global.h
+++ b/xmake/templates/c++/qt/shared/src/demo_global.h
diff --git a/xmake/templates/c++/qt.shared/xmake.lua b/xmake/templates/c++/qt/shared/xmake.lua
index 3b07153b9..3b07153b9 100644
--- a/xmake/templates/c++/qt.shared/xmake.lua
+++ b/xmake/templates/c++/qt/shared/xmake.lua
diff --git a/xmake/templates/c++/qt.static/src/demo.cpp b/xmake/templates/c++/qt/static/src/demo.cpp
index 576c861f0..576c861f0 100644
--- a/xmake/templates/c++/qt.static/src/demo.cpp
+++ b/xmake/templates/c++/qt/static/src/demo.cpp
diff --git a/xmake/templates/c++/qt.static/src/demo.h b/xmake/templates/c++/qt/static/src/demo.h
index 24730c9d8..24730c9d8 100644
--- a/xmake/templates/c++/qt.static/src/demo.h
+++ b/xmake/templates/c++/qt/static/src/demo.h
diff --git a/xmake/templates/c++/qt.static/xmake.lua b/xmake/templates/c++/qt/static/xmake.lua
index 371bdf082..371bdf082 100644
--- a/xmake/templates/c++/qt.static/xmake.lua
+++ b/xmake/templates/c++/qt/static/xmake.lua
diff --git a/xmake/templates/c++/qt.widgetapp/src/main.cpp b/xmake/templates/c++/qt/widgetapp/src/main.cpp
index 191ae18d2..191ae18d2 100644
--- a/xmake/templates/c++/qt.widgetapp/src/main.cpp
+++ b/xmake/templates/c++/qt/widgetapp/src/main.cpp
diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp
index c9c6a0d98..c9c6a0d98 100644
--- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp
+++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp
diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp/src/mainwindow.h
index a4245aa42..a4245aa42 100644
--- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.h
+++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.h
diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui
index 1c59b695e..1c59b695e 100644
--- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui
+++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui
diff --git a/xmake/templates/c++/qt.widgetapp/xmake.lua b/xmake/templates/c++/qt/widgetapp/xmake.lua
index e0f9f455e..e0f9f455e 100644
--- a/xmake/templates/c++/qt.widgetapp/xmake.lua
+++ b/xmake/templates/c++/qt/widgetapp/xmake.lua
diff --git a/xmake/templates/c++/qt.widgetapp_static/src/main.cpp b/xmake/templates/c++/qt/widgetapp_static/src/main.cpp
index db5b0cce8..db5b0cce8 100644
--- a/xmake/templates/c++/qt.widgetapp_static/src/main.cpp
+++ b/xmake/templates/c++/qt/widgetapp_static/src/main.cpp
diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp
index c9c6a0d98..c9c6a0d98 100644
--- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp
+++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp
diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h
index a4245aa42..a4245aa42 100644
--- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h
+++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h
diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui
index 1c59b695e..1c59b695e 100644
--- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui
+++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui
diff --git a/xmake/templates/c++/qt.widgetapp_static/xmake.lua b/xmake/templates/c++/qt/widgetapp_static/xmake.lua
index 2c357e531..2c357e531 100644
--- a/xmake/templates/c++/qt.widgetapp_static/xmake.lua
+++ b/xmake/templates/c++/qt/widgetapp_static/xmake.lua
diff --git a/xmake/templates/c++/xmake.cli/src/lni/main.cpp b/xmake/templates/c++/xmake/cli/src/lni/main.cpp
index 3de2b1e36..3de2b1e36 100644
--- a/xmake/templates/c++/xmake.cli/src/lni/main.cpp
+++ b/xmake/templates/c++/xmake/cli/src/lni/main.cpp
diff --git a/xmake/templates/c++/xmake.cli/src/lua/main.lua b/xmake/templates/c++/xmake/cli/src/lua/main.lua
index d87daf102..d87daf102 100644
--- a/xmake/templates/c++/xmake.cli/src/lua/main.lua
+++ b/xmake/templates/c++/xmake/cli/src/lua/main.lua
diff --git a/xmake/templates/c++/xmake.cli/xmake.lua b/xmake/templates/c++/xmake/cli/xmake.lua
index cf1987c60..cf1987c60 100644
--- a/xmake/templates/c++/xmake.cli/xmake.lua
+++ b/xmake/templates/c++/xmake/cli/xmake.lua
diff --git a/xmake/templates/c/module.binary/.gitignore b/xmake/templates/c/module/binary/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c/module.binary/.gitignore
+++ b/xmake/templates/c/module/binary/.gitignore
diff --git a/xmake/templates/c/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c/module/binary/modules/binary/bar/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c/module.binary/modules/binary/bar/.gitignore
+++ b/xmake/templates/c/module/binary/modules/binary/bar/.gitignore
diff --git a/xmake/templates/c/module.binary/modules/binary/bar/src/add.c b/xmake/templates/c/module/binary/modules/binary/bar/src/add.c
index 93fdf0ad8..93fdf0ad8 100644
--- a/xmake/templates/c/module.binary/modules/binary/bar/src/add.c
+++ b/xmake/templates/c/module/binary/modules/binary/bar/src/add.c
diff --git a/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c b/xmake/templates/c/module/binary/modules/binary/bar/src/sub.c
index ae7b6d1f2..ae7b6d1f2 100644
--- a/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c
+++ b/xmake/templates/c/module/binary/modules/binary/bar/src/sub.c
diff --git a/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c/module/binary/modules/binary/bar/xmake.lua
index d4983d741..d4983d741 100644
--- a/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua
+++ b/xmake/templates/c/module/binary/modules/binary/bar/xmake.lua
diff --git a/xmake/templates/c/module.binary/src/main.c b/xmake/templates/c/module/binary/src/main.c
index ccf4b2a77..ccf4b2a77 100644
--- a/xmake/templates/c/module.binary/src/main.c
+++ b/xmake/templates/c/module/binary/src/main.c
diff --git a/xmake/templates/c/module.binary/xmake.lua b/xmake/templates/c/module/binary/xmake.lua
index 7df556cb8..7df556cb8 100644
--- a/xmake/templates/c/module.binary/xmake.lua
+++ b/xmake/templates/c/module/binary/xmake.lua
diff --git a/xmake/templates/c/module.shared/.gitignore b/xmake/templates/c/module/shared/.gitignore
index 152105761..152105761 100644
--- a/xmake/templates/c/module.shared/.gitignore
+++ b/xmake/templates/c/module/shared/.gitignore
diff --git a/xmake/templates/c/module.shared/modules/shared/foo/src/foo.c b/xmake/templates/c/module/shared/modules/shared/foo/src/foo.c
index adde214ca..adde214ca 100644
--- a/xmake/templates/c/module.shared/modules/shared/foo/src/foo.c
+++ b/xmake/templates/c/module/shared/modules/shared/foo/src/foo.c
diff --git a/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c/module/shared/modules/shared/foo/xmake.lua
index 035573d9f..035573d9f 100644
--- a/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua
+++ b/xmake/templates/c/module/shared/modules/shared/foo/xmake.lua
diff --git a/xmake/templates/c/module.shared/src/main.c b/xmake/templates/c/module/shared/src/main.c
index ccf4b2a77..ccf4b2a77 100644
--- a/xmake/templates/c/module.shared/src/main.c
+++ b/xmake/templates/c/module/shared/src/main.c
diff --git a/xmake/templates/c/module.shared/xmake.lua b/xmake/templates/c/module/shared/xmake.lua
index 4b92b0b9e..4b92b0b9e 100644
--- a/xmake/templates/c/module.shared/xmake.lua
+++ b/xmake/templates/c/module/shared/xmake.lua
diff --git a/xmake/templates/c/xmake.cli/src/lni/main.c b/xmake/templates/c/xmake/cli/src/lni/main.c
index 1ef27cd75..1ef27cd75 100644
--- a/xmake/templates/c/xmake.cli/src/lni/main.c
+++ b/xmake/templates/c/xmake/cli/src/lni/main.c
diff --git a/xmake/templates/c/xmake.cli/src/lua/main.lua b/xmake/templates/c/xmake/cli/src/lua/main.lua
index d87daf102..d87daf102 100644
--- a/xmake/templates/c/xmake.cli/src/lua/main.lua
+++ b/xmake/templates/c/xmake/cli/src/lua/main.lua
diff --git a/xmake/templates/c/xmake.cli/xmake.lua b/xmake/templates/c/xmake/cli/xmake.lua
index 33422b5c0..33422b5c0 100644
--- a/xmake/templates/c/xmake.cli/xmake.lua
+++ b/xmake/templates/c/xmake/cli/xmake.lua
diff --git a/xmake/templates/objc++/xcode.bundle/src/Info.plist b/xmake/templates/objc++/xcode/bundle/src/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc++/xcode.bundle/src/Info.plist
+++ b/xmake/templates/objc++/xcode/bundle/src/Info.plist
diff --git a/xmake/templates/objc++/xcode.bundle/src/test.h b/xmake/templates/objc++/xcode/bundle/src/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc++/xcode.bundle/src/test.h
+++ b/xmake/templates/objc++/xcode/bundle/src/test.h
diff --git a/xmake/templates/objc++/xcode.bundle/src/test.mm b/xmake/templates/objc++/xcode/bundle/src/test.mm
index 20e29bd0a..20e29bd0a 100644
--- a/xmake/templates/objc++/xcode.bundle/src/test.mm
+++ b/xmake/templates/objc++/xcode/bundle/src/test.mm
diff --git a/xmake/templates/objc++/xcode.bundle/xmake.lua b/xmake/templates/objc++/xcode/bundle/xmake.lua
index 1ecf69fcb..1ecf69fcb 100644
--- a/xmake/templates/objc++/xcode.bundle/xmake.lua
+++ b/xmake/templates/objc++/xcode/bundle/xmake.lua
diff --git a/xmake/templates/objc++/xcode.framework/src/Info.plist b/xmake/templates/objc++/xcode/framework/src/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc++/xcode.framework/src/Info.plist
+++ b/xmake/templates/objc++/xcode/framework/src/Info.plist
diff --git a/xmake/templates/objc++/xcode.framework/src/test.h b/xmake/templates/objc++/xcode/framework/src/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc++/xcode.framework/src/test.h
+++ b/xmake/templates/objc++/xcode/framework/src/test.h
diff --git a/xmake/templates/objc++/xcode.framework/src/test.mm b/xmake/templates/objc++/xcode/framework/src/test.mm
index 20e29bd0a..20e29bd0a 100644
--- a/xmake/templates/objc++/xcode.framework/src/test.mm
+++ b/xmake/templates/objc++/xcode/framework/src/test.mm
diff --git a/xmake/templates/objc++/xcode.framework/xmake.lua b/xmake/templates/objc++/xcode/framework/xmake.lua
index 3805d95c6..3805d95c6 100644
--- a/xmake/templates/objc++/xcode.framework/xmake.lua
+++ b/xmake/templates/objc++/xcode/framework/xmake.lua
diff --git a/xmake/templates/objc/xcode.bundle/src/Info.plist b/xmake/templates/objc/xcode/bundle/src/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc/xcode.bundle/src/Info.plist
+++ b/xmake/templates/objc/xcode/bundle/src/Info.plist
diff --git a/xmake/templates/objc/xcode.bundle/src/test.h b/xmake/templates/objc/xcode/bundle/src/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc/xcode.bundle/src/test.h
+++ b/xmake/templates/objc/xcode/bundle/src/test.h
diff --git a/xmake/templates/objc/xcode.bundle/src/test.m b/xmake/templates/objc/xcode/bundle/src/test.m
index 20e29bd0a..20e29bd0a 100644
--- a/xmake/templates/objc/xcode.bundle/src/test.m
+++ b/xmake/templates/objc/xcode/bundle/src/test.m
diff --git a/xmake/templates/objc/xcode.bundle/xmake.lua b/xmake/templates/objc/xcode/bundle/xmake.lua
index 34d108fcb..34d108fcb 100644
--- a/xmake/templates/objc/xcode.bundle/xmake.lua
+++ b/xmake/templates/objc/xcode/bundle/xmake.lua
diff --git a/xmake/templates/objc/xcode.framework/src/Info.plist b/xmake/templates/objc/xcode/framework/src/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc/xcode.framework/src/Info.plist
+++ b/xmake/templates/objc/xcode/framework/src/Info.plist
diff --git a/xmake/templates/objc/xcode.framework/src/test.h b/xmake/templates/objc/xcode/framework/src/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc/xcode.framework/src/test.h
+++ b/xmake/templates/objc/xcode/framework/src/test.h
diff --git a/xmake/templates/objc/xcode.framework/src/test.m b/xmake/templates/objc/xcode/framework/src/test.m
index 20e29bd0a..20e29bd0a 100644
--- a/xmake/templates/objc/xcode.framework/src/test.m
+++ b/xmake/templates/objc/xcode/framework/src/test.m
diff --git a/xmake/templates/objc/xcode.framework/xmake.lua b/xmake/templates/objc/xcode/framework/xmake.lua
index 83ddfa1a2..83ddfa1a2 100644
--- a/xmake/templates/objc/xcode.framework/xmake.lua
+++ b/xmake/templates/objc/xcode/framework/xmake.lua
diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h
index b01a8dc72..b01a8dc72 100644
--- a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h
+++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h
diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m
index 0ad500bfe..0ad500bfe 100644
--- a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m
+++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m
diff --git a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
index d8db8d65f..d8db8d65f 100644
--- a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json
index da4a164c9..da4a164c9 100644
--- a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json
+++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json
diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard
index 865e9329f..865e9329f 100644
--- a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard
+++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard
diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard
index 808a21ce7..808a21ce7 100644
--- a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard
+++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard
diff --git a/xmake/templates/objc/xcode.iosapp/src/Info.plist b/xmake/templates/objc/xcode/iosapp/src/Info.plist
index 686d21a3a..686d21a3a 100644
--- a/xmake/templates/objc/xcode.iosapp/src/Info.plist
+++ b/xmake/templates/objc/xcode/iosapp/src/Info.plist
diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h
index 5dbf88aa6..5dbf88aa6 100644
--- a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h
+++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h
diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m
index d6698dd7c..d6698dd7c 100644
--- a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m
+++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m
diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.h b/xmake/templates/objc/xcode/iosapp/src/ViewController.h
index e74d2f236..e74d2f236 100644
--- a/xmake/templates/objc/xcode.iosapp/src/ViewController.h
+++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.h
diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.m b/xmake/templates/objc/xcode/iosapp/src/ViewController.m
index c3441c87a..c3441c87a 100644
--- a/xmake/templates/objc/xcode.iosapp/src/ViewController.m
+++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.m
diff --git a/xmake/templates/objc/xcode.iosapp/src/main.m b/xmake/templates/objc/xcode/iosapp/src/main.m
index 11a58afc7..11a58afc7 100644
--- a/xmake/templates/objc/xcode.iosapp/src/main.m
+++ b/xmake/templates/objc/xcode/iosapp/src/main.m
diff --git a/xmake/templates/objc/xcode.iosapp/xmake.lua b/xmake/templates/objc/xcode/iosapp/xmake.lua
index 1306fce94..1306fce94 100644
--- a/xmake/templates/objc/xcode.iosapp/xmake.lua
+++ b/xmake/templates/objc/xcode/iosapp/xmake.lua
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h
index b01a8dc72..b01a8dc72 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m
index 1f3556c06..1f3556c06 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
index d8db8d65f..d8db8d65f 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json
index da4a164c9..da4a164c9 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard
index 865e9329f..865e9329f 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard
index 808a21ce7..808a21ce7 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist
index 686d21a3a..686d21a3a 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h
index 5dbf88aa6..5dbf88aa6 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m
index d6698dd7c..d6698dd7c 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h
index e74d2f236..e74d2f236 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m
index c3441c87a..c3441c87a 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/main.m
index 11a58afc7..11a58afc7 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/main.m
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.h
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.m
index 71214544b..71214544b 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.m
diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua b/xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua
index e1383b8b2..e1383b8b2 100644
--- a/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua
+++ b/xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua
diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.h b/xmake/templates/objc/xcode/macapp/src/AppDelegate.h
index 5f5ba059e..5f5ba059e 100644
--- a/xmake/templates/objc/xcode.macapp/src/AppDelegate.h
+++ b/xmake/templates/objc/xcode/macapp/src/AppDelegate.h
diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.m b/xmake/templates/objc/xcode/macapp/src/AppDelegate.m
index da967d2ef..da967d2ef 100644
--- a/xmake/templates/objc/xcode.macapp/src/AppDelegate.m
+++ b/xmake/templates/objc/xcode/macapp/src/AppDelegate.m
diff --git a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
index 2db2b1c7c..2db2b1c7c 100644
--- a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json
index da4a164c9..da4a164c9 100644
--- a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json
+++ b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json
diff --git a/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard
index 7a6d659a5..7a6d659a5 100644
--- a/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard
+++ b/xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard
diff --git a/xmake/templates/objc/xcode.macapp/src/Info.plist b/xmake/templates/objc/xcode/macapp/src/Info.plist
index ce53d780c..ce53d780c 100644
--- a/xmake/templates/objc/xcode.macapp/src/Info.plist
+++ b/xmake/templates/objc/xcode/macapp/src/Info.plist
diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.h b/xmake/templates/objc/xcode/macapp/src/ViewController.h
index a974fc934..a974fc934 100644
--- a/xmake/templates/objc/xcode.macapp/src/ViewController.h
+++ b/xmake/templates/objc/xcode/macapp/src/ViewController.h
diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.m b/xmake/templates/objc/xcode/macapp/src/ViewController.m
index bccdf6189..bccdf6189 100644
--- a/xmake/templates/objc/xcode.macapp/src/ViewController.m
+++ b/xmake/templates/objc/xcode/macapp/src/ViewController.m
diff --git a/xmake/templates/objc/xcode.macapp/src/main.m b/xmake/templates/objc/xcode/macapp/src/main.m
index ae3706f51..ae3706f51 100644
--- a/xmake/templates/objc/xcode.macapp/src/main.m
+++ b/xmake/templates/objc/xcode/macapp/src/main.m
diff --git a/xmake/templates/objc/xcode.macapp/src/test.entitlements b/xmake/templates/objc/xcode/macapp/src/test.entitlements
index f2ef3ae02..f2ef3ae02 100644
--- a/xmake/templates/objc/xcode.macapp/src/test.entitlements
+++ b/xmake/templates/objc/xcode/macapp/src/test.entitlements
diff --git a/xmake/templates/objc/xcode.macapp/xmake.lua b/xmake/templates/objc/xcode/macapp/xmake.lua
index 1306fce94..1306fce94 100644
--- a/xmake/templates/objc/xcode.macapp/xmake.lua
+++ b/xmake/templates/objc/xcode/macapp/xmake.lua
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h
index 5f5ba059e..5f5ba059e 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m
index 667420c8c..667420c8c 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
index 2db2b1c7c..2db2b1c7c 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json
index da4a164c9..da4a164c9 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard
index 7a6d659a5..7a6d659a5 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Info.plist
index ce53d780c..ce53d780c 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Info.plist
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h
index a974fc934..a974fc934 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m
index bccdf6189..bccdf6189 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m b/xmake/templates/objc/xcode/macapp_with_framework/src/app/main.m
index ae3706f51..ae3706f51 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/main.m
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements b/xmake/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements
index f2ef3ae02..f2ef3ae02 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist
index 20608314e..20608314e 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.h
index d882546d1..d882546d1 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.h
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.m
index 71214544b..71214544b 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m
+++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.m
diff --git a/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua b/xmake/templates/objc/xcode/macapp_with_framework/xmake.lua
index e1383b8b2..e1383b8b2 100644
--- a/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua
+++ b/xmake/templates/objc/xcode/macapp_with_framework/xmake.lua