From b01dcb775c98cc48abe65a91ef9bf093be875682 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 2 Mar 2026 23:52:25 +0800 Subject: improve template dirs --- xmake/actions/create/template.lua | 58 +- xmake/templates/c++/module.binary/.gitignore | 8 - .../module.binary/modules/binary/bar/.gitignore | 8 - .../module.binary/modules/binary/bar/src/add.cpp | 9 - .../module.binary/modules/binary/bar/src/sub.cpp | 9 - .../c++/module.binary/modules/binary/bar/xmake.lua | 10 - xmake/templates/c++/module.binary/src/main.cpp | 6 - xmake/templates/c++/module.binary/xmake.lua | 15 - xmake/templates/c++/module.shared/.gitignore | 8 - .../module.shared/modules/shared/foo/src/foo.cpp | 22 - .../c++/module.shared/modules/shared/foo/xmake.lua | 6 - xmake/templates/c++/module.shared/src/main.cpp | 6 - xmake/templates/c++/module.shared/xmake.lua | 15 - xmake/templates/c++/module/binary/.gitignore | 8 + .../module/binary/modules/binary/bar/.gitignore | 8 + .../module/binary/modules/binary/bar/src/add.cpp | 9 + .../module/binary/modules/binary/bar/src/sub.cpp | 9 + .../c++/module/binary/modules/binary/bar/xmake.lua | 10 + xmake/templates/c++/module/binary/src/main.cpp | 6 + xmake/templates/c++/module/binary/xmake.lua | 15 + xmake/templates/c++/module/shared/.gitignore | 8 + .../module/shared/modules/shared/foo/src/foo.cpp | 22 + .../c++/module/shared/modules/shared/foo/xmake.lua | 6 + xmake/templates/c++/module/shared/src/main.cpp | 6 + xmake/templates/c++/module/shared/xmake.lua | 15 + xmake/templates/c++/qt.console/src/main.cpp | 7 - xmake/templates/c++/qt.console/xmake.lua | 7 - xmake/templates/c++/qt.quickapp/src/main.cpp | 17 - xmake/templates/c++/qt.quickapp/src/main.qml | 18 - xmake/templates/c++/qt.quickapp/src/qml.qrc | 5 - xmake/templates/c++/qt.quickapp/xmake.lua | 9 - .../templates/c++/qt.quickapp_static/src/main.cpp | 17 - .../templates/c++/qt.quickapp_static/src/main.qml | 18 - xmake/templates/c++/qt.quickapp_static/src/qml.qrc | 5 - xmake/templates/c++/qt.quickapp_static/xmake.lua | 16 - xmake/templates/c++/qt.shared/src/demo.cpp | 4 - xmake/templates/c++/qt.shared/src/demo.h | 11 - xmake/templates/c++/qt.shared/src/demo_global.h | 12 - xmake/templates/c++/qt.shared/xmake.lua | 10 - xmake/templates/c++/qt.static/src/demo.cpp | 4 - xmake/templates/c++/qt.static/src/demo.h | 9 - xmake/templates/c++/qt.static/xmake.lua | 9 - xmake/templates/c++/qt.widgetapp/src/main.cpp | 9 - .../templates/c++/qt.widgetapp/src/mainwindow.cpp | 10 - xmake/templates/c++/qt.widgetapp/src/mainwindow.h | 21 - xmake/templates/c++/qt.widgetapp/src/mainwindow.ui | 24 - xmake/templates/c++/qt.widgetapp/xmake.lua | 11 - .../templates/c++/qt.widgetapp_static/src/main.cpp | 10 - .../c++/qt.widgetapp_static/src/mainwindow.cpp | 10 - .../c++/qt.widgetapp_static/src/mainwindow.h | 21 - .../c++/qt.widgetapp_static/src/mainwindow.ui | 24 - xmake/templates/c++/qt.widgetapp_static/xmake.lua | 18 - xmake/templates/c++/qt/console/src/main.cpp | 7 + xmake/templates/c++/qt/console/xmake.lua | 7 + xmake/templates/c++/qt/quickapp/src/main.cpp | 17 + xmake/templates/c++/qt/quickapp/src/main.qml | 18 + xmake/templates/c++/qt/quickapp/src/qml.qrc | 5 + xmake/templates/c++/qt/quickapp/xmake.lua | 9 + .../templates/c++/qt/quickapp_static/src/main.cpp | 17 + .../templates/c++/qt/quickapp_static/src/main.qml | 18 + xmake/templates/c++/qt/quickapp_static/src/qml.qrc | 5 + xmake/templates/c++/qt/quickapp_static/xmake.lua | 16 + xmake/templates/c++/qt/shared/src/demo.cpp | 4 + xmake/templates/c++/qt/shared/src/demo.h | 11 + xmake/templates/c++/qt/shared/src/demo_global.h | 12 + xmake/templates/c++/qt/shared/xmake.lua | 10 + xmake/templates/c++/qt/static/src/demo.cpp | 4 + xmake/templates/c++/qt/static/src/demo.h | 9 + xmake/templates/c++/qt/static/xmake.lua | 9 + xmake/templates/c++/qt/widgetapp/src/main.cpp | 9 + .../templates/c++/qt/widgetapp/src/mainwindow.cpp | 10 + xmake/templates/c++/qt/widgetapp/src/mainwindow.h | 21 + xmake/templates/c++/qt/widgetapp/src/mainwindow.ui | 24 + xmake/templates/c++/qt/widgetapp/xmake.lua | 11 + .../templates/c++/qt/widgetapp_static/src/main.cpp | 10 + .../c++/qt/widgetapp_static/src/mainwindow.cpp | 10 + .../c++/qt/widgetapp_static/src/mainwindow.h | 21 + .../c++/qt/widgetapp_static/src/mainwindow.ui | 24 + xmake/templates/c++/qt/widgetapp_static/xmake.lua | 18 + xmake/templates/c++/xmake.cli/src/lni/main.cpp | 23 - xmake/templates/c++/xmake.cli/src/lua/main.lua | 10 - xmake/templates/c++/xmake.cli/xmake.lua | 12 - xmake/templates/c++/xmake/cli/src/lni/main.cpp | 23 + xmake/templates/c++/xmake/cli/src/lua/main.lua | 10 + xmake/templates/c++/xmake/cli/xmake.lua | 12 + xmake/templates/c/module.binary/.gitignore | 8 - .../c/module.binary/modules/binary/bar/.gitignore | 8 - .../c/module.binary/modules/binary/bar/src/add.c | 9 - .../c/module.binary/modules/binary/bar/src/sub.c | 9 - .../c/module.binary/modules/binary/bar/xmake.lua | 10 - xmake/templates/c/module.binary/src/main.c | 6 - xmake/templates/c/module.binary/xmake.lua | 15 - xmake/templates/c/module.shared/.gitignore | 8 - .../c/module.shared/modules/shared/foo/src/foo.c | 22 - .../c/module.shared/modules/shared/foo/xmake.lua | 6 - xmake/templates/c/module.shared/src/main.c | 6 - xmake/templates/c/module.shared/xmake.lua | 15 - xmake/templates/c/module/binary/.gitignore | 8 + .../c/module/binary/modules/binary/bar/.gitignore | 8 + .../c/module/binary/modules/binary/bar/src/add.c | 9 + .../c/module/binary/modules/binary/bar/src/sub.c | 9 + .../c/module/binary/modules/binary/bar/xmake.lua | 10 + xmake/templates/c/module/binary/src/main.c | 6 + xmake/templates/c/module/binary/xmake.lua | 15 + xmake/templates/c/module/shared/.gitignore | 8 + .../c/module/shared/modules/shared/foo/src/foo.c | 22 + .../c/module/shared/modules/shared/foo/xmake.lua | 6 + xmake/templates/c/module/shared/src/main.c | 6 + xmake/templates/c/module/shared/xmake.lua | 15 + xmake/templates/c/xmake.cli/src/lni/main.c | 21 - xmake/templates/c/xmake.cli/src/lua/main.lua | 10 - xmake/templates/c/xmake.cli/xmake.lua | 11 - xmake/templates/c/xmake/cli/src/lni/main.c | 21 + xmake/templates/c/xmake/cli/src/lua/main.lua | 10 + xmake/templates/c/xmake/cli/xmake.lua | 11 + xmake/templates/objc++/xcode.bundle/src/Info.plist | 24 - xmake/templates/objc++/xcode.bundle/src/test.h | 3 - xmake/templates/objc++/xcode.bundle/src/test.mm | 5 - xmake/templates/objc++/xcode.bundle/xmake.lua | 9 - .../objc++/xcode.framework/src/Info.plist | 24 - xmake/templates/objc++/xcode.framework/src/test.h | 3 - xmake/templates/objc++/xcode.framework/src/test.mm | 5 - xmake/templates/objc++/xcode.framework/xmake.lua | 9 - xmake/templates/objc++/xcode/bundle/src/Info.plist | 24 + xmake/templates/objc++/xcode/bundle/src/test.h | 3 + xmake/templates/objc++/xcode/bundle/src/test.mm | 5 + xmake/templates/objc++/xcode/bundle/xmake.lua | 9 + .../objc++/xcode/framework/src/Info.plist | 24 + xmake/templates/objc++/xcode/framework/src/test.h | 3 + xmake/templates/objc++/xcode/framework/src/test.mm | 5 + xmake/templates/objc++/xcode/framework/xmake.lua | 9 + xmake/templates/objc/xcode.bundle/src/Info.plist | 24 - xmake/templates/objc/xcode.bundle/src/test.h | 3 - xmake/templates/objc/xcode.bundle/src/test.m | 5 - xmake/templates/objc/xcode.bundle/xmake.lua | 9 - .../templates/objc/xcode.framework/src/Info.plist | 24 - xmake/templates/objc/xcode.framework/src/test.h | 3 - xmake/templates/objc/xcode.framework/src/test.m | 5 - xmake/templates/objc/xcode.framework/xmake.lua | 9 - .../templates/objc/xcode.iosapp/src/AppDelegate.h | 15 - .../templates/objc/xcode.iosapp/src/AppDelegate.m | 41 -- .../AppIcon.appiconset/Contents.json | 98 --- .../xcode.iosapp/src/Assets.xcassets/Contents.json | 6 - .../src/Base.lproj/LaunchScreen.storyboard | 25 - .../xcode.iosapp/src/Base.lproj/Main.storyboard | 24 - xmake/templates/objc/xcode.iosapp/src/Info.plist | 66 -- .../objc/xcode.iosapp/src/SceneDelegate.h | 16 - .../objc/xcode.iosapp/src/SceneDelegate.m | 50 -- .../objc/xcode.iosapp/src/ViewController.h | 15 - .../objc/xcode.iosapp/src/ViewController.m | 23 - xmake/templates/objc/xcode.iosapp/src/main.m | 19 - xmake/templates/objc/xcode.iosapp/xmake.lua | 6 - .../src/app/AppDelegate.h | 15 - .../src/app/AppDelegate.m | 45 -- .../AppIcon.appiconset/Contents.json | 98 --- .../src/app/Assets.xcassets/Contents.json | 6 - .../src/app/Base.lproj/LaunchScreen.storyboard | 25 - .../src/app/Base.lproj/Main.storyboard | 24 - .../xcode.iosapp_with_framework/src/app/Info.plist | 66 -- .../src/app/SceneDelegate.h | 16 - .../src/app/SceneDelegate.m | 50 -- .../src/app/ViewController.h | 15 - .../src/app/ViewController.m | 23 - .../xcode.iosapp_with_framework/src/app/main.m | 19 - .../src/framework/Info.plist | 24 - .../src/framework/test.h | 3 - .../src/framework/test.m | 9 - .../objc/xcode.iosapp_with_framework/xmake.lua | 13 - .../templates/objc/xcode.macapp/src/AppDelegate.h | 15 - .../templates/objc/xcode.macapp/src/AppDelegate.m | 27 - .../AppIcon.appiconset/Contents.json | 58 -- .../xcode.macapp/src/Assets.xcassets/Contents.json | 6 - .../xcode.macapp/src/Base.lproj/Main.storyboard | 717 --------------------- xmake/templates/objc/xcode.macapp/src/Info.plist | 38 -- .../objc/xcode.macapp/src/ViewController.h | 15 - .../objc/xcode.macapp/src/ViewController.m | 27 - xmake/templates/objc/xcode.macapp/src/main.m | 16 - .../objc/xcode.macapp/src/test.entitlements | 10 - xmake/templates/objc/xcode.macapp/xmake.lua | 6 - .../src/app/AppDelegate.h | 15 - .../src/app/AppDelegate.m | 30 - .../AppIcon.appiconset/Contents.json | 58 -- .../src/app/Assets.xcassets/Contents.json | 6 - .../src/app/Base.lproj/Main.storyboard | 717 --------------------- .../xcode.macapp_with_framework/src/app/Info.plist | 38 -- .../src/app/ViewController.h | 15 - .../src/app/ViewController.m | 27 - .../xcode.macapp_with_framework/src/app/main.m | 16 - .../src/app/test.entitlements | 10 - .../src/framework/Info.plist | 24 - .../src/framework/test.h | 3 - .../src/framework/test.m | 9 - .../objc/xcode.macapp_with_framework/xmake.lua | 13 - xmake/templates/objc/xcode/bundle/src/Info.plist | 24 + xmake/templates/objc/xcode/bundle/src/test.h | 3 + xmake/templates/objc/xcode/bundle/src/test.m | 5 + xmake/templates/objc/xcode/bundle/xmake.lua | 9 + .../templates/objc/xcode/framework/src/Info.plist | 24 + xmake/templates/objc/xcode/framework/src/test.h | 3 + xmake/templates/objc/xcode/framework/src/test.m | 5 + xmake/templates/objc/xcode/framework/xmake.lua | 9 + .../templates/objc/xcode/iosapp/src/AppDelegate.h | 15 + .../templates/objc/xcode/iosapp/src/AppDelegate.m | 41 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../xcode/iosapp/src/Assets.xcassets/Contents.json | 6 + .../iosapp/src/Base.lproj/LaunchScreen.storyboard | 25 + .../xcode/iosapp/src/Base.lproj/Main.storyboard | 24 + xmake/templates/objc/xcode/iosapp/src/Info.plist | 66 ++ .../objc/xcode/iosapp/src/SceneDelegate.h | 16 + .../objc/xcode/iosapp/src/SceneDelegate.m | 50 ++ .../objc/xcode/iosapp/src/ViewController.h | 15 + .../objc/xcode/iosapp/src/ViewController.m | 23 + xmake/templates/objc/xcode/iosapp/src/main.m | 19 + xmake/templates/objc/xcode/iosapp/xmake.lua | 6 + .../iosapp_with_framework/src/app/AppDelegate.h | 15 + .../iosapp_with_framework/src/app/AppDelegate.m | 45 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../src/app/Assets.xcassets/Contents.json | 6 + .../src/app/Base.lproj/LaunchScreen.storyboard | 25 + .../src/app/Base.lproj/Main.storyboard | 24 + .../xcode/iosapp_with_framework/src/app/Info.plist | 66 ++ .../iosapp_with_framework/src/app/SceneDelegate.h | 16 + .../iosapp_with_framework/src/app/SceneDelegate.m | 50 ++ .../iosapp_with_framework/src/app/ViewController.h | 15 + .../iosapp_with_framework/src/app/ViewController.m | 23 + .../xcode/iosapp_with_framework/src/app/main.m | 19 + .../iosapp_with_framework/src/framework/Info.plist | 24 + .../iosapp_with_framework/src/framework/test.h | 3 + .../iosapp_with_framework/src/framework/test.m | 9 + .../objc/xcode/iosapp_with_framework/xmake.lua | 13 + .../templates/objc/xcode/macapp/src/AppDelegate.h | 15 + .../templates/objc/xcode/macapp/src/AppDelegate.m | 27 + .../AppIcon.appiconset/Contents.json | 58 ++ .../xcode/macapp/src/Assets.xcassets/Contents.json | 6 + .../xcode/macapp/src/Base.lproj/Main.storyboard | 717 +++++++++++++++++++++ xmake/templates/objc/xcode/macapp/src/Info.plist | 38 ++ .../objc/xcode/macapp/src/ViewController.h | 15 + .../objc/xcode/macapp/src/ViewController.m | 27 + xmake/templates/objc/xcode/macapp/src/main.m | 16 + .../objc/xcode/macapp/src/test.entitlements | 10 + xmake/templates/objc/xcode/macapp/xmake.lua | 6 + .../macapp_with_framework/src/app/AppDelegate.h | 15 + .../macapp_with_framework/src/app/AppDelegate.m | 30 + .../AppIcon.appiconset/Contents.json | 58 ++ .../src/app/Assets.xcassets/Contents.json | 6 + .../src/app/Base.lproj/Main.storyboard | 717 +++++++++++++++++++++ .../xcode/macapp_with_framework/src/app/Info.plist | 38 ++ .../macapp_with_framework/src/app/ViewController.h | 15 + .../macapp_with_framework/src/app/ViewController.m | 27 + .../xcode/macapp_with_framework/src/app/main.m | 16 + .../src/app/test.entitlements | 10 + .../macapp_with_framework/src/framework/Info.plist | 24 + .../macapp_with_framework/src/framework/test.h | 3 + .../macapp_with_framework/src/framework/test.m | 9 + .../objc/xcode/macapp_with_framework/xmake.lua | 13 + 255 files changed, 3646 insertions(+), 3616 deletions(-) delete mode 100644 xmake/templates/c++/module.binary/.gitignore delete mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/.gitignore delete mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp delete mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp delete mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c++/module.binary/src/main.cpp delete mode 100644 xmake/templates/c++/module.binary/xmake.lua delete mode 100644 xmake/templates/c++/module.shared/.gitignore delete mode 100644 xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp delete mode 100644 xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c++/module.shared/src/main.cpp delete mode 100644 xmake/templates/c++/module.shared/xmake.lua create mode 100644 xmake/templates/c++/module/binary/.gitignore create mode 100644 xmake/templates/c++/module/binary/modules/binary/bar/.gitignore create mode 100644 xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp create mode 100644 xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp create mode 100644 xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua create mode 100644 xmake/templates/c++/module/binary/src/main.cpp create mode 100644 xmake/templates/c++/module/binary/xmake.lua create mode 100644 xmake/templates/c++/module/shared/.gitignore create mode 100644 xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp create mode 100644 xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua create mode 100644 xmake/templates/c++/module/shared/src/main.cpp create mode 100644 xmake/templates/c++/module/shared/xmake.lua delete mode 100644 xmake/templates/c++/qt.console/src/main.cpp delete mode 100644 xmake/templates/c++/qt.console/xmake.lua delete mode 100644 xmake/templates/c++/qt.quickapp/src/main.cpp delete mode 100644 xmake/templates/c++/qt.quickapp/src/main.qml delete mode 100644 xmake/templates/c++/qt.quickapp/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp/xmake.lua delete mode 100644 xmake/templates/c++/qt.quickapp_static/src/main.cpp delete mode 100644 xmake/templates/c++/qt.quickapp_static/src/main.qml delete mode 100644 xmake/templates/c++/qt.quickapp_static/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp_static/xmake.lua delete mode 100644 xmake/templates/c++/qt.shared/src/demo.cpp delete mode 100644 xmake/templates/c++/qt.shared/src/demo.h delete mode 100644 xmake/templates/c++/qt.shared/src/demo_global.h delete mode 100644 xmake/templates/c++/qt.shared/xmake.lua delete mode 100644 xmake/templates/c++/qt.static/src/demo.cpp delete mode 100644 xmake/templates/c++/qt.static/src/demo.h delete mode 100644 xmake/templates/c++/qt.static/xmake.lua delete mode 100644 xmake/templates/c++/qt.widgetapp/src/main.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.h delete mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp/xmake.lua delete mode 100644 xmake/templates/c++/qt.widgetapp_static/src/main.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h delete mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp_static/xmake.lua create mode 100644 xmake/templates/c++/qt/console/src/main.cpp create mode 100644 xmake/templates/c++/qt/console/xmake.lua create mode 100644 xmake/templates/c++/qt/quickapp/src/main.cpp create mode 100644 xmake/templates/c++/qt/quickapp/src/main.qml create mode 100644 xmake/templates/c++/qt/quickapp/src/qml.qrc create mode 100644 xmake/templates/c++/qt/quickapp/xmake.lua create mode 100644 xmake/templates/c++/qt/quickapp_static/src/main.cpp create mode 100644 xmake/templates/c++/qt/quickapp_static/src/main.qml create mode 100644 xmake/templates/c++/qt/quickapp_static/src/qml.qrc create mode 100644 xmake/templates/c++/qt/quickapp_static/xmake.lua create mode 100644 xmake/templates/c++/qt/shared/src/demo.cpp create mode 100644 xmake/templates/c++/qt/shared/src/demo.h create mode 100644 xmake/templates/c++/qt/shared/src/demo_global.h create mode 100644 xmake/templates/c++/qt/shared/xmake.lua create mode 100644 xmake/templates/c++/qt/static/src/demo.cpp create mode 100644 xmake/templates/c++/qt/static/src/demo.h create mode 100644 xmake/templates/c++/qt/static/xmake.lua create mode 100644 xmake/templates/c++/qt/widgetapp/src/main.cpp create mode 100644 xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp create mode 100644 xmake/templates/c++/qt/widgetapp/src/mainwindow.h create mode 100644 xmake/templates/c++/qt/widgetapp/src/mainwindow.ui create mode 100644 xmake/templates/c++/qt/widgetapp/xmake.lua create mode 100644 xmake/templates/c++/qt/widgetapp_static/src/main.cpp create mode 100644 xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp create mode 100644 xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h create mode 100644 xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui create mode 100644 xmake/templates/c++/qt/widgetapp_static/xmake.lua delete mode 100644 xmake/templates/c++/xmake.cli/src/lni/main.cpp delete mode 100644 xmake/templates/c++/xmake.cli/src/lua/main.lua delete mode 100644 xmake/templates/c++/xmake.cli/xmake.lua create mode 100644 xmake/templates/c++/xmake/cli/src/lni/main.cpp create mode 100644 xmake/templates/c++/xmake/cli/src/lua/main.lua create mode 100644 xmake/templates/c++/xmake/cli/xmake.lua delete mode 100644 xmake/templates/c/module.binary/.gitignore delete mode 100644 xmake/templates/c/module.binary/modules/binary/bar/.gitignore delete mode 100644 xmake/templates/c/module.binary/modules/binary/bar/src/add.c delete mode 100644 xmake/templates/c/module.binary/modules/binary/bar/src/sub.c delete mode 100644 xmake/templates/c/module.binary/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c/module.binary/src/main.c delete mode 100644 xmake/templates/c/module.binary/xmake.lua delete mode 100644 xmake/templates/c/module.shared/.gitignore delete mode 100644 xmake/templates/c/module.shared/modules/shared/foo/src/foo.c delete mode 100644 xmake/templates/c/module.shared/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c/module.shared/src/main.c delete mode 100644 xmake/templates/c/module.shared/xmake.lua create mode 100644 xmake/templates/c/module/binary/.gitignore create mode 100644 xmake/templates/c/module/binary/modules/binary/bar/.gitignore create mode 100644 xmake/templates/c/module/binary/modules/binary/bar/src/add.c create mode 100644 xmake/templates/c/module/binary/modules/binary/bar/src/sub.c create mode 100644 xmake/templates/c/module/binary/modules/binary/bar/xmake.lua create mode 100644 xmake/templates/c/module/binary/src/main.c create mode 100644 xmake/templates/c/module/binary/xmake.lua create mode 100644 xmake/templates/c/module/shared/.gitignore create mode 100644 xmake/templates/c/module/shared/modules/shared/foo/src/foo.c create mode 100644 xmake/templates/c/module/shared/modules/shared/foo/xmake.lua create mode 100644 xmake/templates/c/module/shared/src/main.c create mode 100644 xmake/templates/c/module/shared/xmake.lua delete mode 100644 xmake/templates/c/xmake.cli/src/lni/main.c delete mode 100644 xmake/templates/c/xmake.cli/src/lua/main.lua delete mode 100644 xmake/templates/c/xmake.cli/xmake.lua create mode 100644 xmake/templates/c/xmake/cli/src/lni/main.c create mode 100644 xmake/templates/c/xmake/cli/src/lua/main.lua create mode 100644 xmake/templates/c/xmake/cli/xmake.lua delete mode 100644 xmake/templates/objc++/xcode.bundle/src/Info.plist delete mode 100644 xmake/templates/objc++/xcode.bundle/src/test.h delete mode 100644 xmake/templates/objc++/xcode.bundle/src/test.mm delete mode 100644 xmake/templates/objc++/xcode.bundle/xmake.lua delete mode 100644 xmake/templates/objc++/xcode.framework/src/Info.plist delete mode 100644 xmake/templates/objc++/xcode.framework/src/test.h delete mode 100644 xmake/templates/objc++/xcode.framework/src/test.mm delete mode 100644 xmake/templates/objc++/xcode.framework/xmake.lua create mode 100644 xmake/templates/objc++/xcode/bundle/src/Info.plist create mode 100644 xmake/templates/objc++/xcode/bundle/src/test.h create mode 100644 xmake/templates/objc++/xcode/bundle/src/test.mm create mode 100644 xmake/templates/objc++/xcode/bundle/xmake.lua create mode 100644 xmake/templates/objc++/xcode/framework/src/Info.plist create mode 100644 xmake/templates/objc++/xcode/framework/src/test.h create mode 100644 xmake/templates/objc++/xcode/framework/src/test.mm create mode 100644 xmake/templates/objc++/xcode/framework/xmake.lua delete mode 100644 xmake/templates/objc/xcode.bundle/src/Info.plist delete mode 100644 xmake/templates/objc/xcode.bundle/src/test.h delete mode 100644 xmake/templates/objc/xcode.bundle/src/test.m delete mode 100644 xmake/templates/objc/xcode.bundle/xmake.lua delete mode 100644 xmake/templates/objc/xcode.framework/src/Info.plist delete mode 100644 xmake/templates/objc/xcode.framework/src/test.h delete mode 100644 xmake/templates/objc/xcode.framework/src/test.m delete mode 100644 xmake/templates/objc/xcode.framework/xmake.lua delete mode 100644 xmake/templates/objc/xcode.iosapp/src/AppDelegate.h delete mode 100644 xmake/templates/objc/xcode.iosapp/src/AppDelegate.m delete mode 100644 xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard delete mode 100644 xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/xcode.iosapp/src/Info.plist delete mode 100644 xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h delete mode 100644 xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m delete mode 100644 xmake/templates/objc/xcode.iosapp/src/ViewController.h delete mode 100644 xmake/templates/objc/xcode.iosapp/src/ViewController.m delete mode 100644 xmake/templates/objc/xcode.iosapp/src/main.m delete mode 100644 xmake/templates/objc/xcode.iosapp/xmake.lua delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m delete mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua delete mode 100644 xmake/templates/objc/xcode.macapp/src/AppDelegate.h delete mode 100644 xmake/templates/objc/xcode.macapp/src/AppDelegate.m delete mode 100644 xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/xcode.macapp/src/Info.plist delete mode 100644 xmake/templates/objc/xcode.macapp/src/ViewController.h delete mode 100644 xmake/templates/objc/xcode.macapp/src/ViewController.m delete mode 100644 xmake/templates/objc/xcode.macapp/src/main.m delete mode 100644 xmake/templates/objc/xcode.macapp/src/test.entitlements delete mode 100644 xmake/templates/objc/xcode.macapp/xmake.lua delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m delete mode 100644 xmake/templates/objc/xcode.macapp_with_framework/xmake.lua create mode 100644 xmake/templates/objc/xcode/bundle/src/Info.plist create mode 100644 xmake/templates/objc/xcode/bundle/src/test.h create mode 100644 xmake/templates/objc/xcode/bundle/src/test.m create mode 100644 xmake/templates/objc/xcode/bundle/xmake.lua create mode 100644 xmake/templates/objc/xcode/framework/src/Info.plist create mode 100644 xmake/templates/objc/xcode/framework/src/test.h create mode 100644 xmake/templates/objc/xcode/framework/src/test.m create mode 100644 xmake/templates/objc/xcode/framework/xmake.lua create mode 100644 xmake/templates/objc/xcode/iosapp/src/AppDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/AppDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp/src/Info.plist create mode 100644 xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/ViewController.h create mode 100644 xmake/templates/objc/xcode/iosapp/src/ViewController.m create mode 100644 xmake/templates/objc/xcode/iosapp/src/main.m create mode 100644 xmake/templates/objc/xcode/iosapp/xmake.lua create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/app/main.m create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.h create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.m create mode 100644 xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua create mode 100644 xmake/templates/objc/xcode/macapp/src/AppDelegate.h create mode 100644 xmake/templates/objc/xcode/macapp/src/AppDelegate.m create mode 100644 xmake/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode/macapp/src/Info.plist create mode 100644 xmake/templates/objc/xcode/macapp/src/ViewController.h create mode 100644 xmake/templates/objc/xcode/macapp/src/ViewController.m create mode 100644 xmake/templates/objc/xcode/macapp/src/main.m create mode 100644 xmake/templates/objc/xcode/macapp/src/test.entitlements create mode 100644 xmake/templates/objc/xcode/macapp/xmake.lua create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/Info.plist create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/main.m create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.h create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.m create mode 100644 xmake/templates/objc/xcode/macapp_with_framework/xmake.lua 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 deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module.binary/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - 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 deleted file mode 100644 index 93fdf0ad8..000000000 --- a/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a + b); - return 0; -} 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 deleted file mode 100644 index ae7b6d1f2..000000000 --- a/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a - b); - return 0; -} diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua deleted file mode 100644 index add3c6e97..000000000 --- a/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("add") - add_rules("module.binary") - add_files("src/add.cpp") - -target("sub") - add_rules("module.binary") - add_files("src/sub.cpp") - diff --git a/xmake/templates/c++/module.binary/src/main.cpp b/xmake/templates/c++/module.binary/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module.binary/src/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - std::cout << "hello world!" << std::endl; - return 0; -} diff --git a/xmake/templates/c++/module.binary/xmake.lua b/xmake/templates/c++/module.binary/xmake.lua deleted file mode 100644 index d73d457d3..000000000 --- a/xmake/templates/c++/module.binary/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - on_config(function (target) - import("binary.bar") - print("binary: 1 + 1 = %s", bar.add(1, 1)) - print("binary: 1 - 1 = %s", bar.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c++/module.shared/.gitignore b/xmake/templates/c++/module.shared/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module.shared/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - 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 deleted file mode 100644 index adde214ca..000000000 --- a/xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include - -static int add(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a + b); - return 1; -} - -static int sub(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a - b); - return 1; -} - -int luaopen(foo, lua_State *lua) { - static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; - lua_newtable(lua); - luaL_setfuncs(lua, funcs, 0); - return 1; -} diff --git a/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua deleted file mode 100644 index 9b3423d41..000000000 --- a/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - add_rules("module.shared") - add_files("src/foo.cpp") - diff --git a/xmake/templates/c++/module.shared/src/main.cpp b/xmake/templates/c++/module.shared/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module.shared/src/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - std::cout << "hello world!" << std::endl; - return 0; -} diff --git a/xmake/templates/c++/module.shared/xmake.lua b/xmake/templates/c++/module.shared/xmake.lua deleted file mode 100644 index 43aafe904..000000000 --- a/xmake/templates/c++/module.shared/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - on_config(function (target) - import("shared.foo") - print("shared: 1 + 1 = %s", foo.add(1, 1)) - print("shared: 1 - 1 = %s", foo.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c++/module/binary/.gitignore b/xmake/templates/c++/module/binary/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c++/module/binary/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore b/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + 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 new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a + b); + return 0; +} 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 new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a - b); + return 0; +} diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua b/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..add3c6e97 --- /dev/null +++ b/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("add") + add_rules("module.binary") + add_files("src/add.cpp") + +target("sub") + add_rules("module.binary") + add_files("src/sub.cpp") + diff --git a/xmake/templates/c++/module/binary/src/main.cpp b/xmake/templates/c++/module/binary/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/templates/c++/module/binary/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + std::cout << "hello world!" << std::endl; + return 0; +} diff --git a/xmake/templates/c++/module/binary/xmake.lua b/xmake/templates/c++/module/binary/xmake.lua new file mode 100644 index 000000000..d73d457d3 --- /dev/null +++ b/xmake/templates/c++/module/binary/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.cpp") + on_config(function (target) + import("binary.bar") + print("binary: 1 + 1 = %s", bar.add(1, 1)) + print("binary: 1 - 1 = %s", bar.sub(1, 1)) + end) + +${FAQ} + diff --git a/xmake/templates/c++/module/shared/.gitignore b/xmake/templates/c++/module/shared/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c++/module/shared/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + 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 new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp @@ -0,0 +1,22 @@ +#include + +static int add(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a + b); + return 1; +} + +static int sub(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a - b); + return 1; +} + +int luaopen(foo, lua_State *lua) { + static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; + lua_newtable(lua); + luaL_setfuncs(lua, funcs, 0); + return 1; +} diff --git a/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..9b3423d41 --- /dev/null +++ b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + add_rules("module.shared") + add_files("src/foo.cpp") + diff --git a/xmake/templates/c++/module/shared/src/main.cpp b/xmake/templates/c++/module/shared/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/templates/c++/module/shared/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + std::cout << "hello world!" << std::endl; + return 0; +} diff --git a/xmake/templates/c++/module/shared/xmake.lua b/xmake/templates/c++/module/shared/xmake.lua new file mode 100644 index 000000000..43aafe904 --- /dev/null +++ b/xmake/templates/c++/module/shared/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.cpp") + on_config(function (target) + import("shared.foo") + print("shared: 1 + 1 = %s", foo.add(1, 1)) + print("shared: 1 - 1 = %s", foo.sub(1, 1)) + end) + +${FAQ} + diff --git a/xmake/templates/c++/qt.console/src/main.cpp b/xmake/templates/c++/qt.console/src/main.cpp deleted file mode 100644 index e876eea4f..000000000 --- a/xmake/templates/c++/qt.console/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include - -int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); - printf("hello xmake\n"); - return a.exec(); -} diff --git a/xmake/templates/c++/qt.console/xmake.lua b/xmake/templates/c++/qt.console/xmake.lua deleted file mode 100644 index 2ce5aa993..000000000 --- a/xmake/templates/c++/qt.console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.console") - add_files("src/*.cpp") - -${FAQ} diff --git a/xmake/templates/c++/qt.quickapp/src/main.cpp b/xmake/templates/c++/qt.quickapp/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt.quickapp/src/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) { -#if QT_VERSION >= 0x50601 - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff --git a/xmake/templates/c++/qt.quickapp/src/main.qml b/xmake/templates/c++/qt.quickapp/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt.quickapp/src/main.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.6 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 - -Window { - id: root - visible: true - width: 640 - height: 480 - title: qsTr("Hello World") - Button { - text: "Ok" - onClicked: { - root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); - } - } -} - diff --git a/xmake/templates/c++/qt.quickapp/src/qml.qrc b/xmake/templates/c++/qt.quickapp/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt.quickapp/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/xmake/templates/c++/qt.quickapp/xmake.lua b/xmake/templates/c++/qt.quickapp/xmake.lua deleted file mode 100644 index 3f71d1c15..000000000 --- a/xmake/templates/c++/qt.quickapp/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.quickapp") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/qml.qrc") - -${FAQ} diff --git a/xmake/templates/c++/qt.quickapp_static/src/main.cpp b/xmake/templates/c++/qt.quickapp_static/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt.quickapp_static/src/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) { -#if QT_VERSION >= 0x50601 - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff --git a/xmake/templates/c++/qt.quickapp_static/src/main.qml b/xmake/templates/c++/qt.quickapp_static/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt.quickapp_static/src/main.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.6 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 - -Window { - id: root - visible: true - width: 640 - height: 480 - title: qsTr("Hello World") - Button { - text: "Ok" - onClicked: { - root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); - } - } -} - diff --git a/xmake/templates/c++/qt.quickapp_static/src/qml.qrc b/xmake/templates/c++/qt.quickapp_static/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt.quickapp_static/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/xmake/templates/c++/qt.quickapp_static/xmake.lua b/xmake/templates/c++/qt.quickapp_static/xmake.lua deleted file mode 100644 index 0d311a762..000000000 --- a/xmake/templates/c++/qt.quickapp_static/xmake.lua +++ /dev/null @@ -1,16 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGET_NAME}") - add_rules("qt.quickapp_static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/qml.qrc") - add_frameworks("QtQuickControls2", "QtQuickTemplates2") - qt_add_static_plugins("QtQuick2Plugin", {linkdirs = "qml/QtQuick.2", links = "qtquick2plugin"}) - qt_add_static_plugins("QtQuick2WindowPlugin", {linkdirs = "qml/QtQuick/Window.2", links = "windowplugin"}) - qt_add_static_plugins("QtQuickControls2Plugin", {linkdirs = "qml/QtQuick/Controls.2", links = "qtquickcontrols2plugin"}) - qt_add_static_plugins("QtQuickTemplates2Plugin", {linkdirs = "qml/QtQuick/Templates.2", links = "qtquicktemplates2plugin"}) - -${FAQ} diff --git a/xmake/templates/c++/qt.shared/src/demo.cpp b/xmake/templates/c++/qt.shared/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt.shared/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt.shared/src/demo.h b/xmake/templates/c++/qt.shared/src/demo.h deleted file mode 100644 index 89f29ec46..000000000 --- a/xmake/templates/c++/qt.shared/src/demo.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef QT_DEMO_H -#define QT_DEMO_H - -#include "demo_global.h" - -class QT_DEMOSHARED_EXPORT QtDemo { - public: - QtDemo(); -}; - -#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt.shared/src/demo_global.h b/xmake/templates/c++/qt.shared/src/demo_global.h deleted file mode 100644 index d6b1ddf0b..000000000 --- a/xmake/templates/c++/qt.shared/src/demo_global.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef QT_DEMO_GLOBAL_H -#define QT_DEMO_GLOBAL_H - -#include - -#if defined(QT_DEMO_LIBRARY) -#define QT_DEMOSHARED_EXPORT Q_DECL_EXPORT -#else -#define QT_DEMOSHARED_EXPORT Q_DECL_IMPORT -#endif - -#endif // QT_DEMO_GLOBAL_H diff --git a/xmake/templates/c++/qt.shared/xmake.lua b/xmake/templates/c++/qt.shared/xmake.lua deleted file mode 100644 index 3b07153b9..000000000 --- a/xmake/templates/c++/qt.shared/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.shared") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_defines("QT_DEMO_LIBRARY") - add_frameworks("QtGui") - -${FAQ} diff --git a/xmake/templates/c++/qt.static/src/demo.cpp b/xmake/templates/c++/qt.static/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt.static/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt.static/src/demo.h b/xmake/templates/c++/qt.static/src/demo.h deleted file mode 100644 index 24730c9d8..000000000 --- a/xmake/templates/c++/qt.static/src/demo.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef QT_DEMO_H -#define QT_DEMO_H - -class QtDemo { - public: - QtDemo(); -}; - -#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt.static/xmake.lua b/xmake/templates/c++/qt.static/xmake.lua deleted file mode 100644 index 371bdf082..000000000 --- a/xmake/templates/c++/qt.static/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_frameworks("QtGui") - -${FAQ} diff --git a/xmake/templates/c++/qt.widgetapp/src/main.cpp b/xmake/templates/c++/qt.widgetapp/src/main.cpp deleted file mode 100644 index 191ae18d2..000000000 --- a/xmake/templates/c++/qt.widgetapp/src/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "mainwindow.h" -#include - -int main(int argc, char *argv[]) { - QApplication a(argc, argv); - MainWindow w; - w.show(); - return a.exec(); -} diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - ui->setupUi(this); -} - -MainWindow::~MainWindow() { - delete ui; -} diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -namespace Ui { -class MainWindow; -} - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - private: - Ui::MainWindow *ui; -}; - -#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - - - - - - diff --git a/xmake/templates/c++/qt.widgetapp/xmake.lua b/xmake/templates/c++/qt.widgetapp/xmake.lua deleted file mode 100644 index e0f9f455e..000000000 --- a/xmake/templates/c++/qt.widgetapp/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.widgetapp") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/mainwindow.ui") - -- add files with Q_OBJECT meta (only for qt.moc) - add_files("src/mainwindow.h") - -${FAQ} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/main.cpp b/xmake/templates/c++/qt.widgetapp_static/src/main.cpp deleted file mode 100644 index db5b0cce8..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/src/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include - -int main(int argc, char *argv[]) { - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - ui->setupUi(this); -} - -MainWindow::~MainWindow() { - delete ui; -} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include - -namespace Ui { -class MainWindow; -} - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - private: - Ui::MainWindow *ui; -}; - -#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - - - - - - diff --git a/xmake/templates/c++/qt.widgetapp_static/xmake.lua b/xmake/templates/c++/qt.widgetapp_static/xmake.lua deleted file mode 100644 index 2c357e531..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/xmake.lua +++ /dev/null @@ -1,18 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGET_NAME}") - add_rules("qt.widgetapp_static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/mainwindow.ui") - - -- add files with Q_OBJECT meta (only for qt.moc) - add_files("src/mainwindow.h") - - -- add plugin: QSvgPlugin (optional) - add_frameworks("QtSvg") - qt_add_static_plugins("QSvgPlugin", {linkdirs = "plugins/imageformats", links = {"qsvg"}}) - -${FAQ} diff --git a/xmake/templates/c++/qt/console/src/main.cpp b/xmake/templates/c++/qt/console/src/main.cpp new file mode 100644 index 000000000..e876eea4f --- /dev/null +++ b/xmake/templates/c++/qt/console/src/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char *argv[]) { + QCoreApplication a(argc, argv); + printf("hello xmake\n"); + return a.exec(); +} diff --git a/xmake/templates/c++/qt/console/xmake.lua b/xmake/templates/c++/qt/console/xmake.lua new file mode 100644 index 000000000..2ce5aa993 --- /dev/null +++ b/xmake/templates/c++/qt/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("qt.console") + add_files("src/*.cpp") + +${FAQ} diff --git a/xmake/templates/c++/qt/quickapp/src/main.cpp b/xmake/templates/c++/qt/quickapp/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/templates/c++/qt/quickapp/src/main.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) { +#if QT_VERSION >= 0x50601 + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/xmake/templates/c++/qt/quickapp/src/main.qml b/xmake/templates/c++/qt/quickapp/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/templates/c++/qt/quickapp/src/main.qml @@ -0,0 +1,18 @@ +import QtQuick 2.6 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.2 + +Window { + id: root + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + Button { + text: "Ok" + onClicked: { + root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); + } + } +} + diff --git a/xmake/templates/c++/qt/quickapp/src/qml.qrc b/xmake/templates/c++/qt/quickapp/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/templates/c++/qt/quickapp/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/templates/c++/qt/quickapp/xmake.lua b/xmake/templates/c++/qt/quickapp/xmake.lua new file mode 100644 index 000000000..3f71d1c15 --- /dev/null +++ b/xmake/templates/c++/qt/quickapp/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("qt.quickapp") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_files("src/qml.qrc") + +${FAQ} diff --git a/xmake/templates/c++/qt/quickapp_static/src/main.cpp b/xmake/templates/c++/qt/quickapp_static/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/templates/c++/qt/quickapp_static/src/main.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) { +#if QT_VERSION >= 0x50601 + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/xmake/templates/c++/qt/quickapp_static/src/main.qml b/xmake/templates/c++/qt/quickapp_static/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/templates/c++/qt/quickapp_static/src/main.qml @@ -0,0 +1,18 @@ +import QtQuick 2.6 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.2 + +Window { + id: root + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + Button { + text: "Ok" + onClicked: { + root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); + } + } +} + diff --git a/xmake/templates/c++/qt/quickapp_static/src/qml.qrc b/xmake/templates/c++/qt/quickapp_static/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/templates/c++/qt/quickapp_static/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/templates/c++/qt/quickapp_static/xmake.lua b/xmake/templates/c++/qt/quickapp_static/xmake.lua new file mode 100644 index 000000000..0d311a762 --- /dev/null +++ b/xmake/templates/c++/qt/quickapp_static/xmake.lua @@ -0,0 +1,16 @@ +add_rules("mode.debug", "mode.release") + +includes("@builtin/qt") + +target("${TARGET_NAME}") + add_rules("qt.quickapp_static") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_files("src/qml.qrc") + add_frameworks("QtQuickControls2", "QtQuickTemplates2") + qt_add_static_plugins("QtQuick2Plugin", {linkdirs = "qml/QtQuick.2", links = "qtquick2plugin"}) + qt_add_static_plugins("QtQuick2WindowPlugin", {linkdirs = "qml/QtQuick/Window.2", links = "windowplugin"}) + qt_add_static_plugins("QtQuickControls2Plugin", {linkdirs = "qml/QtQuick/Controls.2", links = "qtquickcontrols2plugin"}) + qt_add_static_plugins("QtQuickTemplates2Plugin", {linkdirs = "qml/QtQuick/Templates.2", links = "qtquicktemplates2plugin"}) + +${FAQ} diff --git a/xmake/templates/c++/qt/shared/src/demo.cpp b/xmake/templates/c++/qt/shared/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/templates/c++/qt/shared/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/templates/c++/qt/shared/src/demo.h b/xmake/templates/c++/qt/shared/src/demo.h new file mode 100644 index 000000000..89f29ec46 --- /dev/null +++ b/xmake/templates/c++/qt/shared/src/demo.h @@ -0,0 +1,11 @@ +#ifndef QT_DEMO_H +#define QT_DEMO_H + +#include "demo_global.h" + +class QT_DEMOSHARED_EXPORT QtDemo { + public: + QtDemo(); +}; + +#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt/shared/src/demo_global.h b/xmake/templates/c++/qt/shared/src/demo_global.h new file mode 100644 index 000000000..d6b1ddf0b --- /dev/null +++ b/xmake/templates/c++/qt/shared/src/demo_global.h @@ -0,0 +1,12 @@ +#ifndef QT_DEMO_GLOBAL_H +#define QT_DEMO_GLOBAL_H + +#include + +#if defined(QT_DEMO_LIBRARY) +#define QT_DEMOSHARED_EXPORT Q_DECL_EXPORT +#else +#define QT_DEMOSHARED_EXPORT Q_DECL_IMPORT +#endif + +#endif // QT_DEMO_GLOBAL_H diff --git a/xmake/templates/c++/qt/shared/xmake.lua b/xmake/templates/c++/qt/shared/xmake.lua new file mode 100644 index 000000000..3b07153b9 --- /dev/null +++ b/xmake/templates/c++/qt/shared/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("qt.shared") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_defines("QT_DEMO_LIBRARY") + add_frameworks("QtGui") + +${FAQ} diff --git a/xmake/templates/c++/qt/static/src/demo.cpp b/xmake/templates/c++/qt/static/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/templates/c++/qt/static/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/templates/c++/qt/static/src/demo.h b/xmake/templates/c++/qt/static/src/demo.h new file mode 100644 index 000000000..24730c9d8 --- /dev/null +++ b/xmake/templates/c++/qt/static/src/demo.h @@ -0,0 +1,9 @@ +#ifndef QT_DEMO_H +#define QT_DEMO_H + +class QtDemo { + public: + QtDemo(); +}; + +#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt/static/xmake.lua b/xmake/templates/c++/qt/static/xmake.lua new file mode 100644 index 000000000..371bdf082 --- /dev/null +++ b/xmake/templates/c++/qt/static/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("qt.static") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_frameworks("QtGui") + +${FAQ} diff --git a/xmake/templates/c++/qt/widgetapp/src/main.cpp b/xmake/templates/c++/qt/widgetapp/src/main.cpp new file mode 100644 index 000000000..191ae18d2 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp/src/main.cpp @@ -0,0 +1,9 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); +} + +MainWindow::~MainWindow() { + delete ui; +} diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/templates/c++/qt/widgetapp/xmake.lua b/xmake/templates/c++/qt/widgetapp/xmake.lua new file mode 100644 index 000000000..e0f9f455e --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("qt.widgetapp") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_files("src/mainwindow.ui") + -- add files with Q_OBJECT meta (only for qt.moc) + add_files("src/mainwindow.h") + +${FAQ} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/main.cpp b/xmake/templates/c++/qt/widgetapp_static/src/main.cpp new file mode 100644 index 000000000..db5b0cce8 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp_static/src/main.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); +} + +MainWindow::~MainWindow() { + delete ui; +} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/templates/c++/qt/widgetapp_static/xmake.lua b/xmake/templates/c++/qt/widgetapp_static/xmake.lua new file mode 100644 index 000000000..2c357e531 --- /dev/null +++ b/xmake/templates/c++/qt/widgetapp_static/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.debug", "mode.release") + +includes("@builtin/qt") + +target("${TARGET_NAME}") + add_rules("qt.widgetapp_static") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_files("src/mainwindow.ui") + + -- add files with Q_OBJECT meta (only for qt.moc) + add_files("src/mainwindow.h") + + -- add plugin: QSvgPlugin (optional) + add_frameworks("QtSvg") + qt_add_static_plugins("QSvgPlugin", {linkdirs = "plugins/imageformats", links = {"qsvg"}}) + +${FAQ} diff --git a/xmake/templates/c++/xmake.cli/src/lni/main.cpp b/xmake/templates/c++/xmake.cli/src/lni/main.cpp deleted file mode 100644 index 3de2b1e36..000000000 --- a/xmake/templates/c++/xmake.cli/src/lni/main.cpp +++ /dev/null @@ -1,23 +0,0 @@ -extern "C" { -#include -} - -static tb_byte_t const g_luafiles_data[] = { -#include "luafiles.xmz.h" -}; - -static tb_int_t lni_test_hello(lua_State *lua) { - lua_pushliteral(lua, "hello xmake!"); - return 1; -} - -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { - static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; - xm_engine_register(engine, "test", lni_test_funcs); - xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); -} - -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; - return xm_engine_run("${TARGET_NAME}", argc, argv, taskargv, lni_initalizer); -} diff --git a/xmake/templates/c++/xmake.cli/src/lua/main.lua b/xmake/templates/c++/xmake.cli/src/lua/main.lua deleted file mode 100644 index d87daf102..000000000 --- a/xmake/templates/c++/xmake.cli/src/lua/main.lua +++ /dev/null @@ -1,10 +0,0 @@ -import("core.base.option") -import("lib.lni.test") - -function main () - print(test.hello()) - local argv = option.get("arguments") - if argv then - print(argv) - end -end diff --git a/xmake/templates/c++/xmake.cli/xmake.lua b/xmake/templates/c++/xmake.cli/xmake.lua deleted file mode 100644 index cf1987c60..000000000 --- a/xmake/templates/c++/xmake.cli/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("libxmake") - -target("${TARGET_NAME}") - add_rules("xmake.cli") - add_files("src/lni/*.cpp") - add_files("src/lua/*.lua", {rootdir = "src"}) - add_packages("libxmake") - -${FAQ} - diff --git a/xmake/templates/c++/xmake/cli/src/lni/main.cpp b/xmake/templates/c++/xmake/cli/src/lni/main.cpp new file mode 100644 index 000000000..3de2b1e36 --- /dev/null +++ b/xmake/templates/c++/xmake/cli/src/lni/main.cpp @@ -0,0 +1,23 @@ +extern "C" { +#include +} + +static tb_byte_t const g_luafiles_data[] = { +#include "luafiles.xmz.h" +}; + +static tb_int_t lni_test_hello(lua_State *lua) { + lua_pushliteral(lua, "hello xmake!"); + return 1; +} + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { + static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; + xm_engine_register(engine, "test", lni_test_funcs); + xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); +} + +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; + return xm_engine_run("${TARGET_NAME}", argc, argv, taskargv, lni_initalizer); +} diff --git a/xmake/templates/c++/xmake/cli/src/lua/main.lua b/xmake/templates/c++/xmake/cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/templates/c++/xmake/cli/src/lua/main.lua @@ -0,0 +1,10 @@ +import("core.base.option") +import("lib.lni.test") + +function main () + print(test.hello()) + local argv = option.get("arguments") + if argv then + print(argv) + end +end diff --git a/xmake/templates/c++/xmake/cli/xmake.lua b/xmake/templates/c++/xmake/cli/xmake.lua new file mode 100644 index 000000000..cf1987c60 --- /dev/null +++ b/xmake/templates/c++/xmake/cli/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +add_requires("libxmake") + +target("${TARGET_NAME}") + add_rules("xmake.cli") + add_files("src/lni/*.cpp") + add_files("src/lua/*.lua", {rootdir = "src"}) + add_packages("libxmake") + +${FAQ} + diff --git a/xmake/templates/c/module.binary/.gitignore b/xmake/templates/c/module.binary/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c/module.binary/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - diff --git a/xmake/templates/c/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c/module.binary/modules/binary/bar/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c/module.binary/modules/binary/bar/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - 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 deleted file mode 100644 index 93fdf0ad8..000000000 --- a/xmake/templates/c/module.binary/modules/binary/bar/src/add.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a + b); - return 0; -} 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 deleted file mode 100644 index ae7b6d1f2..000000000 --- a/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a - b); - return 0; -} diff --git a/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua deleted file mode 100644 index d4983d741..000000000 --- a/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("add") - add_rules("module.binary") - add_files("src/add.c") - -target("sub") - add_rules("module.binary") - add_files("src/sub.c") - diff --git a/xmake/templates/c/module.binary/src/main.c b/xmake/templates/c/module.binary/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/module.binary/src/main.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("hello world!\n"); - return 0; -} diff --git a/xmake/templates/c/module.binary/xmake.lua b/xmake/templates/c/module.binary/xmake.lua deleted file mode 100644 index 7df556cb8..000000000 --- a/xmake/templates/c/module.binary/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.c") - on_config(function (target) - import("binary.bar") - print("binary: 1 + 1 = %s", bar.add(1, 1)) - print("binary: 1 - 1 = %s", bar.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c/module.shared/.gitignore b/xmake/templates/c/module.shared/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c/module.shared/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - 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 deleted file mode 100644 index adde214ca..000000000 --- a/xmake/templates/c/module.shared/modules/shared/foo/src/foo.c +++ /dev/null @@ -1,22 +0,0 @@ -#include - -static int add(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a + b); - return 1; -} - -static int sub(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a - b); - return 1; -} - -int luaopen(foo, lua_State *lua) { - static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; - lua_newtable(lua); - luaL_setfuncs(lua, funcs, 0); - return 1; -} diff --git a/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua deleted file mode 100644 index 035573d9f..000000000 --- a/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - add_rules("module.shared") - add_files("src/foo.c") - diff --git a/xmake/templates/c/module.shared/src/main.c b/xmake/templates/c/module.shared/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/module.shared/src/main.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(int argc, char **argv) { - printf("hello world!\n"); - return 0; -} diff --git a/xmake/templates/c/module.shared/xmake.lua b/xmake/templates/c/module.shared/xmake.lua deleted file mode 100644 index 4b92b0b9e..000000000 --- a/xmake/templates/c/module.shared/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.c") - on_config(function (target) - import("shared.foo") - print("shared: 1 + 1 = %s", foo.add(1, 1)) - print("shared: 1 - 1 = %s", foo.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c/module/binary/.gitignore b/xmake/templates/c/module/binary/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c/module/binary/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/templates/c/module/binary/modules/binary/bar/.gitignore b/xmake/templates/c/module/binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c/module/binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + 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 new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/templates/c/module/binary/modules/binary/bar/src/add.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a + b); + return 0; +} 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 new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/templates/c/module/binary/modules/binary/bar/src/sub.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a - b); + return 0; +} diff --git a/xmake/templates/c/module/binary/modules/binary/bar/xmake.lua b/xmake/templates/c/module/binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..d4983d741 --- /dev/null +++ b/xmake/templates/c/module/binary/modules/binary/bar/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("add") + add_rules("module.binary") + add_files("src/add.c") + +target("sub") + add_rules("module.binary") + add_files("src/sub.c") + diff --git a/xmake/templates/c/module/binary/src/main.c b/xmake/templates/c/module/binary/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/templates/c/module/binary/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("hello world!\n"); + return 0; +} diff --git a/xmake/templates/c/module/binary/xmake.lua b/xmake/templates/c/module/binary/xmake.lua new file mode 100644 index 000000000..7df556cb8 --- /dev/null +++ b/xmake/templates/c/module/binary/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.c") + on_config(function (target) + import("binary.bar") + print("binary: 1 + 1 = %s", bar.add(1, 1)) + print("binary: 1 - 1 = %s", bar.sub(1, 1)) + end) + +${FAQ} + diff --git a/xmake/templates/c/module/shared/.gitignore b/xmake/templates/c/module/shared/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c/module/shared/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + 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 new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/templates/c/module/shared/modules/shared/foo/src/foo.c @@ -0,0 +1,22 @@ +#include + +static int add(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a + b); + return 1; +} + +static int sub(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a - b); + return 1; +} + +int luaopen(foo, lua_State *lua) { + static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; + lua_newtable(lua); + luaL_setfuncs(lua, funcs, 0); + return 1; +} diff --git a/xmake/templates/c/module/shared/modules/shared/foo/xmake.lua b/xmake/templates/c/module/shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..035573d9f --- /dev/null +++ b/xmake/templates/c/module/shared/modules/shared/foo/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + add_rules("module.shared") + add_files("src/foo.c") + diff --git a/xmake/templates/c/module/shared/src/main.c b/xmake/templates/c/module/shared/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/templates/c/module/shared/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("hello world!\n"); + return 0; +} diff --git a/xmake/templates/c/module/shared/xmake.lua b/xmake/templates/c/module/shared/xmake.lua new file mode 100644 index 000000000..4b92b0b9e --- /dev/null +++ b/xmake/templates/c/module/shared/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.c") + on_config(function (target) + import("shared.foo") + print("shared: 1 + 1 = %s", foo.add(1, 1)) + print("shared: 1 - 1 = %s", foo.sub(1, 1)) + end) + +${FAQ} + diff --git a/xmake/templates/c/xmake.cli/src/lni/main.c b/xmake/templates/c/xmake.cli/src/lni/main.c deleted file mode 100644 index 1ef27cd75..000000000 --- a/xmake/templates/c/xmake.cli/src/lni/main.c +++ /dev/null @@ -1,21 +0,0 @@ -#include - -static tb_byte_t const g_luafiles_data[] = { -#include "luafiles.xmz.h" -}; - -static tb_int_t lni_test_hello(lua_State *lua) { - lua_pushliteral(lua, "hello xmake!"); - return 1; -} - -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { - static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; - xm_engine_register(engine, "test", lni_test_funcs); - xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); -} - -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; - return xm_engine_run("${TARGET_NAME}", argc, argv, taskargv, lni_initalizer); -} diff --git a/xmake/templates/c/xmake.cli/src/lua/main.lua b/xmake/templates/c/xmake.cli/src/lua/main.lua deleted file mode 100644 index d87daf102..000000000 --- a/xmake/templates/c/xmake.cli/src/lua/main.lua +++ /dev/null @@ -1,10 +0,0 @@ -import("core.base.option") -import("lib.lni.test") - -function main () - print(test.hello()) - local argv = option.get("arguments") - if argv then - print(argv) - end -end diff --git a/xmake/templates/c/xmake.cli/xmake.lua b/xmake/templates/c/xmake.cli/xmake.lua deleted file mode 100644 index 33422b5c0..000000000 --- a/xmake/templates/c/xmake.cli/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("libxmake") - -target("${TARGET_NAME}") - add_rules("xmake.cli") - add_files("src/lni/*.c") - add_files("src/lua/*.lua", {rootdir = "src"}) - add_packages("libxmake") - -${FAQ} diff --git a/xmake/templates/c/xmake/cli/src/lni/main.c b/xmake/templates/c/xmake/cli/src/lni/main.c new file mode 100644 index 000000000..1ef27cd75 --- /dev/null +++ b/xmake/templates/c/xmake/cli/src/lni/main.c @@ -0,0 +1,21 @@ +#include + +static tb_byte_t const g_luafiles_data[] = { +#include "luafiles.xmz.h" +}; + +static tb_int_t lni_test_hello(lua_State *lua) { + lua_pushliteral(lua, "hello xmake!"); + return 1; +} + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { + static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; + xm_engine_register(engine, "test", lni_test_funcs); + xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); +} + +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; + return xm_engine_run("${TARGET_NAME}", argc, argv, taskargv, lni_initalizer); +} diff --git a/xmake/templates/c/xmake/cli/src/lua/main.lua b/xmake/templates/c/xmake/cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/templates/c/xmake/cli/src/lua/main.lua @@ -0,0 +1,10 @@ +import("core.base.option") +import("lib.lni.test") + +function main () + print(test.hello()) + local argv = option.get("arguments") + if argv then + print(argv) + end +end diff --git a/xmake/templates/c/xmake/cli/xmake.lua b/xmake/templates/c/xmake/cli/xmake.lua new file mode 100644 index 000000000..33422b5c0 --- /dev/null +++ b/xmake/templates/c/xmake/cli/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +add_requires("libxmake") + +target("${TARGET_NAME}") + add_rules("xmake.cli") + add_files("src/lni/*.c") + add_files("src/lua/*.lua", {rootdir = "src"}) + add_packages("libxmake") + +${FAQ} diff --git a/xmake/templates/objc++/xcode.bundle/src/Info.plist b/xmake/templates/objc++/xcode.bundle/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc++/xcode.bundle/src/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - diff --git a/xmake/templates/objc++/xcode.bundle/src/test.h b/xmake/templates/objc++/xcode.bundle/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc++/xcode.bundle/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode.bundle/src/test.mm b/xmake/templates/objc++/xcode.bundle/src/test.mm deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc++/xcode.bundle/src/test.mm +++ /dev/null @@ -1,5 +0,0 @@ -#include "test.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/objc++/xcode.bundle/xmake.lua b/xmake/templates/objc++/xcode.bundle/xmake.lua deleted file mode 100644 index 1ecf69fcb..000000000 --- a/xmake/templates/objc++/xcode.bundle/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.bundle") - add_files("src/*.mm") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc++/xcode.framework/src/Info.plist b/xmake/templates/objc++/xcode.framework/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc++/xcode.framework/src/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - diff --git a/xmake/templates/objc++/xcode.framework/src/test.h b/xmake/templates/objc++/xcode.framework/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc++/xcode.framework/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode.framework/src/test.mm b/xmake/templates/objc++/xcode.framework/src/test.mm deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc++/xcode.framework/src/test.mm +++ /dev/null @@ -1,5 +0,0 @@ -#include "test.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/objc++/xcode.framework/xmake.lua b/xmake/templates/objc++/xcode.framework/xmake.lua deleted file mode 100644 index 3805d95c6..000000000 --- a/xmake/templates/objc++/xcode.framework/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.framework") - add_files("src/*.mm") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc++/xcode/bundle/src/Info.plist b/xmake/templates/objc++/xcode/bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/xcode/bundle/src/test.h b/xmake/templates/objc++/xcode/bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode/bundle/src/test.mm b/xmake/templates/objc++/xcode/bundle/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode/bundle/xmake.lua b/xmake/templates/objc++/xcode/bundle/xmake.lua new file mode 100644 index 000000000..1ecf69fcb --- /dev/null +++ b/xmake/templates/objc++/xcode/bundle/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.bundle") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc++/xcode/framework/src/Info.plist b/xmake/templates/objc++/xcode/framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/xcode/framework/src/test.h b/xmake/templates/objc++/xcode/framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode/framework/src/test.mm b/xmake/templates/objc++/xcode/framework/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode/framework/xmake.lua b/xmake/templates/objc++/xcode/framework/xmake.lua new file mode 100644 index 000000000..3805d95c6 --- /dev/null +++ b/xmake/templates/objc++/xcode/framework/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.framework") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/xcode.bundle/src/Info.plist b/xmake/templates/objc/xcode.bundle/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/xcode.bundle/src/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - diff --git a/xmake/templates/objc/xcode.bundle/src/test.h b/xmake/templates/objc/xcode.bundle/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/xcode.bundle/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.bundle/src/test.m b/xmake/templates/objc/xcode.bundle/src/test.m deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc/xcode.bundle/src/test.m +++ /dev/null @@ -1,5 +0,0 @@ -#include "test.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/objc/xcode.bundle/xmake.lua b/xmake/templates/objc/xcode.bundle/xmake.lua deleted file mode 100644 index 34d108fcb..000000000 --- a/xmake/templates/objc/xcode.bundle/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.bundle") - add_files("src/*.m") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc/xcode.framework/src/Info.plist b/xmake/templates/objc/xcode.framework/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/xcode.framework/src/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - diff --git a/xmake/templates/objc/xcode.framework/src/test.h b/xmake/templates/objc/xcode.framework/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/xcode.framework/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.framework/src/test.m b/xmake/templates/objc/xcode.framework/src/test.m deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc/xcode.framework/src/test.m +++ /dev/null @@ -1,5 +0,0 @@ -#include "test.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/objc/xcode.framework/xmake.lua b/xmake/templates/objc/xcode.framework/xmake.lua deleted file mode 100644 index 83ddfa1a2..000000000 --- a/xmake/templates/objc/xcode.framework/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.framework") - add_files("src/*.m") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h deleted file mode 100644 index b01a8dc72..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - - -@end - diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m deleted file mode 100644 index 0ad500bfe..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// AppDelegate.m -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - return YES; -} - - -#pragma mark - UISceneSession lifecycle - - -- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; -} - - -- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. -} - - -@end 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 deleted file mode 100644 index d8db8d65f..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329f..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard deleted file mode 100644 index 808a21ce7..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/xcode.iosapp/src/Info.plist b/xmake/templates/objc/xcode.iosapp/src/Info.plist deleted file mode 100644 index 686d21a3a..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/Info.plist +++ /dev/null @@ -1,66 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundleDisplayName - $(PRODUCT_DISPLAY_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - SceneDelegate - UISceneStoryboardFile - Main - - - - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h deleted file mode 100644 index 5dbf88aa6..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SceneDelegate.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface SceneDelegate : UIResponder - -@property (strong, nonatomic) UIWindow * window; - -@end - diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m deleted file mode 100644 index d6698dd7c..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m +++ /dev/null @@ -1,50 +0,0 @@ -#import "SceneDelegate.h" - -@interface SceneDelegate () - -@end - -@implementation SceneDelegate - - -- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). -} - - -- (void)sceneDidDisconnect:(UIScene *)scene { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). -} - - -- (void)sceneDidBecomeActive:(UIScene *)scene { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. -} - - -- (void)sceneWillResignActive:(UIScene *)scene { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). -} - - -- (void)sceneWillEnterForeground:(UIScene *)scene { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. -} - - -- (void)sceneDidEnterBackground:(UIScene *)scene { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. -} - - -@end diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.h b/xmake/templates/objc/xcode.iosapp/src/ViewController.h deleted file mode 100644 index e74d2f236..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.m b/xmake/templates/objc/xcode.iosapp/src/ViewController.m deleted file mode 100644 index c3441c87a..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/ViewController.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.m -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. -} - - -@end diff --git a/xmake/templates/objc/xcode.iosapp/src/main.m b/xmake/templates/objc/xcode.iosapp/src/main.m deleted file mode 100644 index 11a58afc7..000000000 --- a/xmake/templates/objc/xcode.iosapp/src/main.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// main.m -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - NSString * appDelegateClassName; - @autoreleasepool { - // Setup code that might create autoreleased objects goes here. - appDelegateClassName = NSStringFromClass([AppDelegate class]); - } - return UIApplicationMain(argc, argv, nil, appDelegateClassName); -} diff --git a/xmake/templates/objc/xcode.iosapp/xmake.lua b/xmake/templates/objc/xcode.iosapp/xmake.lua deleted file mode 100644 index 1306fce94..000000000 --- a/xmake/templates/objc/xcode.iosapp/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.application") - add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") - add_files("src/Info.plist") 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 deleted file mode 100644 index b01a8dc72..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface AppDelegate : UIResponder - - -@end - 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 deleted file mode 100644 index 1f3556c06..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// AppDelegate.m -// test -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "AppDelegate.h" -#import - -@interface AppDelegate () - -@end - -@implementation AppDelegate - - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Override point for customization after application launch. - int c = add(1, 2); - NSLog(@"result: %d", c); - return YES; -} - - -#pragma mark - UISceneSession lifecycle - - -- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { - // Called when a new scene session is being created. - // Use this method to select a configuration to create the new scene with. - return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; -} - - -- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { - // Called when the user discards a scene session. - // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. - // Use this method to release any resources that were specific to the discarded scenes, as they will not return. -} - - -@end - 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 deleted file mode 100644 index d8db8d65f..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file 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 deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file 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 deleted file mode 100644 index 865e9329f..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 808a21ce7..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index 686d21a3a..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist +++ /dev/null @@ -1,66 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundleDisplayName - $(PRODUCT_DISPLAY_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIApplicationSceneManifest - - UIApplicationSupportsMultipleScenes - - UISceneConfigurations - - UIWindowSceneSessionRoleApplication - - - UISceneConfigurationName - Default Configuration - UISceneDelegateClassName - SceneDelegate - UISceneStoryboardFile - Main - - - - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - 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 deleted file mode 100644 index 5dbf88aa6..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// SceneDelegate.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface SceneDelegate : UIResponder - -@property (strong, nonatomic) UIWindow * window; - -@end - 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 deleted file mode 100644 index d6698dd7c..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m +++ /dev/null @@ -1,50 +0,0 @@ -#import "SceneDelegate.h" - -@interface SceneDelegate () - -@end - -@implementation SceneDelegate - - -- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { - // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. - // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. - // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). -} - - -- (void)sceneDidDisconnect:(UIScene *)scene { - // Called as the scene is being released by the system. - // This occurs shortly after the scene enters the background, or when its session is discarded. - // Release any resources associated with this scene that can be re-created the next time the scene connects. - // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). -} - - -- (void)sceneDidBecomeActive:(UIScene *)scene { - // Called when the scene has moved from an inactive state to an active state. - // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. -} - - -- (void)sceneWillResignActive:(UIScene *)scene { - // Called when the scene will move from an active state to an inactive state. - // This may occur due to temporary interruptions (ex. an incoming phone call). -} - - -- (void)sceneWillEnterForeground:(UIScene *)scene { - // Called as the scene transitions from the background to the foreground. - // Use this method to undo the changes made on entering the background. -} - - -- (void)sceneDidEnterBackground:(UIScene *)scene { - // Called as the scene transitions from the foreground to the background. - // Use this method to save data, release shared resources, and store enough scene-specific state information - // to restore the scene back to its current state. -} - - -@end 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 deleted file mode 100644 index e74d2f236..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface ViewController : UIViewController - - -@end - 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 deleted file mode 100644 index c3441c87a..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m +++ /dev/null @@ -1,23 +0,0 @@ -// -// ViewController.m -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. -} - - -@end 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 deleted file mode 100644 index 11a58afc7..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// main.m -// test5 -// -// Created by ruki on 2020/4/8. -// Copyright © 2020 tboox. All rights reserved. -// - -#import -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - NSString * appDelegateClassName; - @autoreleasepool { - // Setup code that might create autoreleased objects goes here. - appDelegateClassName = NSStringFromClass([AppDelegate class]); - } - return UIApplicationMain(argc, argv, nil, appDelegateClassName); -} 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 deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - 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 deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); 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 deleted file mode 100644 index 71214544b..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m +++ /dev/null @@ -1,9 +0,0 @@ -#import "test.h" -#import - -int add(int a, int b) -{ - NSLog(@"add(%d, %d)", a, b); - return a + b; -} - diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua b/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua deleted file mode 100644 index e1383b8b2..000000000 --- a/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("test") - add_rules("xcode.framework") - add_files("src/framework/test.m") - add_files("src/framework/Info.plist") - add_headerfiles("src/framework/test.h") - -target("${TARGET_NAME}") - add_rules("xcode.application") - add_deps("test") - add_files("src/app/*.m", "src/app/**.storyboard", "src/app/*.xcassets") - add_files("src/app/Info.plist") diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.h b/xmake/templates/objc/xcode.macapp/src/AppDelegate.h deleted file mode 100644 index 5f5ba059e..000000000 --- a/xmake/templates/objc/xcode.macapp/src/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface AppDelegate : NSObject - - -@end - diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.m b/xmake/templates/objc/xcode.macapp/src/AppDelegate.m deleted file mode 100644 index da967d2ef..000000000 --- a/xmake/templates/objc/xcode.macapp/src/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// AppDelegate.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "AppDelegate.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application -} - - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - // Insert code here to tear down your application -} - - -@end 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 deleted file mode 100644 index 2db2b1c7c..000000000 --- a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard deleted file mode 100644 index 7a6d659a5..000000000 --- a/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard +++ /dev/null @@ -1,717 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/xcode.macapp/src/Info.plist b/xmake/templates/objc/xcode.macapp/src/Info.plist deleted file mode 100644 index ce53d780c..000000000 --- a/xmake/templates/objc/xcode.macapp/src/Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundleDisplayName - $(PRODUCT_DISPLAY_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - NSMainStoryboardFile - Main - NSPrincipalClass - NSApplication - NSSupportsAutomaticTermination - - NSSupportsSuddenTermination - - - diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.h b/xmake/templates/objc/xcode.macapp/src/ViewController.h deleted file mode 100644 index a974fc934..000000000 --- a/xmake/templates/objc/xcode.macapp/src/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface ViewController : NSViewController - - -@end - diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.m b/xmake/templates/objc/xcode.macapp/src/ViewController.m deleted file mode 100644 index bccdf6189..000000000 --- a/xmake/templates/objc/xcode.macapp/src/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "ViewController.h" - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Do any additional setup after loading the view. -} - - -- (void)setRepresentedObject:(id)representedObject { - [super setRepresentedObject:representedObject]; - - // Update the view, if already loaded. -} - - -@end diff --git a/xmake/templates/objc/xcode.macapp/src/main.m b/xmake/templates/objc/xcode.macapp/src/main.m deleted file mode 100644 index ae3706f51..000000000 --- a/xmake/templates/objc/xcode.macapp/src/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -int main(int argc, const char * argv[]) { - @autoreleasepool { - // Setup code that might create autoreleased objects goes here. - } - return NSApplicationMain(argc, argv); -} diff --git a/xmake/templates/objc/xcode.macapp/src/test.entitlements b/xmake/templates/objc/xcode.macapp/src/test.entitlements deleted file mode 100644 index f2ef3ae02..000000000 --- a/xmake/templates/objc/xcode.macapp/src/test.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-only - - - diff --git a/xmake/templates/objc/xcode.macapp/xmake.lua b/xmake/templates/objc/xcode.macapp/xmake.lua deleted file mode 100644 index 1306fce94..000000000 --- a/xmake/templates/objc/xcode.macapp/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("xcode.application") - add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") - add_files("src/Info.plist") 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 deleted file mode 100644 index 5f5ba059e..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// AppDelegate.h -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface AppDelegate : NSObject - - -@end - 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 deleted file mode 100644 index 667420c8c..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// AppDelegate.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "AppDelegate.h" -#import - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application - int c = add(1, 2); - NSLog(@"result: %d", c); -} - - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - // Insert code here to tear down your application -} - - -@end 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 deleted file mode 100644 index 2db2b1c7c..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file 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 deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file 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 deleted file mode 100644 index 7a6d659a5..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard +++ /dev/null @@ -1,717 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 deleted file mode 100644 index ce53d780c..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundleDisplayName - $(PRODUCT_DISPLAY_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - NSMainStoryboardFile - Main - NSPrincipalClass - NSApplication - NSSupportsAutomaticTermination - - NSSupportsSuddenTermination - - - 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 deleted file mode 100644 index a974fc934..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// ViewController.h -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -@interface ViewController : NSViewController - - -@end - 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 deleted file mode 100644 index bccdf6189..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import "ViewController.h" - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - // Do any additional setup after loading the view. -} - - -- (void)setRepresentedObject:(id)representedObject { - [super setRepresentedObject:representedObject]; - - // Update the view, if already loaded. -} - - -@end 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 deleted file mode 100644 index ae3706f51..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m +++ /dev/null @@ -1,16 +0,0 @@ -// -// main.m -// test3 -// -// Created by ruki on 2020/4/4. -// Copyright © 2020 tboox. All rights reserved. -// - -#import - -int main(int argc, const char * argv[]) { - @autoreleasepool { - // Setup code that might create autoreleased objects goes here. - } - return NSApplicationMain(argc, argv); -} 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 deleted file mode 100644 index f2ef3ae02..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.files.user-selected.read-only - - - 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 deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 2020 tboox. All rights reserved. - - 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 deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); 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 deleted file mode 100644 index 71214544b..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m +++ /dev/null @@ -1,9 +0,0 @@ -#import "test.h" -#import - -int add(int a, int b) -{ - NSLog(@"add(%d, %d)", a, b); - return a + b; -} - diff --git a/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua b/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua deleted file mode 100644 index e1383b8b2..000000000 --- a/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("test") - add_rules("xcode.framework") - add_files("src/framework/test.m") - add_files("src/framework/Info.plist") - add_headerfiles("src/framework/test.h") - -target("${TARGET_NAME}") - add_rules("xcode.application") - add_deps("test") - add_files("src/app/*.m", "src/app/**.storyboard", "src/app/*.xcassets") - add_files("src/app/Info.plist") diff --git a/xmake/templates/objc/xcode/bundle/src/Info.plist b/xmake/templates/objc/xcode/bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode/bundle/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode/bundle/src/test.h b/xmake/templates/objc/xcode/bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode/bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode/bundle/src/test.m b/xmake/templates/objc/xcode/bundle/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc/xcode/bundle/src/test.m @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc/xcode/bundle/xmake.lua b/xmake/templates/objc/xcode/bundle/xmake.lua new file mode 100644 index 000000000..34d108fcb --- /dev/null +++ b/xmake/templates/objc/xcode/bundle/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.bundle") + add_files("src/*.m") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/xcode/framework/src/Info.plist b/xmake/templates/objc/xcode/framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode/framework/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode/framework/src/test.h b/xmake/templates/objc/xcode/framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode/framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode/framework/src/test.m b/xmake/templates/objc/xcode/framework/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc/xcode/framework/src/test.m @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc/xcode/framework/xmake.lua b/xmake/templates/objc/xcode/framework/xmake.lua new file mode 100644 index 000000000..83ddfa1a2 --- /dev/null +++ b/xmake/templates/objc/xcode/framework/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.framework") + add_files("src/*.m") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m new file mode 100644 index 000000000..0ad500bfe --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end 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 new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/Info.plist b/xmake/templates/objc/xcode/iosapp/src/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/xmake/templates/objc/xcode/iosapp/src/ViewController.h b/xmake/templates/objc/xcode/iosapp/src/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/xmake/templates/objc/xcode/iosapp/src/ViewController.m b/xmake/templates/objc/xcode/iosapp/src/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/xmake/templates/objc/xcode/iosapp/src/main.m b/xmake/templates/objc/xcode/iosapp/src/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/src/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/xmake/templates/objc/xcode/iosapp/xmake.lua b/xmake/templates/objc/xcode/iosapp/xmake.lua new file mode 100644 index 000000000..1306fce94 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") 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 new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + 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 new file mode 100644 index 000000000..1f3556c06 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// test +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" +#import + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + int c = add(1, 2); + NSLog(@"result: %d", c); + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end + 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 new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + 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 new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + 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 new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end 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 new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + 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 new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end 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 new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/app/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} 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 new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + 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 new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); 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 new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/src/framework/test.m @@ -0,0 +1,9 @@ +#import "test.h" +#import + +int add(int a, int b) +{ + NSLog(@"add(%d, %d)", a, b); + return a + b; +} + diff --git a/xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua b/xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua new file mode 100644 index 000000000..e1383b8b2 --- /dev/null +++ b/xmake/templates/objc/xcode/iosapp_with_framework/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("test") + add_rules("xcode.framework") + add_files("src/framework/test.m") + add_files("src/framework/Info.plist") + add_headerfiles("src/framework/test.h") + +target("${TARGET_NAME}") + add_rules("xcode.application") + add_deps("test") + add_files("src/app/*.m", "src/app/**.storyboard", "src/app/*.xcassets") + add_files("src/app/Info.plist") diff --git a/xmake/templates/objc/xcode/macapp/src/AppDelegate.h b/xmake/templates/objc/xcode/macapp/src/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/xmake/templates/objc/xcode/macapp/src/AppDelegate.m b/xmake/templates/objc/xcode/macapp/src/AppDelegate.m new file mode 100644 index 000000000..da967d2ef --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/AppDelegate.m @@ -0,0 +1,27 @@ +// +// AppDelegate.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end 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 new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode/macapp/src/Info.plist b/xmake/templates/objc/xcode/macapp/src/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/xmake/templates/objc/xcode/macapp/src/ViewController.h b/xmake/templates/objc/xcode/macapp/src/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/xmake/templates/objc/xcode/macapp/src/ViewController.m b/xmake/templates/objc/xcode/macapp/src/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/xmake/templates/objc/xcode/macapp/src/main.m b/xmake/templates/objc/xcode/macapp/src/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/main.m @@ -0,0 +1,16 @@ +// +// main.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/xmake/templates/objc/xcode/macapp/src/test.entitlements b/xmake/templates/objc/xcode/macapp/src/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/src/test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/xmake/templates/objc/xcode/macapp/xmake.lua b/xmake/templates/objc/xcode/macapp/xmake.lua new file mode 100644 index 000000000..1306fce94 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") 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 new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + 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 new file mode 100644 index 000000000..667420c8c --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m @@ -0,0 +1,30 @@ +// +// AppDelegate.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" +#import + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application + int c = add(1, 2); + NSLog(@"result: %d", c); +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end 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 new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file 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 new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + 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 new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + 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 new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end 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 new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/main.m @@ -0,0 +1,16 @@ +// +// main.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} 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 new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + 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 new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + 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 new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); 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 new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/src/framework/test.m @@ -0,0 +1,9 @@ +#import "test.h" +#import + +int add(int a, int b) +{ + NSLog(@"add(%d, %d)", a, b); + return a + b; +} + diff --git a/xmake/templates/objc/xcode/macapp_with_framework/xmake.lua b/xmake/templates/objc/xcode/macapp_with_framework/xmake.lua new file mode 100644 index 000000000..e1383b8b2 --- /dev/null +++ b/xmake/templates/objc/xcode/macapp_with_framework/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("test") + add_rules("xcode.framework") + add_files("src/framework/test.m") + add_files("src/framework/Info.plist") + add_headerfiles("src/framework/test.h") + +target("${TARGET_NAME}") + add_rules("xcode.application") + add_deps("test") + add_files("src/app/*.m", "src/app/**.storyboard", "src/app/*.xcassets") + add_files("src/app/Info.plist") -- cgit v1.3.1