From 078b2ee0b6087a70bae05d3fa86d01078786513c Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 4 Mar 2026 00:40:11 +0800 Subject: move templates to repository --- xmake/actions/create/template.lua | 7 +- .../repository/templates/c++/console/src/main.cpp | 6 + xmake/repository/templates/c++/console/xmake.lua | 7 + .../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 + .../templates/c++/module/binary/src/main.cpp | 6 + .../templates/c++/module/binary/xmake.lua | 15 + .../templates/c++/module/shared/.gitignore | 8 + .../module/shared/modules/shared/foo/src/foo.cpp | 22 + .../c++/module/shared/modules/shared/foo/xmake.lua | 6 + .../templates/c++/module/shared/src/main.cpp | 6 + .../templates/c++/module/shared/xmake.lua | 15 + .../templates/c++/qt/console/src/main.cpp | 7 + .../repository/templates/c++/qt/console/xmake.lua | 7 + .../templates/c++/qt/quickapp/src/main.cpp | 17 + .../templates/c++/qt/quickapp/src/main.qml | 18 + .../templates/c++/qt/quickapp/src/qml.qrc | 5 + .../repository/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 + .../templates/c++/qt/quickapp_static/src/qml.qrc | 5 + .../templates/c++/qt/quickapp_static/xmake.lua | 16 + .../templates/c++/qt/shared/src/demo.cpp | 4 + .../repository/templates/c++/qt/shared/src/demo.h | 11 + .../templates/c++/qt/shared/src/demo_global.h | 12 + xmake/repository/templates/c++/qt/shared/xmake.lua | 10 + .../templates/c++/qt/static/src/demo.cpp | 4 + .../repository/templates/c++/qt/static/src/demo.h | 9 + xmake/repository/templates/c++/qt/static/xmake.lua | 9 + .../templates/c++/qt/widgetapp/src/main.cpp | 9 + .../templates/c++/qt/widgetapp/src/mainwindow.cpp | 10 + .../templates/c++/qt/widgetapp/src/mainwindow.h | 21 + .../templates/c++/qt/widgetapp/src/mainwindow.ui | 24 + .../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 + .../templates/c++/qt/widgetapp_static/xmake.lua | 18 + xmake/repository/templates/c++/shared/src/foo.cpp | 5 + xmake/repository/templates/c++/shared/src/foo.h | 17 + xmake/repository/templates/c++/shared/src/main.cpp | 7 + xmake/repository/templates/c++/shared/xmake.lua | 12 + xmake/repository/templates/c++/static/src/foo.cpp | 5 + xmake/repository/templates/c++/static/src/foo.h | 9 + xmake/repository/templates/c++/static/src/main.cpp | 7 + xmake/repository/templates/c++/static/xmake.lua | 12 + .../templates/c++/wxwidgets/src/main.cpp | 48 ++ xmake/repository/templates/c++/wxwidgets/xmake.lua | 11 + .../templates/c++/xmake/cli/src/lni/main.cpp | 23 + .../templates/c++/xmake/cli/src/lua/main.lua | 10 + xmake/repository/templates/c++/xmake/cli/xmake.lua | 12 + xmake/repository/templates/c/console/src/main.c | 6 + xmake/repository/templates/c/console/xmake.lua | 7 + .../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 + .../templates/c/module/binary/src/main.c | 6 + .../repository/templates/c/module/binary/xmake.lua | 15 + .../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 + .../templates/c/module/shared/src/main.c | 6 + .../repository/templates/c/module/shared/xmake.lua | 15 + xmake/repository/templates/c/shared/src/foo.c | 5 + xmake/repository/templates/c/shared/src/foo.h | 9 + xmake/repository/templates/c/shared/src/main.c | 7 + xmake/repository/templates/c/shared/xmake.lua | 12 + xmake/repository/templates/c/static/src/foo.c | 5 + xmake/repository/templates/c/static/src/foo.h | 1 + xmake/repository/templates/c/static/src/main.c | 7 + xmake/repository/templates/c/static/xmake.lua | 12 + .../templates/c/xmake/cli/src/lni/main.c | 21 + .../templates/c/xmake/cli/src/lua/main.lua | 10 + xmake/repository/templates/c/xmake/cli/xmake.lua | 11 + .../repository/templates/cuda/console/src/main.cu | 132 ++++ xmake/repository/templates/cuda/console/xmake.lua | 19 + xmake/repository/templates/cuda/shared/inc/lib.cuh | 22 + xmake/repository/templates/cuda/shared/src/lib.cu | 98 +++ xmake/repository/templates/cuda/shared/xmake.lua | 20 + xmake/repository/templates/cuda/static/inc/lib.cuh | 3 + xmake/repository/templates/cuda/static/src/lib.cu | 7 + xmake/repository/templates/cuda/static/xmake.lua | 20 + .../repository/templates/dlang/console/src/main.d | 5 + xmake/repository/templates/dlang/console/xmake.lua | 7 + .../templates/dlang/shared/src/interfaces.d | 15 + xmake/repository/templates/dlang/shared/src/main.d | 7 + xmake/repository/templates/dlang/shared/xmake.lua | 16 + .../templates/dlang/static/src/interfaces.d | 9 + xmake/repository/templates/dlang/static/src/main.d | 7 + xmake/repository/templates/dlang/static/xmake.lua | 13 + .../templates/fortran/console/src/main.f90 | 3 + .../repository/templates/fortran/console/xmake.lua | 6 + .../templates/fortran/shared/src/main.f90 | 5 + .../templates/fortran/shared/src/test.f90 | 8 + .../repository/templates/fortran/shared/xmake.lua | 11 + .../templates/fortran/static/src/main.f90 | 5 + .../templates/fortran/static/src/test.f90 | 8 + .../repository/templates/fortran/static/xmake.lua | 11 + xmake/repository/templates/go/console/src/main.go | 7 + xmake/repository/templates/go/console/xmake.lua | 7 + xmake/repository/templates/go/static/src/main.go | 7 + .../templates/go/static/src/module/add.go | 6 + .../templates/go/static/src/module/sub.go | 6 + xmake/repository/templates/go/static/src/test.go | 12 + xmake/repository/templates/go/static/xmake.lua | 12 + .../templates/kotlin/console/src/main.kt | 3 + .../repository/templates/kotlin/console/xmake.lua | 10 + .../repository/templates/kotlin/shared/src/foo.kt | 2 + .../repository/templates/kotlin/shared/src/main.c | 7 + xmake/repository/templates/kotlin/shared/xmake.lua | 13 + .../repository/templates/kotlin/static/src/foo.kt | 2 + .../repository/templates/kotlin/static/src/main.c | 7 + xmake/repository/templates/kotlin/static/xmake.lua | 13 + .../repository/templates/nim/console/src/main.nim | 1 + xmake/repository/templates/nim/console/xmake.lua | 7 + xmake/repository/templates/nim/shared/src/foo.nim | 6 + xmake/repository/templates/nim/shared/src/main.nim | 3 + xmake/repository/templates/nim/shared/xmake.lua | 14 + xmake/repository/templates/nim/static/src/foo.nim | 6 + xmake/repository/templates/nim/static/src/main.nim | 3 + xmake/repository/templates/nim/static/xmake.lua | 14 + .../templates/objc++/console/src/main.mm | 8 + .../repository/templates/objc++/console/xmake.lua | 13 + .../templates/objc++/xcode/bundle/src/Info.plist | 24 + .../templates/objc++/xcode/bundle/src/test.h | 3 + .../templates/objc++/xcode/bundle/src/test.mm | 5 + .../templates/objc++/xcode/bundle/xmake.lua | 9 + .../objc++/xcode/framework/src/Info.plist | 24 + .../templates/objc++/xcode/framework/src/test.h | 3 + .../templates/objc++/xcode/framework/src/test.mm | 5 + .../templates/objc++/xcode/framework/xmake.lua | 9 + xmake/repository/templates/objc/console/src/main.m | 8 + xmake/repository/templates/objc/console/xmake.lua | 13 + .../templates/objc/xcode/bundle/src/Info.plist | 24 + .../templates/objc/xcode/bundle/src/test.h | 3 + .../templates/objc/xcode/bundle/src/test.m | 5 + .../templates/objc/xcode/bundle/xmake.lua | 9 + .../templates/objc/xcode/framework/src/Info.plist | 24 + .../templates/objc/xcode/framework/src/test.h | 3 + .../templates/objc/xcode/framework/src/test.m | 5 + .../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 + .../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 + .../templates/objc/xcode/iosapp/src/main.m | 19 + .../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 +++++++++++++++++++++ .../templates/objc/xcode/macapp/src/Info.plist | 38 ++ .../objc/xcode/macapp/src/ViewController.h | 15 + .../objc/xcode/macapp/src/ViewController.m | 27 + .../templates/objc/xcode/macapp/src/main.m | 16 + .../objc/xcode/macapp/src/test.entitlements | 10 + .../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 + .../templates/pascal/console/src/main.pas | 4 + .../repository/templates/pascal/console/xmake.lua | 7 + .../repository/templates/pascal/shared/src/foo.pas | 19 + .../templates/pascal/shared/src/main.pas | 13 + xmake/repository/templates/pascal/shared/xmake.lua | 12 + .../repository/templates/rust/console/src/main.rs | 3 + xmake/repository/templates/rust/console/xmake.lua | 7 + xmake/repository/templates/rust/shared/src/foo.rs | 4 + xmake/repository/templates/rust/shared/src/main.rs | 6 + xmake/repository/templates/rust/shared/xmake.lua | 10 + xmake/repository/templates/rust/static/src/foo.rs | 4 + xmake/repository/templates/rust/static/src/main.rs | 6 + xmake/repository/templates/rust/static/xmake.lua | 10 + .../templates/swift/console/src/main.swift | 3 + xmake/repository/templates/swift/console/xmake.lua | 13 + .../templates/vala/console/src/main.vala | 21 + xmake/repository/templates/vala/console/xmake.lua | 12 + .../repository/templates/vala/shared/src/main.vala | 6 + .../templates/vala/shared/src/mymath.vala | 9 + xmake/repository/templates/vala/shared/xmake.lua | 18 + .../repository/templates/vala/static/src/main.vala | 6 + .../templates/vala/static/src/mymath.vala | 9 + xmake/repository/templates/vala/static/xmake.lua | 18 + .../repository/templates/zig/console/src/main.zig | 5 + xmake/repository/templates/zig/console/xmake.lua | 7 + xmake/repository/templates/zig/shared/src/main.zig | 7 + xmake/repository/templates/zig/shared/src/test.zig | 3 + xmake/repository/templates/zig/shared/xmake.lua | 12 + xmake/repository/templates/zig/static/src/main.zig | 7 + xmake/repository/templates/zig/static/src/test.zig | 3 + xmake/repository/templates/zig/static/xmake.lua | 12 + xmake/templates/c++/console/src/main.cpp | 6 - xmake/templates/c++/console/xmake.lua | 7 - 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++/shared/src/foo.cpp | 5 - xmake/templates/c++/shared/src/foo.h | 17 - xmake/templates/c++/shared/src/main.cpp | 7 - xmake/templates/c++/shared/xmake.lua | 12 - xmake/templates/c++/static/src/foo.cpp | 5 - xmake/templates/c++/static/src/foo.h | 9 - xmake/templates/c++/static/src/main.cpp | 7 - xmake/templates/c++/static/xmake.lua | 12 - xmake/templates/c++/wxwidgets/src/main.cpp | 48 -- xmake/templates/c++/wxwidgets/xmake.lua | 11 - 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/console/src/main.c | 6 - xmake/templates/c/console/xmake.lua | 7 - 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/shared/src/foo.c | 5 - xmake/templates/c/shared/src/foo.h | 9 - xmake/templates/c/shared/src/main.c | 7 - xmake/templates/c/shared/xmake.lua | 12 - xmake/templates/c/static/src/foo.c | 5 - xmake/templates/c/static/src/foo.h | 1 - xmake/templates/c/static/src/main.c | 7 - xmake/templates/c/static/xmake.lua | 12 - 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/cuda/console/src/main.cu | 132 ---- xmake/templates/cuda/console/xmake.lua | 19 - xmake/templates/cuda/shared/inc/lib.cuh | 22 - xmake/templates/cuda/shared/src/lib.cu | 98 --- xmake/templates/cuda/shared/xmake.lua | 20 - xmake/templates/cuda/static/inc/lib.cuh | 3 - xmake/templates/cuda/static/src/lib.cu | 7 - xmake/templates/cuda/static/xmake.lua | 20 - xmake/templates/dlang/console/src/main.d | 5 - xmake/templates/dlang/console/xmake.lua | 7 - xmake/templates/dlang/shared/src/interfaces.d | 15 - xmake/templates/dlang/shared/src/main.d | 7 - xmake/templates/dlang/shared/xmake.lua | 16 - xmake/templates/dlang/static/src/interfaces.d | 9 - xmake/templates/dlang/static/src/main.d | 7 - xmake/templates/dlang/static/xmake.lua | 13 - xmake/templates/fortran/console/src/main.f90 | 3 - xmake/templates/fortran/console/xmake.lua | 6 - xmake/templates/fortran/shared/src/main.f90 | 5 - xmake/templates/fortran/shared/src/test.f90 | 8 - xmake/templates/fortran/shared/xmake.lua | 11 - xmake/templates/fortran/static/src/main.f90 | 5 - xmake/templates/fortran/static/src/test.f90 | 8 - xmake/templates/fortran/static/xmake.lua | 11 - xmake/templates/go/console/src/main.go | 7 - xmake/templates/go/console/xmake.lua | 7 - xmake/templates/go/static/src/main.go | 7 - xmake/templates/go/static/src/module/add.go | 6 - xmake/templates/go/static/src/module/sub.go | 6 - xmake/templates/go/static/src/test.go | 12 - xmake/templates/go/static/xmake.lua | 12 - xmake/templates/kotlin/console/src/main.kt | 3 - xmake/templates/kotlin/console/xmake.lua | 10 - xmake/templates/kotlin/shared/src/foo.kt | 2 - xmake/templates/kotlin/shared/src/main.c | 7 - xmake/templates/kotlin/shared/xmake.lua | 13 - xmake/templates/kotlin/static/src/foo.kt | 2 - xmake/templates/kotlin/static/src/main.c | 7 - xmake/templates/kotlin/static/xmake.lua | 13 - xmake/templates/nim/console/src/main.nim | 1 - xmake/templates/nim/console/xmake.lua | 7 - xmake/templates/nim/shared/src/foo.nim | 6 - xmake/templates/nim/shared/src/main.nim | 3 - xmake/templates/nim/shared/xmake.lua | 14 - xmake/templates/nim/static/src/foo.nim | 6 - xmake/templates/nim/static/src/main.nim | 3 - xmake/templates/nim/static/xmake.lua | 14 - xmake/templates/objc++/console/src/main.mm | 8 - xmake/templates/objc++/console/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.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/console/src/main.m | 8 - xmake/templates/objc/console/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 - xmake/templates/pascal/console/src/main.pas | 4 - xmake/templates/pascal/console/xmake.lua | 7 - xmake/templates/pascal/shared/src/foo.pas | 19 - xmake/templates/pascal/shared/src/main.pas | 13 - xmake/templates/pascal/shared/xmake.lua | 12 - xmake/templates/rust/console/src/main.rs | 3 - xmake/templates/rust/console/xmake.lua | 7 - xmake/templates/rust/shared/src/foo.rs | 4 - xmake/templates/rust/shared/src/main.rs | 6 - xmake/templates/rust/shared/xmake.lua | 10 - xmake/templates/rust/static/src/foo.rs | 4 - xmake/templates/rust/static/src/main.rs | 6 - xmake/templates/rust/static/xmake.lua | 10 - xmake/templates/swift/console/src/main.swift | 3 - xmake/templates/swift/console/xmake.lua | 13 - xmake/templates/vala/console/src/main.vala | 21 - xmake/templates/vala/console/xmake.lua | 12 - xmake/templates/vala/shared/src/main.vala | 6 - xmake/templates/vala/shared/src/mymath.vala | 9 - xmake/templates/vala/shared/xmake.lua | 18 - xmake/templates/vala/static/src/main.vala | 6 - xmake/templates/vala/static/src/mymath.vala | 9 - xmake/templates/vala/static/xmake.lua | 18 - xmake/templates/zig/console/src/main.zig | 5 - xmake/templates/zig/console/xmake.lua | 7 - xmake/templates/zig/shared/src/main.zig | 7 - xmake/templates/zig/shared/src/test.zig | 3 - xmake/templates/zig/shared/xmake.lua | 12 - xmake/templates/zig/static/src/main.zig | 7 - xmake/templates/zig/static/src/test.zig | 3 - xmake/templates/zig/static/xmake.lua | 12 - 463 files changed, 4763 insertions(+), 4768 deletions(-) create mode 100644 xmake/repository/templates/c++/console/src/main.cpp create mode 100644 xmake/repository/templates/c++/console/xmake.lua create mode 100644 xmake/repository/templates/c++/module/binary/.gitignore create mode 100644 xmake/repository/templates/c++/module/binary/modules/binary/bar/.gitignore create mode 100644 xmake/repository/templates/c++/module/binary/modules/binary/bar/src/add.cpp create mode 100644 xmake/repository/templates/c++/module/binary/modules/binary/bar/src/sub.cpp create mode 100644 xmake/repository/templates/c++/module/binary/modules/binary/bar/xmake.lua create mode 100644 xmake/repository/templates/c++/module/binary/src/main.cpp create mode 100644 xmake/repository/templates/c++/module/binary/xmake.lua create mode 100644 xmake/repository/templates/c++/module/shared/.gitignore create mode 100644 xmake/repository/templates/c++/module/shared/modules/shared/foo/src/foo.cpp create mode 100644 xmake/repository/templates/c++/module/shared/modules/shared/foo/xmake.lua create mode 100644 xmake/repository/templates/c++/module/shared/src/main.cpp create mode 100644 xmake/repository/templates/c++/module/shared/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/console/src/main.cpp create mode 100644 xmake/repository/templates/c++/qt/console/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/quickapp/src/main.cpp create mode 100644 xmake/repository/templates/c++/qt/quickapp/src/main.qml create mode 100644 xmake/repository/templates/c++/qt/quickapp/src/qml.qrc create mode 100644 xmake/repository/templates/c++/qt/quickapp/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/quickapp_static/src/main.cpp create mode 100644 xmake/repository/templates/c++/qt/quickapp_static/src/main.qml create mode 100644 xmake/repository/templates/c++/qt/quickapp_static/src/qml.qrc create mode 100644 xmake/repository/templates/c++/qt/quickapp_static/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/shared/src/demo.cpp create mode 100644 xmake/repository/templates/c++/qt/shared/src/demo.h create mode 100644 xmake/repository/templates/c++/qt/shared/src/demo_global.h create mode 100644 xmake/repository/templates/c++/qt/shared/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/static/src/demo.cpp create mode 100644 xmake/repository/templates/c++/qt/static/src/demo.h create mode 100644 xmake/repository/templates/c++/qt/static/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/widgetapp/src/main.cpp create mode 100644 xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.cpp create mode 100644 xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.h create mode 100644 xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.ui create mode 100644 xmake/repository/templates/c++/qt/widgetapp/xmake.lua create mode 100644 xmake/repository/templates/c++/qt/widgetapp_static/src/main.cpp create mode 100644 xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.cpp create mode 100644 xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.h create mode 100644 xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.ui create mode 100644 xmake/repository/templates/c++/qt/widgetapp_static/xmake.lua create mode 100644 xmake/repository/templates/c++/shared/src/foo.cpp create mode 100644 xmake/repository/templates/c++/shared/src/foo.h create mode 100644 xmake/repository/templates/c++/shared/src/main.cpp create mode 100644 xmake/repository/templates/c++/shared/xmake.lua create mode 100644 xmake/repository/templates/c++/static/src/foo.cpp create mode 100644 xmake/repository/templates/c++/static/src/foo.h create mode 100644 xmake/repository/templates/c++/static/src/main.cpp create mode 100644 xmake/repository/templates/c++/static/xmake.lua create mode 100644 xmake/repository/templates/c++/wxwidgets/src/main.cpp create mode 100644 xmake/repository/templates/c++/wxwidgets/xmake.lua create mode 100644 xmake/repository/templates/c++/xmake/cli/src/lni/main.cpp create mode 100644 xmake/repository/templates/c++/xmake/cli/src/lua/main.lua create mode 100644 xmake/repository/templates/c++/xmake/cli/xmake.lua create mode 100644 xmake/repository/templates/c/console/src/main.c create mode 100644 xmake/repository/templates/c/console/xmake.lua create mode 100644 xmake/repository/templates/c/module/binary/.gitignore create mode 100644 xmake/repository/templates/c/module/binary/modules/binary/bar/.gitignore create mode 100644 xmake/repository/templates/c/module/binary/modules/binary/bar/src/add.c create mode 100644 xmake/repository/templates/c/module/binary/modules/binary/bar/src/sub.c create mode 100644 xmake/repository/templates/c/module/binary/modules/binary/bar/xmake.lua create mode 100644 xmake/repository/templates/c/module/binary/src/main.c create mode 100644 xmake/repository/templates/c/module/binary/xmake.lua create mode 100644 xmake/repository/templates/c/module/shared/.gitignore create mode 100644 xmake/repository/templates/c/module/shared/modules/shared/foo/src/foo.c create mode 100644 xmake/repository/templates/c/module/shared/modules/shared/foo/xmake.lua create mode 100644 xmake/repository/templates/c/module/shared/src/main.c create mode 100644 xmake/repository/templates/c/module/shared/xmake.lua create mode 100644 xmake/repository/templates/c/shared/src/foo.c create mode 100644 xmake/repository/templates/c/shared/src/foo.h create mode 100644 xmake/repository/templates/c/shared/src/main.c create mode 100644 xmake/repository/templates/c/shared/xmake.lua create mode 100644 xmake/repository/templates/c/static/src/foo.c create mode 100644 xmake/repository/templates/c/static/src/foo.h create mode 100644 xmake/repository/templates/c/static/src/main.c create mode 100644 xmake/repository/templates/c/static/xmake.lua create mode 100644 xmake/repository/templates/c/xmake/cli/src/lni/main.c create mode 100644 xmake/repository/templates/c/xmake/cli/src/lua/main.lua create mode 100644 xmake/repository/templates/c/xmake/cli/xmake.lua create mode 100644 xmake/repository/templates/cuda/console/src/main.cu create mode 100644 xmake/repository/templates/cuda/console/xmake.lua create mode 100644 xmake/repository/templates/cuda/shared/inc/lib.cuh create mode 100644 xmake/repository/templates/cuda/shared/src/lib.cu create mode 100644 xmake/repository/templates/cuda/shared/xmake.lua create mode 100644 xmake/repository/templates/cuda/static/inc/lib.cuh create mode 100644 xmake/repository/templates/cuda/static/src/lib.cu create mode 100644 xmake/repository/templates/cuda/static/xmake.lua create mode 100644 xmake/repository/templates/dlang/console/src/main.d create mode 100644 xmake/repository/templates/dlang/console/xmake.lua create mode 100644 xmake/repository/templates/dlang/shared/src/interfaces.d create mode 100644 xmake/repository/templates/dlang/shared/src/main.d create mode 100644 xmake/repository/templates/dlang/shared/xmake.lua create mode 100644 xmake/repository/templates/dlang/static/src/interfaces.d create mode 100644 xmake/repository/templates/dlang/static/src/main.d create mode 100644 xmake/repository/templates/dlang/static/xmake.lua create mode 100644 xmake/repository/templates/fortran/console/src/main.f90 create mode 100644 xmake/repository/templates/fortran/console/xmake.lua create mode 100644 xmake/repository/templates/fortran/shared/src/main.f90 create mode 100644 xmake/repository/templates/fortran/shared/src/test.f90 create mode 100644 xmake/repository/templates/fortran/shared/xmake.lua create mode 100644 xmake/repository/templates/fortran/static/src/main.f90 create mode 100644 xmake/repository/templates/fortran/static/src/test.f90 create mode 100644 xmake/repository/templates/fortran/static/xmake.lua create mode 100644 xmake/repository/templates/go/console/src/main.go create mode 100644 xmake/repository/templates/go/console/xmake.lua create mode 100644 xmake/repository/templates/go/static/src/main.go create mode 100644 xmake/repository/templates/go/static/src/module/add.go create mode 100644 xmake/repository/templates/go/static/src/module/sub.go create mode 100644 xmake/repository/templates/go/static/src/test.go create mode 100644 xmake/repository/templates/go/static/xmake.lua create mode 100644 xmake/repository/templates/kotlin/console/src/main.kt create mode 100644 xmake/repository/templates/kotlin/console/xmake.lua create mode 100644 xmake/repository/templates/kotlin/shared/src/foo.kt create mode 100644 xmake/repository/templates/kotlin/shared/src/main.c create mode 100644 xmake/repository/templates/kotlin/shared/xmake.lua create mode 100644 xmake/repository/templates/kotlin/static/src/foo.kt create mode 100644 xmake/repository/templates/kotlin/static/src/main.c create mode 100644 xmake/repository/templates/kotlin/static/xmake.lua create mode 100644 xmake/repository/templates/nim/console/src/main.nim create mode 100644 xmake/repository/templates/nim/console/xmake.lua create mode 100644 xmake/repository/templates/nim/shared/src/foo.nim create mode 100644 xmake/repository/templates/nim/shared/src/main.nim create mode 100644 xmake/repository/templates/nim/shared/xmake.lua create mode 100644 xmake/repository/templates/nim/static/src/foo.nim create mode 100644 xmake/repository/templates/nim/static/src/main.nim create mode 100644 xmake/repository/templates/nim/static/xmake.lua create mode 100644 xmake/repository/templates/objc++/console/src/main.mm create mode 100644 xmake/repository/templates/objc++/console/xmake.lua create mode 100644 xmake/repository/templates/objc++/xcode/bundle/src/Info.plist create mode 100644 xmake/repository/templates/objc++/xcode/bundle/src/test.h create mode 100644 xmake/repository/templates/objc++/xcode/bundle/src/test.mm create mode 100644 xmake/repository/templates/objc++/xcode/bundle/xmake.lua create mode 100644 xmake/repository/templates/objc++/xcode/framework/src/Info.plist create mode 100644 xmake/repository/templates/objc++/xcode/framework/src/test.h create mode 100644 xmake/repository/templates/objc++/xcode/framework/src/test.mm create mode 100644 xmake/repository/templates/objc++/xcode/framework/xmake.lua create mode 100644 xmake/repository/templates/objc/console/src/main.m create mode 100644 xmake/repository/templates/objc/console/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/bundle/src/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/bundle/src/test.h create mode 100644 xmake/repository/templates/objc/xcode/bundle/src/test.m create mode 100644 xmake/repository/templates/objc/xcode/bundle/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/framework/src/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/framework/src/test.h create mode 100644 xmake/repository/templates/objc/xcode/framework/src/test.m create mode 100644 xmake/repository/templates/objc/xcode/framework/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/AppDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/AppDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/SceneDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/SceneDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/ViewController.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/ViewController.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp/src/main.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/main.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.h create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.m create mode 100644 xmake/repository/templates/objc/xcode/iosapp_with_framework/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/AppDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/AppDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/ViewController.h create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/ViewController.m create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/main.m create mode 100644 xmake/repository/templates/objc/xcode/macapp/src/test.entitlements create mode 100644 xmake/repository/templates/objc/xcode/macapp/xmake.lua create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/main.m create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.h create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.m create mode 100644 xmake/repository/templates/objc/xcode/macapp_with_framework/xmake.lua create mode 100644 xmake/repository/templates/pascal/console/src/main.pas create mode 100644 xmake/repository/templates/pascal/console/xmake.lua create mode 100644 xmake/repository/templates/pascal/shared/src/foo.pas create mode 100644 xmake/repository/templates/pascal/shared/src/main.pas create mode 100644 xmake/repository/templates/pascal/shared/xmake.lua create mode 100644 xmake/repository/templates/rust/console/src/main.rs create mode 100644 xmake/repository/templates/rust/console/xmake.lua create mode 100644 xmake/repository/templates/rust/shared/src/foo.rs create mode 100644 xmake/repository/templates/rust/shared/src/main.rs create mode 100644 xmake/repository/templates/rust/shared/xmake.lua create mode 100644 xmake/repository/templates/rust/static/src/foo.rs create mode 100644 xmake/repository/templates/rust/static/src/main.rs create mode 100644 xmake/repository/templates/rust/static/xmake.lua create mode 100644 xmake/repository/templates/swift/console/src/main.swift create mode 100644 xmake/repository/templates/swift/console/xmake.lua create mode 100644 xmake/repository/templates/vala/console/src/main.vala create mode 100644 xmake/repository/templates/vala/console/xmake.lua create mode 100644 xmake/repository/templates/vala/shared/src/main.vala create mode 100644 xmake/repository/templates/vala/shared/src/mymath.vala create mode 100644 xmake/repository/templates/vala/shared/xmake.lua create mode 100644 xmake/repository/templates/vala/static/src/main.vala create mode 100644 xmake/repository/templates/vala/static/src/mymath.vala create mode 100644 xmake/repository/templates/vala/static/xmake.lua create mode 100644 xmake/repository/templates/zig/console/src/main.zig create mode 100644 xmake/repository/templates/zig/console/xmake.lua create mode 100644 xmake/repository/templates/zig/shared/src/main.zig create mode 100644 xmake/repository/templates/zig/shared/src/test.zig create mode 100644 xmake/repository/templates/zig/shared/xmake.lua create mode 100644 xmake/repository/templates/zig/static/src/main.zig create mode 100644 xmake/repository/templates/zig/static/src/test.zig create mode 100644 xmake/repository/templates/zig/static/xmake.lua delete mode 100644 xmake/templates/c++/console/src/main.cpp delete mode 100644 xmake/templates/c++/console/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.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 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 delete mode 100644 xmake/templates/c++/shared/src/foo.cpp delete mode 100644 xmake/templates/c++/shared/src/foo.h delete mode 100644 xmake/templates/c++/shared/src/main.cpp delete mode 100644 xmake/templates/c++/shared/xmake.lua delete mode 100644 xmake/templates/c++/static/src/foo.cpp delete mode 100644 xmake/templates/c++/static/src/foo.h delete mode 100644 xmake/templates/c++/static/src/main.cpp delete mode 100644 xmake/templates/c++/static/xmake.lua delete mode 100644 xmake/templates/c++/wxwidgets/src/main.cpp delete mode 100644 xmake/templates/c++/wxwidgets/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 delete mode 100644 xmake/templates/c/console/src/main.c delete mode 100644 xmake/templates/c/console/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 delete mode 100644 xmake/templates/c/shared/src/foo.c delete mode 100644 xmake/templates/c/shared/src/foo.h delete mode 100644 xmake/templates/c/shared/src/main.c delete mode 100644 xmake/templates/c/shared/xmake.lua delete mode 100644 xmake/templates/c/static/src/foo.c delete mode 100644 xmake/templates/c/static/src/foo.h delete mode 100644 xmake/templates/c/static/src/main.c delete mode 100644 xmake/templates/c/static/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 delete mode 100644 xmake/templates/cuda/console/src/main.cu delete mode 100644 xmake/templates/cuda/console/xmake.lua delete mode 100644 xmake/templates/cuda/shared/inc/lib.cuh delete mode 100644 xmake/templates/cuda/shared/src/lib.cu delete mode 100644 xmake/templates/cuda/shared/xmake.lua delete mode 100644 xmake/templates/cuda/static/inc/lib.cuh delete mode 100644 xmake/templates/cuda/static/src/lib.cu delete mode 100644 xmake/templates/cuda/static/xmake.lua delete mode 100644 xmake/templates/dlang/console/src/main.d delete mode 100644 xmake/templates/dlang/console/xmake.lua delete mode 100644 xmake/templates/dlang/shared/src/interfaces.d delete mode 100644 xmake/templates/dlang/shared/src/main.d delete mode 100644 xmake/templates/dlang/shared/xmake.lua delete mode 100644 xmake/templates/dlang/static/src/interfaces.d delete mode 100644 xmake/templates/dlang/static/src/main.d delete mode 100644 xmake/templates/dlang/static/xmake.lua delete mode 100644 xmake/templates/fortran/console/src/main.f90 delete mode 100644 xmake/templates/fortran/console/xmake.lua delete mode 100644 xmake/templates/fortran/shared/src/main.f90 delete mode 100644 xmake/templates/fortran/shared/src/test.f90 delete mode 100644 xmake/templates/fortran/shared/xmake.lua delete mode 100644 xmake/templates/fortran/static/src/main.f90 delete mode 100644 xmake/templates/fortran/static/src/test.f90 delete mode 100644 xmake/templates/fortran/static/xmake.lua delete mode 100644 xmake/templates/go/console/src/main.go delete mode 100644 xmake/templates/go/console/xmake.lua delete mode 100644 xmake/templates/go/static/src/main.go delete mode 100644 xmake/templates/go/static/src/module/add.go delete mode 100644 xmake/templates/go/static/src/module/sub.go delete mode 100644 xmake/templates/go/static/src/test.go delete mode 100644 xmake/templates/go/static/xmake.lua delete mode 100644 xmake/templates/kotlin/console/src/main.kt delete mode 100644 xmake/templates/kotlin/console/xmake.lua delete mode 100644 xmake/templates/kotlin/shared/src/foo.kt delete mode 100644 xmake/templates/kotlin/shared/src/main.c delete mode 100644 xmake/templates/kotlin/shared/xmake.lua delete mode 100644 xmake/templates/kotlin/static/src/foo.kt delete mode 100644 xmake/templates/kotlin/static/src/main.c delete mode 100644 xmake/templates/kotlin/static/xmake.lua delete mode 100644 xmake/templates/nim/console/src/main.nim delete mode 100644 xmake/templates/nim/console/xmake.lua delete mode 100644 xmake/templates/nim/shared/src/foo.nim delete mode 100644 xmake/templates/nim/shared/src/main.nim delete mode 100644 xmake/templates/nim/shared/xmake.lua delete mode 100644 xmake/templates/nim/static/src/foo.nim delete mode 100644 xmake/templates/nim/static/src/main.nim delete mode 100644 xmake/templates/nim/static/xmake.lua delete mode 100644 xmake/templates/objc++/console/src/main.mm delete mode 100644 xmake/templates/objc++/console/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 delete mode 100644 xmake/templates/objc/console/src/main.m delete mode 100644 xmake/templates/objc/console/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 delete mode 100644 xmake/templates/pascal/console/src/main.pas delete mode 100644 xmake/templates/pascal/console/xmake.lua delete mode 100644 xmake/templates/pascal/shared/src/foo.pas delete mode 100644 xmake/templates/pascal/shared/src/main.pas delete mode 100644 xmake/templates/pascal/shared/xmake.lua delete mode 100644 xmake/templates/rust/console/src/main.rs delete mode 100644 xmake/templates/rust/console/xmake.lua delete mode 100644 xmake/templates/rust/shared/src/foo.rs delete mode 100644 xmake/templates/rust/shared/src/main.rs delete mode 100644 xmake/templates/rust/shared/xmake.lua delete mode 100644 xmake/templates/rust/static/src/foo.rs delete mode 100644 xmake/templates/rust/static/src/main.rs delete mode 100644 xmake/templates/rust/static/xmake.lua delete mode 100644 xmake/templates/swift/console/src/main.swift delete mode 100644 xmake/templates/swift/console/xmake.lua delete mode 100644 xmake/templates/vala/console/src/main.vala delete mode 100644 xmake/templates/vala/console/xmake.lua delete mode 100644 xmake/templates/vala/shared/src/main.vala delete mode 100644 xmake/templates/vala/shared/src/mymath.vala delete mode 100644 xmake/templates/vala/shared/xmake.lua delete mode 100644 xmake/templates/vala/static/src/main.vala delete mode 100644 xmake/templates/vala/static/src/mymath.vala delete mode 100644 xmake/templates/vala/static/xmake.lua delete mode 100644 xmake/templates/zig/console/src/main.zig delete mode 100644 xmake/templates/zig/console/xmake.lua delete mode 100644 xmake/templates/zig/shared/src/main.zig delete mode 100644 xmake/templates/zig/shared/src/test.zig delete mode 100644 xmake/templates/zig/shared/xmake.lua delete mode 100644 xmake/templates/zig/static/src/main.zig delete mode 100644 xmake/templates/zig/static/src/test.zig delete mode 100644 xmake/templates/zig/static/xmake.lua diff --git a/xmake/actions/create/template.lua b/xmake/actions/create/template.lua index eb9e10b16..ea4c06b2f 100644 --- a/xmake/actions/create/template.lua +++ b/xmake/actions/create/template.lua @@ -33,9 +33,8 @@ end -- get all template roots with extra meta information -- -- priority: --- 1. repo: /templates +-- 1. repo: /templates (including builtin repo templates) -- 2. global: /templates --- 3. builtin: /templates function rootinfos() local results = {} @@ -55,10 +54,6 @@ function rootinfos() if os.isdir(dir) then table.insert(results, {kind = "global", dir = dir}) end - dir = path.join(os.programdir(), "templates") - if os.isdir(dir) then - table.insert(results, {kind = "builtin", dir = dir}) - end return results end diff --git a/xmake/repository/templates/c++/console/src/main.cpp b/xmake/repository/templates/c++/console/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/repository/templates/c++/console/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/repository/templates/c++/console/xmake.lua b/xmake/repository/templates/c++/console/xmake.lua new file mode 100644 index 000000000..c73be8724 --- /dev/null +++ b/xmake/repository/templates/c++/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.cpp") + +${FAQ} diff --git a/xmake/repository/templates/c++/module/binary/.gitignore b/xmake/repository/templates/c++/module/binary/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c++/module/binary/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c++/module/binary/modules/binary/bar/.gitignore b/xmake/repository/templates/c++/module/binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c++/module/binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c++/module/binary/modules/binary/bar/src/add.cpp b/xmake/repository/templates/c++/module/binary/modules/binary/bar/src/add.cpp new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/binary/modules/binary/bar/src/sub.cpp b/xmake/repository/templates/c++/module/binary/modules/binary/bar/src/sub.cpp new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/binary/modules/binary/bar/xmake.lua b/xmake/repository/templates/c++/module/binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..add3c6e97 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/binary/src/main.cpp b/xmake/repository/templates/c++/module/binary/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/binary/xmake.lua b/xmake/repository/templates/c++/module/binary/xmake.lua new file mode 100644 index 000000000..d73d457d3 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/shared/.gitignore b/xmake/repository/templates/c++/module/shared/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c++/module/shared/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c++/module/shared/modules/shared/foo/src/foo.cpp b/xmake/repository/templates/c++/module/shared/modules/shared/foo/src/foo.cpp new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/shared/modules/shared/foo/xmake.lua b/xmake/repository/templates/c++/module/shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..9b3423d41 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/shared/src/main.cpp b/xmake/repository/templates/c++/module/shared/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/module/shared/xmake.lua b/xmake/repository/templates/c++/module/shared/xmake.lua new file mode 100644 index 000000000..43aafe904 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/console/src/main.cpp b/xmake/repository/templates/c++/qt/console/src/main.cpp new file mode 100644 index 000000000..e876eea4f --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/console/xmake.lua b/xmake/repository/templates/c++/qt/console/xmake.lua new file mode 100644 index 000000000..2ce5aa993 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp/src/main.cpp b/xmake/repository/templates/c++/qt/quickapp/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp/src/main.qml b/xmake/repository/templates/c++/qt/quickapp/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp/src/qml.qrc b/xmake/repository/templates/c++/qt/quickapp/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/repository/templates/c++/qt/quickapp/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/repository/templates/c++/qt/quickapp/xmake.lua b/xmake/repository/templates/c++/qt/quickapp/xmake.lua new file mode 100644 index 000000000..3f71d1c15 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp_static/src/main.cpp b/xmake/repository/templates/c++/qt/quickapp_static/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp_static/src/main.qml b/xmake/repository/templates/c++/qt/quickapp_static/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/quickapp_static/src/qml.qrc b/xmake/repository/templates/c++/qt/quickapp_static/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/repository/templates/c++/qt/quickapp_static/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/repository/templates/c++/qt/quickapp_static/xmake.lua b/xmake/repository/templates/c++/qt/quickapp_static/xmake.lua new file mode 100644 index 000000000..0d311a762 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/shared/src/demo.cpp b/xmake/repository/templates/c++/qt/shared/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/repository/templates/c++/qt/shared/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/repository/templates/c++/qt/shared/src/demo.h b/xmake/repository/templates/c++/qt/shared/src/demo.h new file mode 100644 index 000000000..89f29ec46 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/shared/src/demo_global.h b/xmake/repository/templates/c++/qt/shared/src/demo_global.h new file mode 100644 index 000000000..d6b1ddf0b --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/shared/xmake.lua b/xmake/repository/templates/c++/qt/shared/xmake.lua new file mode 100644 index 000000000..3b07153b9 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/static/src/demo.cpp b/xmake/repository/templates/c++/qt/static/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/repository/templates/c++/qt/static/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/repository/templates/c++/qt/static/src/demo.h b/xmake/repository/templates/c++/qt/static/src/demo.h new file mode 100644 index 000000000..24730c9d8 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/static/xmake.lua b/xmake/repository/templates/c++/qt/static/xmake.lua new file mode 100644 index 000000000..371bdf082 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp/src/main.cpp b/xmake/repository/templates/c++/qt/widgetapp/src/main.cpp new file mode 100644 index 000000000..191ae18d2 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp/src/mainwindow.cpp b/xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp/src/mainwindow.h b/xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp/src/mainwindow.ui b/xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/repository/templates/c++/qt/widgetapp/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/repository/templates/c++/qt/widgetapp/xmake.lua b/xmake/repository/templates/c++/qt/widgetapp/xmake.lua new file mode 100644 index 000000000..e0f9f455e --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp_static/src/main.cpp b/xmake/repository/templates/c++/qt/widgetapp_static/src/main.cpp new file mode 100644 index 000000000..db5b0cce8 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp_static/src/mainwindow.cpp b/xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp_static/src/mainwindow.h b/xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/qt/widgetapp_static/src/mainwindow.ui b/xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/repository/templates/c++/qt/widgetapp_static/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/repository/templates/c++/qt/widgetapp_static/xmake.lua b/xmake/repository/templates/c++/qt/widgetapp_static/xmake.lua new file mode 100644 index 000000000..2c357e531 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/shared/src/foo.cpp b/xmake/repository/templates/c++/shared/src/foo.cpp new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/repository/templates/c++/shared/src/foo.cpp @@ -0,0 +1,5 @@ +#include "foo.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/repository/templates/c++/shared/src/foo.h b/xmake/repository/templates/c++/shared/src/foo.h new file mode 100644 index 000000000..bd496c784 --- /dev/null +++ b/xmake/repository/templates/c++/shared/src/foo.h @@ -0,0 +1,17 @@ +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) +#define __export __declspec(dllexport) +#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#define __export __attribute__((visibility("default"))) +#else +#define __export +#endif + +__export int add(int a, int b); + +#ifdef __cplusplus +} +#endif diff --git a/xmake/repository/templates/c++/shared/src/main.cpp b/xmake/repository/templates/c++/shared/src/main.cpp new file mode 100644 index 000000000..3834ee4d3 --- /dev/null +++ b/xmake/repository/templates/c++/shared/src/main.cpp @@ -0,0 +1,7 @@ +#include "foo.h" +#include + +int main(int argc, char **argv) { + std::cout << "add(1, 2) = " << add(1, 2) << std::endl; + return 0; +} diff --git a/xmake/repository/templates/c++/shared/xmake.lua b/xmake/repository/templates/c++/shared/xmake.lua new file mode 100644 index 000000000..96bd36d7c --- /dev/null +++ b/xmake/repository/templates/c++/shared/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + set_kind("shared") + add_files("src/foo.cpp") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.cpp") + +${FAQ} diff --git a/xmake/repository/templates/c++/static/src/foo.cpp b/xmake/repository/templates/c++/static/src/foo.cpp new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/repository/templates/c++/static/src/foo.cpp @@ -0,0 +1,5 @@ +#include "foo.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/repository/templates/c++/static/src/foo.h b/xmake/repository/templates/c++/static/src/foo.h new file mode 100644 index 000000000..d2506bca9 --- /dev/null +++ b/xmake/repository/templates/c++/static/src/foo.h @@ -0,0 +1,9 @@ +#ifdef __cplusplus +extern "C" { +#endif + +int add(int a, int b); + +#ifdef __cplusplus +} +#endif diff --git a/xmake/repository/templates/c++/static/src/main.cpp b/xmake/repository/templates/c++/static/src/main.cpp new file mode 100644 index 000000000..3834ee4d3 --- /dev/null +++ b/xmake/repository/templates/c++/static/src/main.cpp @@ -0,0 +1,7 @@ +#include "foo.h" +#include + +int main(int argc, char **argv) { + std::cout << "add(1, 2) = " << add(1, 2) << std::endl; + return 0; +} diff --git a/xmake/repository/templates/c++/static/xmake.lua b/xmake/repository/templates/c++/static/xmake.lua new file mode 100644 index 000000000..2c15d36e8 --- /dev/null +++ b/xmake/repository/templates/c++/static/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + set_kind("static") + add_files("src/foo.cpp") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.cpp") + +${FAQ} diff --git a/xmake/repository/templates/c++/wxwidgets/src/main.cpp b/xmake/repository/templates/c++/wxwidgets/src/main.cpp new file mode 100644 index 000000000..4b43fe6e3 --- /dev/null +++ b/xmake/repository/templates/c++/wxwidgets/src/main.cpp @@ -0,0 +1,48 @@ +#include + +namespace Examples { +class Frame : public wxFrame { + enum wxOwnedID { + ID_Hello = 2 + }; + + public: + Frame() : wxFrame(nullptr, wxID_ANY, "Hello World") { + auto menuFile = new wxMenu(); + menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", "Help string shown in status bar for this menu item"); + menuFile->AppendSeparator(); + menuFile->Append(wxID_EXIT); + + auto menuHelp = new wxMenu(); + menuHelp->Append(wxID_ABOUT); + auto menuBar = new wxMenuBar(); + + menuBar->Append(menuFile, "&File"); + menuBar->Append(menuHelp, "&Help"); + SetMenuBar(menuBar); + + CreateStatusBar(); + SetStatusText("Welcome to wxWidgets!"); + + menuBar->Bind(wxEVT_MENU, [&](wxCommandEvent &event) { + if (event.GetId() == ID_Hello) + wxLogMessage("Hello world from wxWidgets!"); + else if (event.GetId() == wxID_ABOUT) + wxMessageBox("This is a wxWidgets Hello World example", "About Hello World", wxOK | wxICON_INFORMATION); + else if (event.GetId() == wxID_EXIT) + Close(true); + else + event.Skip(); + }); + } +}; + +class Application : public wxApp { + bool OnInit() override { + (new Frame())->Show(); + return true; + } +}; +} // namespace Examples + +wxIMPLEMENT_APP(Examples::Application); \ No newline at end of file diff --git a/xmake/repository/templates/c++/wxwidgets/xmake.lua b/xmake/repository/templates/c++/wxwidgets/xmake.lua new file mode 100644 index 000000000..65a05c72c --- /dev/null +++ b/xmake/repository/templates/c++/wxwidgets/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +add_requires("wxwidgets") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.cpp") + set_languages("c++14") + add_packages("wxwidgets") + +${FAQ} \ No newline at end of file diff --git a/xmake/repository/templates/c++/xmake/cli/src/lni/main.cpp b/xmake/repository/templates/c++/xmake/cli/src/lni/main.cpp new file mode 100644 index 000000000..3de2b1e36 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/xmake/cli/src/lua/main.lua b/xmake/repository/templates/c++/xmake/cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/repository/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/repository/templates/c++/xmake/cli/xmake.lua b/xmake/repository/templates/c++/xmake/cli/xmake.lua new file mode 100644 index 000000000..cf1987c60 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/console/src/main.c b/xmake/repository/templates/c/console/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/repository/templates/c/console/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("hello world!\n"); + return 0; +} diff --git a/xmake/repository/templates/c/console/xmake.lua b/xmake/repository/templates/c/console/xmake.lua new file mode 100644 index 000000000..7e9356f26 --- /dev/null +++ b/xmake/repository/templates/c/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.c") + +${FAQ} diff --git a/xmake/repository/templates/c/module/binary/.gitignore b/xmake/repository/templates/c/module/binary/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c/module/binary/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c/module/binary/modules/binary/bar/.gitignore b/xmake/repository/templates/c/module/binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c/module/binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c/module/binary/modules/binary/bar/src/add.c b/xmake/repository/templates/c/module/binary/modules/binary/bar/src/add.c new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/binary/modules/binary/bar/src/sub.c b/xmake/repository/templates/c/module/binary/modules/binary/bar/src/sub.c new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/binary/modules/binary/bar/xmake.lua b/xmake/repository/templates/c/module/binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..d4983d741 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/binary/src/main.c b/xmake/repository/templates/c/module/binary/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/binary/xmake.lua b/xmake/repository/templates/c/module/binary/xmake.lua new file mode 100644 index 000000000..7df556cb8 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/shared/.gitignore b/xmake/repository/templates/c/module/shared/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/repository/templates/c/module/shared/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/repository/templates/c/module/shared/modules/shared/foo/src/foo.c b/xmake/repository/templates/c/module/shared/modules/shared/foo/src/foo.c new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/shared/modules/shared/foo/xmake.lua b/xmake/repository/templates/c/module/shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..035573d9f --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/shared/src/main.c b/xmake/repository/templates/c/module/shared/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/module/shared/xmake.lua b/xmake/repository/templates/c/module/shared/xmake.lua new file mode 100644 index 000000000..4b92b0b9e --- /dev/null +++ b/xmake/repository/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/repository/templates/c/shared/src/foo.c b/xmake/repository/templates/c/shared/src/foo.c new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/repository/templates/c/shared/src/foo.c @@ -0,0 +1,5 @@ +#include "foo.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/repository/templates/c/shared/src/foo.h b/xmake/repository/templates/c/shared/src/foo.h new file mode 100644 index 000000000..e15925829 --- /dev/null +++ b/xmake/repository/templates/c/shared/src/foo.h @@ -0,0 +1,9 @@ +#if defined(_WIN32) +#define __export __declspec(dllexport) +#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#define __export __attribute__((visibility("default"))) +#else +#define __export +#endif + +__export int add(int a, int b); diff --git a/xmake/repository/templates/c/shared/src/main.c b/xmake/repository/templates/c/shared/src/main.c new file mode 100644 index 000000000..f1c29d751 --- /dev/null +++ b/xmake/repository/templates/c/shared/src/main.c @@ -0,0 +1,7 @@ +#include "foo.h" +#include + +int main(int argc, char **argv) { + printf("add(1, 2) = %d\n", add(1, 2)); + return 0; +} diff --git a/xmake/repository/templates/c/shared/xmake.lua b/xmake/repository/templates/c/shared/xmake.lua new file mode 100644 index 000000000..11e8dd0dd --- /dev/null +++ b/xmake/repository/templates/c/shared/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + set_kind("shared") + add_files("src/foo.c") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.c") + +${FAQ} diff --git a/xmake/repository/templates/c/static/src/foo.c b/xmake/repository/templates/c/static/src/foo.c new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/repository/templates/c/static/src/foo.c @@ -0,0 +1,5 @@ +#include "foo.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/repository/templates/c/static/src/foo.h b/xmake/repository/templates/c/static/src/foo.h new file mode 100644 index 000000000..6295ab95c --- /dev/null +++ b/xmake/repository/templates/c/static/src/foo.h @@ -0,0 +1 @@ +int add(int a, int b); diff --git a/xmake/repository/templates/c/static/src/main.c b/xmake/repository/templates/c/static/src/main.c new file mode 100644 index 000000000..f1c29d751 --- /dev/null +++ b/xmake/repository/templates/c/static/src/main.c @@ -0,0 +1,7 @@ +#include "foo.h" +#include + +int main(int argc, char **argv) { + printf("add(1, 2) = %d\n", add(1, 2)); + return 0; +} diff --git a/xmake/repository/templates/c/static/xmake.lua b/xmake/repository/templates/c/static/xmake.lua new file mode 100644 index 000000000..f00e9f4f7 --- /dev/null +++ b/xmake/repository/templates/c/static/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + set_kind("static") + add_files("src/foo.c") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.c") + +${FAQ} diff --git a/xmake/repository/templates/c/xmake/cli/src/lni/main.c b/xmake/repository/templates/c/xmake/cli/src/lni/main.c new file mode 100644 index 000000000..1ef27cd75 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/xmake/cli/src/lua/main.lua b/xmake/repository/templates/c/xmake/cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/repository/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/repository/templates/c/xmake/cli/xmake.lua b/xmake/repository/templates/c/xmake/cli/xmake.lua new file mode 100644 index 000000000..33422b5c0 --- /dev/null +++ b/xmake/repository/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/repository/templates/cuda/console/src/main.cu b/xmake/repository/templates/cuda/console/src/main.cu new file mode 100644 index 000000000..2fe9ac797 --- /dev/null +++ b/xmake/repository/templates/cuda/console/src/main.cu @@ -0,0 +1,132 @@ + +#include "cuda_runtime.h" +#include "device_launch_parameters.h" + +#include + +cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size); + +__global__ void addKernel(int *c, const int *a, const int *b) +{ + int i = threadIdx.x; + c[i] = a[i] + b[i]; +} + +int main() +{ + const int arraySize = 5; + const int a[arraySize] = {1, 2, 3, 4, 5}; + const int b[arraySize] = {10, 20, 30, 40, 50}; + int c[arraySize] = {0}; + + // Add vectors in parallel. + cudaError_t cudaStatus = addWithCuda(c, a, b, arraySize); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "addWithCuda failed!"); + return 1; + } + + printf("{1,2,3,4,5} + {10,20,30,40,50} = {%d,%d,%d,%d,%d}\n", + c[0], c[1], c[2], c[3], c[4]); + + // cudaDeviceReset must be called before exiting in order for profiling and + // tracing tools such as Nsight and Visual Profiler to show complete traces. + cudaStatus = cudaDeviceReset(); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaDeviceReset failed!"); + return 1; + } + + return 0; +} + +// Helper function for using CUDA to add vectors in parallel. +cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size) +{ + int *dev_a = 0; + int *dev_b = 0; + int *dev_c = 0; + cudaError_t cudaStatus; + + // Choose which GPU to run on, change this on a multi-GPU system. + cudaStatus = cudaSetDevice(0); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?"); + goto Error; + } + + // Allocate GPU buffers for three vectors (two input, one output) . + cudaStatus = cudaMalloc((void **)&dev_c, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + cudaStatus = cudaMalloc((void **)&dev_a, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + cudaStatus = cudaMalloc((void **)&dev_b, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + // Copy input vectors from host memory to GPU buffers. + cudaStatus = cudaMemcpy(dev_a, a, size * sizeof(int), cudaMemcpyHostToDevice); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + + cudaStatus = cudaMemcpy(dev_b, b, size * sizeof(int), cudaMemcpyHostToDevice); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + + // Launch a kernel on the GPU with one thread for each element. + addKernel<<<1, size>>>(dev_c, dev_a, dev_b); + + // Check for any errors launching the kernel + cudaStatus = cudaGetLastError(); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus)); + goto Error; + } + + // cudaDeviceSynchronize waits for the kernel to finish, and returns + // any errors encountered during the launch. + cudaStatus = cudaDeviceSynchronize(); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus); + goto Error; + } + + // Copy output vector from GPU buffer to host memory. + cudaStatus = cudaMemcpy(c, dev_c, size * sizeof(int), cudaMemcpyDeviceToHost); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + +Error: + cudaFree(dev_c); + cudaFree(dev_a); + cudaFree(dev_b); + + return cudaStatus; +} diff --git a/xmake/repository/templates/cuda/console/xmake.lua b/xmake/repository/templates/cuda/console/xmake.lua new file mode 100644 index 000000000..fb393bab7 --- /dev/null +++ b/xmake/repository/templates/cuda/console/xmake.lua @@ -0,0 +1,19 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.cu") + + -- generate SASS code for SM architecture of current host + add_cugencodes("native") + + -- generate PTX code for the virtual architecture to guarantee compatibility + add_cugencodes("compute_75") + + -- -- generate SASS code for each SM architecture + -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") + + -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility + -- add_cugencodes("compute_100") + +${FAQ} diff --git a/xmake/repository/templates/cuda/shared/inc/lib.cuh b/xmake/repository/templates/cuda/shared/inc/lib.cuh new file mode 100644 index 000000000..5565e3eb5 --- /dev/null +++ b/xmake/repository/templates/cuda/shared/inc/lib.cuh @@ -0,0 +1,22 @@ +#pragma once + +#include "cuda_runtime.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +#if defined(_WIN32) +#define __export __declspec(dllexport) +#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) +#define __export __attribute__((visibility("default"))) +#else +#define __export +#endif + + __export cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size); + +#ifdef __cplusplus +} +#endif diff --git a/xmake/repository/templates/cuda/shared/src/lib.cu b/xmake/repository/templates/cuda/shared/src/lib.cu new file mode 100644 index 000000000..d2cff9ac2 --- /dev/null +++ b/xmake/repository/templates/cuda/shared/src/lib.cu @@ -0,0 +1,98 @@ +#include +#include +#include "device_launch_parameters.h" + +__global__ void addKernel(int *c, const int *a, const int *b) +{ + int i = threadIdx.x; + c[i] = a[i] + b[i]; +} + +// Helper function for using CUDA to add vectors in parallel. +cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size) +{ + int *dev_a = 0; + int *dev_b = 0; + int *dev_c = 0; + cudaError_t cudaStatus; + + // Choose which GPU to run on, change this on a multi-GPU system. + cudaStatus = cudaSetDevice(0); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?"); + goto Error; + } + + // Allocate GPU buffers for three vectors (two input, one output) . + cudaStatus = cudaMalloc((void **)&dev_c, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + cudaStatus = cudaMalloc((void **)&dev_a, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + cudaStatus = cudaMalloc((void **)&dev_b, size * sizeof(int)); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMalloc failed!"); + goto Error; + } + + // Copy input vectors from host memory to GPU buffers. + cudaStatus = cudaMemcpy(dev_a, a, size * sizeof(int), cudaMemcpyHostToDevice); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + + cudaStatus = cudaMemcpy(dev_b, b, size * sizeof(int), cudaMemcpyHostToDevice); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + + // Launch a kernel on the GPU with one thread for each element. + addKernel<<<1, size>>>(dev_c, dev_a, dev_b); + + // Check for any errors launching the kernel + cudaStatus = cudaGetLastError(); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus)); + goto Error; + } + + // cudaDeviceSynchronize waits for the kernel to finish, and returns + // any errors encountered during the launch. + cudaStatus = cudaDeviceSynchronize(); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus); + goto Error; + } + + // Copy output vector from GPU buffer to host memory. + cudaStatus = cudaMemcpy(c, dev_c, size * sizeof(int), cudaMemcpyDeviceToHost); + if (cudaStatus != cudaSuccess) + { + fprintf(stderr, "cudaMemcpy failed!"); + goto Error; + } + +Error: + cudaFree(dev_c); + cudaFree(dev_a); + cudaFree(dev_b); + + return cudaStatus; +} diff --git a/xmake/repository/templates/cuda/shared/xmake.lua b/xmake/repository/templates/cuda/shared/xmake.lua new file mode 100644 index 000000000..5f53ff87b --- /dev/null +++ b/xmake/repository/templates/cuda/shared/xmake.lua @@ -0,0 +1,20 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("shared") + add_files("src/**.cu") + add_includedirs("inc") + + -- generate SASS code for SM architecture of current host + add_cugencodes("native") + + -- generate PTX code for the virtual architecture to guarantee compatibility + add_cugencodes("compute_75") + + -- -- generate SASS code for each SM architecture + -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") + + -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility + -- add_cugencodes("compute_100") + +${FAQ} diff --git a/xmake/repository/templates/cuda/static/inc/lib.cuh b/xmake/repository/templates/cuda/static/inc/lib.cuh new file mode 100644 index 000000000..35255e31e --- /dev/null +++ b/xmake/repository/templates/cuda/static/inc/lib.cuh @@ -0,0 +1,3 @@ +#pragma once + +__global__ void addKernel(int *c, const int *a, const int *b); \ No newline at end of file diff --git a/xmake/repository/templates/cuda/static/src/lib.cu b/xmake/repository/templates/cuda/static/src/lib.cu new file mode 100644 index 000000000..a5f054354 --- /dev/null +++ b/xmake/repository/templates/cuda/static/src/lib.cu @@ -0,0 +1,7 @@ +#include + +__global__ void addKernel(int *c, const int *a, const int *b) +{ + int i = threadIdx.x; + c[i] = a[i] + b[i]; +} \ No newline at end of file diff --git a/xmake/repository/templates/cuda/static/xmake.lua b/xmake/repository/templates/cuda/static/xmake.lua new file mode 100644 index 000000000..7a582cfbb --- /dev/null +++ b/xmake/repository/templates/cuda/static/xmake.lua @@ -0,0 +1,20 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("static") + add_files("src/**.cu") + add_includedirs("inc") + + -- generate SASS code for SM architecture of current host + add_cugencodes("native") + + -- generate PTX code for the virtual architecture to guarantee compatibility + add_cugencodes("compute_75") + + -- -- generate SASS code for each SM architecture + -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") + + -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility + -- add_cugencodes("compute_100") + +${FAQ} diff --git a/xmake/repository/templates/dlang/console/src/main.d b/xmake/repository/templates/dlang/console/src/main.d new file mode 100644 index 000000000..6bea6ec02 --- /dev/null +++ b/xmake/repository/templates/dlang/console/src/main.d @@ -0,0 +1,5 @@ +import std.stdio; + +void main() { + writeln("hello world!"); +} diff --git a/xmake/repository/templates/dlang/console/xmake.lua b/xmake/repository/templates/dlang/console/xmake.lua new file mode 100644 index 000000000..c242d60c2 --- /dev/null +++ b/xmake/repository/templates/dlang/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.d") + +${FAQ} diff --git a/xmake/repository/templates/dlang/shared/src/interfaces.d b/xmake/repository/templates/dlang/shared/src/interfaces.d new file mode 100644 index 000000000..b4f7ab6ba --- /dev/null +++ b/xmake/repository/templates/dlang/shared/src/interfaces.d @@ -0,0 +1,15 @@ +version(Windows) { + import core.sys.windows.windows; + import core.sys.windows.dll; + mixin SimpleDllMain; +} + +extern(C) int add(int a, int b) { + return a + b; +} + +extern(C) int sub(int a, int b) { + return a - b; +} + + diff --git a/xmake/repository/templates/dlang/shared/src/main.d b/xmake/repository/templates/dlang/shared/src/main.d new file mode 100644 index 000000000..bfcf9cf56 --- /dev/null +++ b/xmake/repository/templates/dlang/shared/src/main.d @@ -0,0 +1,7 @@ +import std.stdio; +import interfaces; + +void main() { + printf("add: %d\n", interfaces.add(1, 1)); + printf("sub: %d\n", interfaces.sub(2, 1)); +} diff --git a/xmake/repository/templates/dlang/shared/xmake.lua b/xmake/repository/templates/dlang/shared/xmake.lua new file mode 100644 index 000000000..0086bebae --- /dev/null +++ b/xmake/repository/templates/dlang/shared/xmake.lua @@ -0,0 +1,16 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("shared") + add_files("src/interfaces.d") + add_includedirs("src", {public = true}) + add_rules("utils.symbols.export_list", {symbols = { + "add", + "sub"}}) + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.d") + +${FAQ} diff --git a/xmake/repository/templates/dlang/static/src/interfaces.d b/xmake/repository/templates/dlang/static/src/interfaces.d new file mode 100644 index 000000000..3386c9124 --- /dev/null +++ b/xmake/repository/templates/dlang/static/src/interfaces.d @@ -0,0 +1,9 @@ +extern(C) int add(int a, int b) +{ + return a + b; +} + +extern(C) int sub(int a, int b) +{ + return a - b; +} diff --git a/xmake/repository/templates/dlang/static/src/main.d b/xmake/repository/templates/dlang/static/src/main.d new file mode 100644 index 000000000..bfcf9cf56 --- /dev/null +++ b/xmake/repository/templates/dlang/static/src/main.d @@ -0,0 +1,7 @@ +import std.stdio; +import interfaces; + +void main() { + printf("add: %d\n", interfaces.add(1, 1)); + printf("sub: %d\n", interfaces.sub(2, 1)); +} diff --git a/xmake/repository/templates/dlang/static/xmake.lua b/xmake/repository/templates/dlang/static/xmake.lua new file mode 100644 index 000000000..b8fb24b37 --- /dev/null +++ b/xmake/repository/templates/dlang/static/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("static") + add_files("src/interfaces.d") + add_includedirs("src", {public = true}) + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.d") + +${FAQ} diff --git a/xmake/repository/templates/fortran/console/src/main.f90 b/xmake/repository/templates/fortran/console/src/main.f90 new file mode 100644 index 000000000..a332e8401 --- /dev/null +++ b/xmake/repository/templates/fortran/console/src/main.f90 @@ -0,0 +1,3 @@ +program hello + print *, "Hello World!" +end program hello diff --git a/xmake/repository/templates/fortran/console/xmake.lua b/xmake/repository/templates/fortran/console/xmake.lua new file mode 100644 index 000000000..70faf8aea --- /dev/null +++ b/xmake/repository/templates/fortran/console/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.f90") + diff --git a/xmake/repository/templates/fortran/shared/src/main.f90 b/xmake/repository/templates/fortran/shared/src/main.f90 new file mode 100644 index 000000000..9adea3e26 --- /dev/null +++ b/xmake/repository/templates/fortran/shared/src/main.f90 @@ -0,0 +1,5 @@ +program hello + use test, only: print_hello + implicit none (type, external) + call print_hello() +end program hello diff --git a/xmake/repository/templates/fortran/shared/src/test.f90 b/xmake/repository/templates/fortran/shared/src/test.f90 new file mode 100644 index 000000000..7b215fcdf --- /dev/null +++ b/xmake/repository/templates/fortran/shared/src/test.f90 @@ -0,0 +1,8 @@ +module test + implicit none (type, external) + +contains + subroutine print_hello() + print *, "Hello World!" + end subroutine print_hello +end module test diff --git a/xmake/repository/templates/fortran/shared/xmake.lua b/xmake/repository/templates/fortran/shared/xmake.lua new file mode 100644 index 000000000..da6d6da3f --- /dev/null +++ b/xmake/repository/templates/fortran/shared/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}_lib") + set_kind("shared") + add_files("src/test.f90") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("${TARGET_NAME}_lib") + add_files("src/main.f90") + diff --git a/xmake/repository/templates/fortran/static/src/main.f90 b/xmake/repository/templates/fortran/static/src/main.f90 new file mode 100644 index 000000000..9adea3e26 --- /dev/null +++ b/xmake/repository/templates/fortran/static/src/main.f90 @@ -0,0 +1,5 @@ +program hello + use test, only: print_hello + implicit none (type, external) + call print_hello() +end program hello diff --git a/xmake/repository/templates/fortran/static/src/test.f90 b/xmake/repository/templates/fortran/static/src/test.f90 new file mode 100644 index 000000000..7b215fcdf --- /dev/null +++ b/xmake/repository/templates/fortran/static/src/test.f90 @@ -0,0 +1,8 @@ +module test + implicit none (type, external) + +contains + subroutine print_hello() + print *, "Hello World!" + end subroutine print_hello +end module test diff --git a/xmake/repository/templates/fortran/static/xmake.lua b/xmake/repository/templates/fortran/static/xmake.lua new file mode 100644 index 000000000..4b91ad207 --- /dev/null +++ b/xmake/repository/templates/fortran/static/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}_lib") + set_kind("static") + add_files("src/test.f90") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("${TARGET_NAME}_lib") + add_files("src/main.f90") + diff --git a/xmake/repository/templates/go/console/src/main.go b/xmake/repository/templates/go/console/src/main.go new file mode 100644 index 000000000..b689db480 --- /dev/null +++ b/xmake/repository/templates/go/console/src/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("hello xmake!") +} diff --git a/xmake/repository/templates/go/console/xmake.lua b/xmake/repository/templates/go/console/xmake.lua new file mode 100644 index 000000000..a7861eb2a --- /dev/null +++ b/xmake/repository/templates/go/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.go") + +${FAQ} diff --git a/xmake/repository/templates/go/static/src/main.go b/xmake/repository/templates/go/static/src/main.go new file mode 100644 index 000000000..f2b477453 --- /dev/null +++ b/xmake/repository/templates/go/static/src/main.go @@ -0,0 +1,7 @@ +package main + +func main() { + + Run() +} + diff --git a/xmake/repository/templates/go/static/src/module/add.go b/xmake/repository/templates/go/static/src/module/add.go new file mode 100644 index 000000000..98ffef600 --- /dev/null +++ b/xmake/repository/templates/go/static/src/module/add.go @@ -0,0 +1,6 @@ +package module + +func Add(a int, b int) int { + return a + b; +} + diff --git a/xmake/repository/templates/go/static/src/module/sub.go b/xmake/repository/templates/go/static/src/module/sub.go new file mode 100644 index 000000000..a24a9abb7 --- /dev/null +++ b/xmake/repository/templates/go/static/src/module/sub.go @@ -0,0 +1,6 @@ +package module + +func Sub(a int, b int) int { + return a - b; +} + diff --git a/xmake/repository/templates/go/static/src/test.go b/xmake/repository/templates/go/static/src/test.go new file mode 100644 index 000000000..cf10523f9 --- /dev/null +++ b/xmake/repository/templates/go/static/src/test.go @@ -0,0 +1,12 @@ +package main + +import ( + "fmt" + "module" +) + +func Run() { + + fmt.Printf("add: %d\n", module.Add(1, 2)); + fmt.Printf("sub: %d\n", module.Sub(1, 2)); +} diff --git a/xmake/repository/templates/go/static/xmake.lua b/xmake/repository/templates/go/static/xmake.lua new file mode 100644 index 000000000..4391d7799 --- /dev/null +++ b/xmake/repository/templates/go/static/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("module") + set_kind("static") + add_files("src/module/*.go") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("module") + add_files("src/*.go") + +${FAQ} diff --git a/xmake/repository/templates/kotlin/console/src/main.kt b/xmake/repository/templates/kotlin/console/src/main.kt new file mode 100644 index 000000000..543f5ac8f --- /dev/null +++ b/xmake/repository/templates/kotlin/console/src/main.kt @@ -0,0 +1,3 @@ +fun main() { + println("hello xmake!") +} diff --git a/xmake/repository/templates/kotlin/console/xmake.lua b/xmake/repository/templates/kotlin/console/xmake.lua new file mode 100644 index 000000000..935dc7c75 --- /dev/null +++ b/xmake/repository/templates/kotlin/console/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +add_requires("kotlin-native") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/main.kt") + set_toolchains("@kotlin-native") + +${FAQ} diff --git a/xmake/repository/templates/kotlin/shared/src/foo.kt b/xmake/repository/templates/kotlin/shared/src/foo.kt new file mode 100644 index 000000000..cc5184bd7 --- /dev/null +++ b/xmake/repository/templates/kotlin/shared/src/foo.kt @@ -0,0 +1,2 @@ +@CName("kotlin_add") +fun add(a: Int, b: Int): Int = a + b diff --git a/xmake/repository/templates/kotlin/shared/src/main.c b/xmake/repository/templates/kotlin/shared/src/main.c new file mode 100644 index 000000000..abb3f2c12 --- /dev/null +++ b/xmake/repository/templates/kotlin/shared/src/main.c @@ -0,0 +1,7 @@ +#include "libfoo_api.h" +#include + +int main(int argc, char **argv) { + printf("add(1, 2) = %d\n", kotlin_add(1, 2)); + return 0; +} diff --git a/xmake/repository/templates/kotlin/shared/xmake.lua b/xmake/repository/templates/kotlin/shared/xmake.lua new file mode 100644 index 000000000..97bebf8a6 --- /dev/null +++ b/xmake/repository/templates/kotlin/shared/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") +add_requires("kotlin-native") +target("foo") + set_kind("shared") + add_files("src/foo.kt") + set_toolchains("@kotlin-native") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/main.c") + add_deps("foo") + +${FAQ} diff --git a/xmake/repository/templates/kotlin/static/src/foo.kt b/xmake/repository/templates/kotlin/static/src/foo.kt new file mode 100644 index 000000000..cc5184bd7 --- /dev/null +++ b/xmake/repository/templates/kotlin/static/src/foo.kt @@ -0,0 +1,2 @@ +@CName("kotlin_add") +fun add(a: Int, b: Int): Int = a + b diff --git a/xmake/repository/templates/kotlin/static/src/main.c b/xmake/repository/templates/kotlin/static/src/main.c new file mode 100644 index 000000000..abb3f2c12 --- /dev/null +++ b/xmake/repository/templates/kotlin/static/src/main.c @@ -0,0 +1,7 @@ +#include "libfoo_api.h" +#include + +int main(int argc, char **argv) { + printf("add(1, 2) = %d\n", kotlin_add(1, 2)); + return 0; +} diff --git a/xmake/repository/templates/kotlin/static/xmake.lua b/xmake/repository/templates/kotlin/static/xmake.lua new file mode 100644 index 000000000..6095dbe93 --- /dev/null +++ b/xmake/repository/templates/kotlin/static/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") +add_requires("kotlin-native") +target("foo") + set_kind("static") + add_files("src/foo.kt") + set_toolchains("@kotlin-native") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/main.c") + add_deps("foo") + +${FAQ} diff --git a/xmake/repository/templates/nim/console/src/main.nim b/xmake/repository/templates/nim/console/src/main.nim new file mode 100644 index 000000000..17179284f --- /dev/null +++ b/xmake/repository/templates/nim/console/src/main.nim @@ -0,0 +1 @@ +echo "hello xmake!" diff --git a/xmake/repository/templates/nim/console/xmake.lua b/xmake/repository/templates/nim/console/xmake.lua new file mode 100644 index 000000000..662945bbb --- /dev/null +++ b/xmake/repository/templates/nim/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/main.nim") + +${FAQ} diff --git a/xmake/repository/templates/nim/shared/src/foo.nim b/xmake/repository/templates/nim/shared/src/foo.nim new file mode 100644 index 000000000..cde4de7ca --- /dev/null +++ b/xmake/repository/templates/nim/shared/src/foo.nim @@ -0,0 +1,6 @@ +proc foo(n: int): int {.cdecl, exportc, dynlib.} = + if n < 2: + result = n + else: + result = foo(n - 1) + (n - 2).foo + diff --git a/xmake/repository/templates/nim/shared/src/main.nim b/xmake/repository/templates/nim/shared/src/main.nim new file mode 100644 index 000000000..1be3abe69 --- /dev/null +++ b/xmake/repository/templates/nim/shared/src/main.nim @@ -0,0 +1,3 @@ +proc foo(n: int): int {.cdecl, importc} + +echo foo(2) diff --git a/xmake/repository/templates/nim/shared/xmake.lua b/xmake/repository/templates/nim/shared/xmake.lua new file mode 100644 index 000000000..5067dafb3 --- /dev/null +++ b/xmake/repository/templates/nim/shared/xmake.lua @@ -0,0 +1,14 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("shared") + add_files("src/foo.nim") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.nim") + +${FAQ} + + diff --git a/xmake/repository/templates/nim/static/src/foo.nim b/xmake/repository/templates/nim/static/src/foo.nim new file mode 100644 index 000000000..be0904262 --- /dev/null +++ b/xmake/repository/templates/nim/static/src/foo.nim @@ -0,0 +1,6 @@ +proc foo(n: int): int {.cdecl, exportc} = + if n < 2: + result = n + else: + result = foo(n - 1) + (n - 2).foo + diff --git a/xmake/repository/templates/nim/static/src/main.nim b/xmake/repository/templates/nim/static/src/main.nim new file mode 100644 index 000000000..1be3abe69 --- /dev/null +++ b/xmake/repository/templates/nim/static/src/main.nim @@ -0,0 +1,3 @@ +proc foo(n: int): int {.cdecl, importc} + +echo foo(2) diff --git a/xmake/repository/templates/nim/static/xmake.lua b/xmake/repository/templates/nim/static/xmake.lua new file mode 100644 index 000000000..3f2cb7dfc --- /dev/null +++ b/xmake/repository/templates/nim/static/xmake.lua @@ -0,0 +1,14 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("static") + add_files("src/foo.nim") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.nim") + +${FAQ} + + diff --git a/xmake/repository/templates/objc++/console/src/main.mm b/xmake/repository/templates/objc++/console/src/main.mm new file mode 100644 index 000000000..cbd1e8906 --- /dev/null +++ b/xmake/repository/templates/objc++/console/src/main.mm @@ -0,0 +1,8 @@ +#import + +int main(int argc, char** argv) { + @autoreleasepool { + NSLog(@"hello world!"); + } + return 0; +} diff --git a/xmake/repository/templates/objc++/console/xmake.lua b/xmake/repository/templates/objc++/console/xmake.lua new file mode 100644 index 000000000..99749f901 --- /dev/null +++ b/xmake/repository/templates/objc++/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGET_NAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.mm") + +${FAQ} diff --git a/xmake/repository/templates/objc++/xcode/bundle/src/Info.plist b/xmake/repository/templates/objc++/xcode/bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc++/xcode/bundle/src/test.h b/xmake/repository/templates/objc++/xcode/bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/templates/objc++/xcode/bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/repository/templates/objc++/xcode/bundle/src/test.mm b/xmake/repository/templates/objc++/xcode/bundle/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc++/xcode/bundle/xmake.lua b/xmake/repository/templates/objc++/xcode/bundle/xmake.lua new file mode 100644 index 000000000..1ecf69fcb --- /dev/null +++ b/xmake/repository/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/repository/templates/objc++/xcode/framework/src/Info.plist b/xmake/repository/templates/objc++/xcode/framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc++/xcode/framework/src/test.h b/xmake/repository/templates/objc++/xcode/framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/templates/objc++/xcode/framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/repository/templates/objc++/xcode/framework/src/test.mm b/xmake/repository/templates/objc++/xcode/framework/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc++/xcode/framework/xmake.lua b/xmake/repository/templates/objc++/xcode/framework/xmake.lua new file mode 100644 index 000000000..3805d95c6 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/console/src/main.m b/xmake/repository/templates/objc/console/src/main.m new file mode 100644 index 000000000..cbd1e8906 --- /dev/null +++ b/xmake/repository/templates/objc/console/src/main.m @@ -0,0 +1,8 @@ +#import + +int main(int argc, char** argv) { + @autoreleasepool { + NSLog(@"hello world!"); + } + return 0; +} diff --git a/xmake/repository/templates/objc/console/xmake.lua b/xmake/repository/templates/objc/console/xmake.lua new file mode 100644 index 000000000..37c01442a --- /dev/null +++ b/xmake/repository/templates/objc/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGET_NAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.m") + +${FAQ} diff --git a/xmake/repository/templates/objc/xcode/bundle/src/Info.plist b/xmake/repository/templates/objc/xcode/bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/bundle/src/test.h b/xmake/repository/templates/objc/xcode/bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/templates/objc/xcode/bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/repository/templates/objc/xcode/bundle/src/test.m b/xmake/repository/templates/objc/xcode/bundle/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/bundle/xmake.lua b/xmake/repository/templates/objc/xcode/bundle/xmake.lua new file mode 100644 index 000000000..34d108fcb --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/framework/src/Info.plist b/xmake/repository/templates/objc/xcode/framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/framework/src/test.h b/xmake/repository/templates/objc/xcode/framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/templates/objc/xcode/framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/repository/templates/objc/xcode/framework/src/test.m b/xmake/repository/templates/objc/xcode/framework/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/framework/xmake.lua b/xmake/repository/templates/objc/xcode/framework/xmake.lua new file mode 100644 index 000000000..83ddfa1a2 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/AppDelegate.h b/xmake/repository/templates/objc/xcode/iosapp/src/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/AppDelegate.m b/xmake/repository/templates/objc/xcode/iosapp/src/AppDelegate.m new file mode 100644 index 000000000..0ad500bfe --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json b/xmake/repository/templates/objc/xcode/iosapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard b/xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/repository/templates/objc/xcode/iosapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/repository/templates/objc/xcode/iosapp/src/Info.plist b/xmake/repository/templates/objc/xcode/iosapp/src/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/SceneDelegate.h b/xmake/repository/templates/objc/xcode/iosapp/src/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/SceneDelegate.m b/xmake/repository/templates/objc/xcode/iosapp/src/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/ViewController.h b/xmake/repository/templates/objc/xcode/iosapp/src/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/ViewController.m b/xmake/repository/templates/objc/xcode/iosapp/src/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/src/main.m b/xmake/repository/templates/objc/xcode/iosapp/src/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp/xmake.lua b/xmake/repository/templates/objc/xcode/iosapp/xmake.lua new file mode 100644 index 000000000..1306fce94 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/AppDelegate.m new file mode 100644 index 000000000..1f3556c06 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/repository/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/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/app/main.m b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/app/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.h b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.m b/xmake/repository/templates/objc/xcode/iosapp_with_framework/src/framework/test.m new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/iosapp_with_framework/xmake.lua b/xmake/repository/templates/objc/xcode/iosapp_with_framework/xmake.lua new file mode 100644 index 000000000..e1383b8b2 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/AppDelegate.h b/xmake/repository/templates/objc/xcode/macapp/src/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/AppDelegate.m b/xmake/repository/templates/objc/xcode/macapp/src/AppDelegate.m new file mode 100644 index 000000000..da967d2ef --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/repository/templates/objc/xcode/macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json b/xmake/repository/templates/objc/xcode/macapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard b/xmake/repository/templates/objc/xcode/macapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/Info.plist b/xmake/repository/templates/objc/xcode/macapp/src/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/ViewController.h b/xmake/repository/templates/objc/xcode/macapp/src/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/ViewController.m b/xmake/repository/templates/objc/xcode/macapp/src/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/main.m b/xmake/repository/templates/objc/xcode/macapp/src/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/src/test.entitlements b/xmake/repository/templates/objc/xcode/macapp/src/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp/xmake.lua b/xmake/repository/templates/objc/xcode/macapp/xmake.lua new file mode 100644 index 000000000..1306fce94 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/AppDelegate.m new file mode 100644 index 000000000..667420c8c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/repository/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/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/Info.plist b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/main.m b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/app/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.h b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.m b/xmake/repository/templates/objc/xcode/macapp_with_framework/src/framework/test.m new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/repository/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/repository/templates/objc/xcode/macapp_with_framework/xmake.lua b/xmake/repository/templates/objc/xcode/macapp_with_framework/xmake.lua new file mode 100644 index 000000000..e1383b8b2 --- /dev/null +++ b/xmake/repository/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") diff --git a/xmake/repository/templates/pascal/console/src/main.pas b/xmake/repository/templates/pascal/console/src/main.pas new file mode 100644 index 000000000..a908ffab7 --- /dev/null +++ b/xmake/repository/templates/pascal/console/src/main.pas @@ -0,0 +1,4 @@ +program Hello; +begin + writeln ('Hello, world.'); +end. diff --git a/xmake/repository/templates/pascal/console/xmake.lua b/xmake/repository/templates/pascal/console/xmake.lua new file mode 100644 index 000000000..52168c3a4 --- /dev/null +++ b/xmake/repository/templates/pascal/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.pas") + +${FAQ} diff --git a/xmake/repository/templates/pascal/shared/src/foo.pas b/xmake/repository/templates/pascal/shared/src/foo.pas new file mode 100644 index 000000000..788950f46 --- /dev/null +++ b/xmake/repository/templates/pascal/shared/src/foo.pas @@ -0,0 +1,19 @@ +library foo; + +{$mode objfpc}{$H+} + +function fib(n : Int64) : Int64; cdecl; +begin + if n > 1 then + begin + Result := fib(n - 1) + fib(n - 2); + end + else + Result := 1; +end; + +exports + fib; +end. + + diff --git a/xmake/repository/templates/pascal/shared/src/main.pas b/xmake/repository/templates/pascal/shared/src/main.pas new file mode 100644 index 000000000..02d5e88d0 --- /dev/null +++ b/xmake/repository/templates/pascal/shared/src/main.pas @@ -0,0 +1,13 @@ +program hello; + +function fib(n: Int64): Int64; + cdecl; external 'foo'; + +var + Value: Integer; +begin + Value := 5; + WriteLn(fib(Value)); +end. + + diff --git a/xmake/repository/templates/pascal/shared/xmake.lua b/xmake/repository/templates/pascal/shared/xmake.lua new file mode 100644 index 000000000..fad68bd07 --- /dev/null +++ b/xmake/repository/templates/pascal/shared/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") +target("foo") + set_kind("shared") + add_files("src/foo.pas") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.pas") + + +${FAQ} diff --git a/xmake/repository/templates/rust/console/src/main.rs b/xmake/repository/templates/rust/console/src/main.rs new file mode 100644 index 000000000..88d5e2749 --- /dev/null +++ b/xmake/repository/templates/rust/console/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hello xmake!"); +} diff --git a/xmake/repository/templates/rust/console/xmake.lua b/xmake/repository/templates/rust/console/xmake.lua new file mode 100644 index 000000000..684ea720a --- /dev/null +++ b/xmake/repository/templates/rust/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/repository/templates/rust/shared/src/foo.rs b/xmake/repository/templates/rust/shared/src/foo.rs new file mode 100644 index 000000000..a3a3aa4a6 --- /dev/null +++ b/xmake/repository/templates/rust/shared/src/foo.rs @@ -0,0 +1,4 @@ +pub fn add(a: i32, b: i32) -> i32 { + return a + b; +} + diff --git a/xmake/repository/templates/rust/shared/src/main.rs b/xmake/repository/templates/rust/shared/src/main.rs new file mode 100644 index 000000000..205d23da3 --- /dev/null +++ b/xmake/repository/templates/rust/shared/src/main.rs @@ -0,0 +1,6 @@ +extern crate foo; + +fn main() { + println!("hello xmake!"); + println!("add: {}", foo::add(1, 1)); +} diff --git a/xmake/repository/templates/rust/shared/xmake.lua b/xmake/repository/templates/rust/shared/xmake.lua new file mode 100644 index 000000000..52effc17b --- /dev/null +++ b/xmake/repository/templates/rust/shared/xmake.lua @@ -0,0 +1,10 @@ +target("foo") + set_kind("shared") + add_files("src/foo.rs") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("foo") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/repository/templates/rust/static/src/foo.rs b/xmake/repository/templates/rust/static/src/foo.rs new file mode 100644 index 000000000..a3a3aa4a6 --- /dev/null +++ b/xmake/repository/templates/rust/static/src/foo.rs @@ -0,0 +1,4 @@ +pub fn add(a: i32, b: i32) -> i32 { + return a + b; +} + diff --git a/xmake/repository/templates/rust/static/src/main.rs b/xmake/repository/templates/rust/static/src/main.rs new file mode 100644 index 000000000..205d23da3 --- /dev/null +++ b/xmake/repository/templates/rust/static/src/main.rs @@ -0,0 +1,6 @@ +extern crate foo; + +fn main() { + println!("hello xmake!"); + println!("add: {}", foo::add(1, 1)); +} diff --git a/xmake/repository/templates/rust/static/xmake.lua b/xmake/repository/templates/rust/static/xmake.lua new file mode 100644 index 000000000..9eb48bef1 --- /dev/null +++ b/xmake/repository/templates/rust/static/xmake.lua @@ -0,0 +1,10 @@ +target("foo") + set_kind("static") + add_files("src/foo.rs") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("foo") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/repository/templates/swift/console/src/main.swift b/xmake/repository/templates/swift/console/src/main.swift new file mode 100644 index 000000000..ee21045f4 --- /dev/null +++ b/xmake/repository/templates/swift/console/src/main.swift @@ -0,0 +1,3 @@ +import Foundation + +print("hello world!") diff --git a/xmake/repository/templates/swift/console/xmake.lua b/xmake/repository/templates/swift/console/xmake.lua new file mode 100644 index 000000000..d07f6547b --- /dev/null +++ b/xmake/repository/templates/swift/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGET_NAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.swift") + +${FAQ} diff --git a/xmake/repository/templates/vala/console/src/main.vala b/xmake/repository/templates/vala/console/src/main.vala new file mode 100644 index 000000000..8e8a32da0 --- /dev/null +++ b/xmake/repository/templates/vala/console/src/main.vala @@ -0,0 +1,21 @@ +using Lua; + +static int my_func (LuaVM vm) { + stdout.printf ("Vala Code From Lua Code! (%f)\n", vm.to_number (1)); + return 1; +} + +static int main (string[] args) { + + string code = """ + print "Lua Code From Vala Code!" + my_func(33) + """; + + var vm = new LuaVM (); + vm.open_libs (); + vm.register ("my_func", my_func); + vm.do_string (code); + + return 0; +} diff --git a/xmake/repository/templates/vala/console/xmake.lua b/xmake/repository/templates/vala/console/xmake.lua new file mode 100644 index 000000000..4fb124a8a --- /dev/null +++ b/xmake/repository/templates/vala/console/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +add_requires("lua", "glib") + +target("${TARGET_NAME}") + set_kind("binary") + add_rules("vala") + add_files("src/*.vala") + add_packages("lua", "glib") + add_values("vala.packages", "lua") + +${FAQ} diff --git a/xmake/repository/templates/vala/shared/src/main.vala b/xmake/repository/templates/vala/shared/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/xmake/repository/templates/vala/shared/src/main.vala @@ -0,0 +1,6 @@ +using MyMath; + +public void main() { + stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); + stdout.printf("\n\t8 squared is %d\n", square(8)); +} diff --git a/xmake/repository/templates/vala/shared/src/mymath.vala b/xmake/repository/templates/vala/shared/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/xmake/repository/templates/vala/shared/src/mymath.vala @@ -0,0 +1,9 @@ +namespace MyMath { + public int sum(int a, int b) { + return(a + b); + } + + public int square(int a) { + return(a * a); + } +} diff --git a/xmake/repository/templates/vala/shared/xmake.lua b/xmake/repository/templates/vala/shared/xmake.lua new file mode 100644 index 000000000..4b4291a78 --- /dev/null +++ b/xmake/repository/templates/vala/shared/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.release", "mode.debug") + +add_requires("glib") + +target("mymath") + set_kind("shared") + add_rules("vala") + add_files("src/mymath.vala") + add_values("vala.header", "mymath.h") + add_values("vala.vapi", "mymath-1.0.vapi") + add_packages("glib") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") diff --git a/xmake/repository/templates/vala/static/src/main.vala b/xmake/repository/templates/vala/static/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/xmake/repository/templates/vala/static/src/main.vala @@ -0,0 +1,6 @@ +using MyMath; + +public void main() { + stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); + stdout.printf("\n\t8 squared is %d\n", square(8)); +} diff --git a/xmake/repository/templates/vala/static/src/mymath.vala b/xmake/repository/templates/vala/static/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/xmake/repository/templates/vala/static/src/mymath.vala @@ -0,0 +1,9 @@ +namespace MyMath { + public int sum(int a, int b) { + return(a + b); + } + + public int square(int a) { + return(a * a); + } +} diff --git a/xmake/repository/templates/vala/static/xmake.lua b/xmake/repository/templates/vala/static/xmake.lua new file mode 100644 index 000000000..8e2430db7 --- /dev/null +++ b/xmake/repository/templates/vala/static/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.release", "mode.debug") + +add_requires("glib") + +target("mymath") + set_kind("static") + add_rules("vala") + add_files("src/mymath.vala") + add_values("vala.header", "mymath.h") + add_values("vala.vapi", "mymath-1.0.vapi") + add_packages("glib") + +target("${TARGET_NAME}") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") diff --git a/xmake/repository/templates/zig/console/src/main.zig b/xmake/repository/templates/zig/console/src/main.zig new file mode 100644 index 000000000..db34441e1 --- /dev/null +++ b/xmake/repository/templates/zig/console/src/main.zig @@ -0,0 +1,5 @@ +const std = @import("std"); + +pub fn main() !void { + std.debug.print("Hello, {s}!\n", .{"world"}); +} diff --git a/xmake/repository/templates/zig/console/xmake.lua b/xmake/repository/templates/zig/console/xmake.lua new file mode 100644 index 000000000..28940257d --- /dev/null +++ b/xmake/repository/templates/zig/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("binary") + add_files("src/*.zig") + +${FAQ} diff --git a/xmake/repository/templates/zig/shared/src/main.zig b/xmake/repository/templates/zig/shared/src/main.zig new file mode 100644 index 000000000..7dc7b2bc4 --- /dev/null +++ b/xmake/repository/templates/zig/shared/src/main.zig @@ -0,0 +1,7 @@ +const std = @import("std"); + +extern fn add(a: i32, b: i32) i32; + +pub fn main() !void { + std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); +} diff --git a/xmake/repository/templates/zig/shared/src/test.zig b/xmake/repository/templates/zig/shared/src/test.zig new file mode 100644 index 000000000..a04ec1544 --- /dev/null +++ b/xmake/repository/templates/zig/shared/src/test.zig @@ -0,0 +1,3 @@ +export fn add(a: i32, b: i32) i32 { + return a + b; +} diff --git a/xmake/repository/templates/zig/shared/xmake.lua b/xmake/repository/templates/zig/shared/xmake.lua new file mode 100644 index 000000000..2577bde9f --- /dev/null +++ b/xmake/repository/templates/zig/shared/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("shared") + add_files("src/test.zig") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.zig") + +${FAQ} diff --git a/xmake/repository/templates/zig/static/src/main.zig b/xmake/repository/templates/zig/static/src/main.zig new file mode 100644 index 000000000..7dc7b2bc4 --- /dev/null +++ b/xmake/repository/templates/zig/static/src/main.zig @@ -0,0 +1,7 @@ +const std = @import("std"); + +extern fn add(a: i32, b: i32) i32; + +pub fn main() !void { + std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); +} diff --git a/xmake/repository/templates/zig/static/src/test.zig b/xmake/repository/templates/zig/static/src/test.zig new file mode 100644 index 000000000..a04ec1544 --- /dev/null +++ b/xmake/repository/templates/zig/static/src/test.zig @@ -0,0 +1,3 @@ +export fn add(a: i32, b: i32) i32 { + return a + b; +} diff --git a/xmake/repository/templates/zig/static/xmake.lua b/xmake/repository/templates/zig/static/xmake.lua new file mode 100644 index 000000000..2cc6601d2 --- /dev/null +++ b/xmake/repository/templates/zig/static/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGET_NAME}") + set_kind("static") + add_files("src/test.zig") + +target("${TARGET_NAME}_demo") + set_kind("binary") + add_deps("${TARGET_NAME}") + add_files("src/main.zig") + +${FAQ} diff --git a/xmake/templates/c++/console/src/main.cpp b/xmake/templates/c++/console/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/console/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++/console/xmake.lua b/xmake/templates/c++/console/xmake.lua deleted file mode 100644 index c73be8724..000000000 --- a/xmake/templates/c++/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - -${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.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++/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++/shared/src/foo.cpp b/xmake/templates/c++/shared/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/shared/src/foo.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c++/shared/src/foo.h b/xmake/templates/c++/shared/src/foo.h deleted file mode 100644 index bd496c784..000000000 --- a/xmake/templates/c++/shared/src/foo.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_WIN32) -#define __export __declspec(dllexport) -#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -#define __export __attribute__((visibility("default"))) -#else -#define __export -#endif - -__export int add(int a, int b); - -#ifdef __cplusplus -} -#endif diff --git a/xmake/templates/c++/shared/src/main.cpp b/xmake/templates/c++/shared/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/shared/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include - -int main(int argc, char **argv) { - std::cout << "add(1, 2) = " << add(1, 2) << std::endl; - return 0; -} diff --git a/xmake/templates/c++/shared/xmake.lua b/xmake/templates/c++/shared/xmake.lua deleted file mode 100644 index 96bd36d7c..000000000 --- a/xmake/templates/c++/shared/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("shared") - add_files("src/foo.cpp") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.cpp") - -${FAQ} diff --git a/xmake/templates/c++/static/src/foo.cpp b/xmake/templates/c++/static/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/static/src/foo.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c++/static/src/foo.h b/xmake/templates/c++/static/src/foo.h deleted file mode 100644 index d2506bca9..000000000 --- a/xmake/templates/c++/static/src/foo.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -int add(int a, int b); - -#ifdef __cplusplus -} -#endif diff --git a/xmake/templates/c++/static/src/main.cpp b/xmake/templates/c++/static/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/static/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include - -int main(int argc, char **argv) { - std::cout << "add(1, 2) = " << add(1, 2) << std::endl; - return 0; -} diff --git a/xmake/templates/c++/static/xmake.lua b/xmake/templates/c++/static/xmake.lua deleted file mode 100644 index 2c15d36e8..000000000 --- a/xmake/templates/c++/static/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("static") - add_files("src/foo.cpp") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.cpp") - -${FAQ} diff --git a/xmake/templates/c++/wxwidgets/src/main.cpp b/xmake/templates/c++/wxwidgets/src/main.cpp deleted file mode 100644 index 4b43fe6e3..000000000 --- a/xmake/templates/c++/wxwidgets/src/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include - -namespace Examples { -class Frame : public wxFrame { - enum wxOwnedID { - ID_Hello = 2 - }; - - public: - Frame() : wxFrame(nullptr, wxID_ANY, "Hello World") { - auto menuFile = new wxMenu(); - menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", "Help string shown in status bar for this menu item"); - menuFile->AppendSeparator(); - menuFile->Append(wxID_EXIT); - - auto menuHelp = new wxMenu(); - menuHelp->Append(wxID_ABOUT); - auto menuBar = new wxMenuBar(); - - menuBar->Append(menuFile, "&File"); - menuBar->Append(menuHelp, "&Help"); - SetMenuBar(menuBar); - - CreateStatusBar(); - SetStatusText("Welcome to wxWidgets!"); - - menuBar->Bind(wxEVT_MENU, [&](wxCommandEvent &event) { - if (event.GetId() == ID_Hello) - wxLogMessage("Hello world from wxWidgets!"); - else if (event.GetId() == wxID_ABOUT) - wxMessageBox("This is a wxWidgets Hello World example", "About Hello World", wxOK | wxICON_INFORMATION); - else if (event.GetId() == wxID_EXIT) - Close(true); - else - event.Skip(); - }); - } -}; - -class Application : public wxApp { - bool OnInit() override { - (new Frame())->Show(); - return true; - } -}; -} // namespace Examples - -wxIMPLEMENT_APP(Examples::Application); \ No newline at end of file diff --git a/xmake/templates/c++/wxwidgets/xmake.lua b/xmake/templates/c++/wxwidgets/xmake.lua deleted file mode 100644 index 65a05c72c..000000000 --- a/xmake/templates/c++/wxwidgets/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("wxwidgets") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - set_languages("c++14") - add_packages("wxwidgets") - -${FAQ} \ No newline at end of file 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/console/src/main.c b/xmake/templates/c/console/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/console/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/console/xmake.lua b/xmake/templates/c/console/xmake.lua deleted file mode 100644 index 7e9356f26..000000000 --- a/xmake/templates/c/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.c") - -${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/shared/src/foo.c b/xmake/templates/c/shared/src/foo.c deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c/shared/src/foo.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c/shared/src/foo.h b/xmake/templates/c/shared/src/foo.h deleted file mode 100644 index e15925829..000000000 --- a/xmake/templates/c/shared/src/foo.h +++ /dev/null @@ -1,9 +0,0 @@ -#if defined(_WIN32) -#define __export __declspec(dllexport) -#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -#define __export __attribute__((visibility("default"))) -#else -#define __export -#endif - -__export int add(int a, int b); diff --git a/xmake/templates/c/shared/src/main.c b/xmake/templates/c/shared/src/main.c deleted file mode 100644 index f1c29d751..000000000 --- a/xmake/templates/c/shared/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include - -int main(int argc, char **argv) { - printf("add(1, 2) = %d\n", add(1, 2)); - return 0; -} diff --git a/xmake/templates/c/shared/xmake.lua b/xmake/templates/c/shared/xmake.lua deleted file mode 100644 index 11e8dd0dd..000000000 --- a/xmake/templates/c/shared/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("shared") - add_files("src/foo.c") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.c") - -${FAQ} diff --git a/xmake/templates/c/static/src/foo.c b/xmake/templates/c/static/src/foo.c deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c/static/src/foo.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c/static/src/foo.h b/xmake/templates/c/static/src/foo.h deleted file mode 100644 index 6295ab95c..000000000 --- a/xmake/templates/c/static/src/foo.h +++ /dev/null @@ -1 +0,0 @@ -int add(int a, int b); diff --git a/xmake/templates/c/static/src/main.c b/xmake/templates/c/static/src/main.c deleted file mode 100644 index f1c29d751..000000000 --- a/xmake/templates/c/static/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include - -int main(int argc, char **argv) { - printf("add(1, 2) = %d\n", add(1, 2)); - return 0; -} diff --git a/xmake/templates/c/static/xmake.lua b/xmake/templates/c/static/xmake.lua deleted file mode 100644 index f00e9f4f7..000000000 --- a/xmake/templates/c/static/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("static") - add_files("src/foo.c") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.c") - -${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/cuda/console/src/main.cu b/xmake/templates/cuda/console/src/main.cu deleted file mode 100644 index 2fe9ac797..000000000 --- a/xmake/templates/cuda/console/src/main.cu +++ /dev/null @@ -1,132 +0,0 @@ - -#include "cuda_runtime.h" -#include "device_launch_parameters.h" - -#include - -cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size); - -__global__ void addKernel(int *c, const int *a, const int *b) -{ - int i = threadIdx.x; - c[i] = a[i] + b[i]; -} - -int main() -{ - const int arraySize = 5; - const int a[arraySize] = {1, 2, 3, 4, 5}; - const int b[arraySize] = {10, 20, 30, 40, 50}; - int c[arraySize] = {0}; - - // Add vectors in parallel. - cudaError_t cudaStatus = addWithCuda(c, a, b, arraySize); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "addWithCuda failed!"); - return 1; - } - - printf("{1,2,3,4,5} + {10,20,30,40,50} = {%d,%d,%d,%d,%d}\n", - c[0], c[1], c[2], c[3], c[4]); - - // cudaDeviceReset must be called before exiting in order for profiling and - // tracing tools such as Nsight and Visual Profiler to show complete traces. - cudaStatus = cudaDeviceReset(); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaDeviceReset failed!"); - return 1; - } - - return 0; -} - -// Helper function for using CUDA to add vectors in parallel. -cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size) -{ - int *dev_a = 0; - int *dev_b = 0; - int *dev_c = 0; - cudaError_t cudaStatus; - - // Choose which GPU to run on, change this on a multi-GPU system. - cudaStatus = cudaSetDevice(0); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?"); - goto Error; - } - - // Allocate GPU buffers for three vectors (two input, one output) . - cudaStatus = cudaMalloc((void **)&dev_c, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - cudaStatus = cudaMalloc((void **)&dev_a, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - cudaStatus = cudaMalloc((void **)&dev_b, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - // Copy input vectors from host memory to GPU buffers. - cudaStatus = cudaMemcpy(dev_a, a, size * sizeof(int), cudaMemcpyHostToDevice); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - - cudaStatus = cudaMemcpy(dev_b, b, size * sizeof(int), cudaMemcpyHostToDevice); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - - // Launch a kernel on the GPU with one thread for each element. - addKernel<<<1, size>>>(dev_c, dev_a, dev_b); - - // Check for any errors launching the kernel - cudaStatus = cudaGetLastError(); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus)); - goto Error; - } - - // cudaDeviceSynchronize waits for the kernel to finish, and returns - // any errors encountered during the launch. - cudaStatus = cudaDeviceSynchronize(); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus); - goto Error; - } - - // Copy output vector from GPU buffer to host memory. - cudaStatus = cudaMemcpy(c, dev_c, size * sizeof(int), cudaMemcpyDeviceToHost); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - -Error: - cudaFree(dev_c); - cudaFree(dev_a); - cudaFree(dev_b); - - return cudaStatus; -} diff --git a/xmake/templates/cuda/console/xmake.lua b/xmake/templates/cuda/console/xmake.lua deleted file mode 100644 index fb393bab7..000000000 --- a/xmake/templates/cuda/console/xmake.lua +++ /dev/null @@ -1,19 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cu") - - -- generate SASS code for SM architecture of current host - add_cugencodes("native") - - -- generate PTX code for the virtual architecture to guarantee compatibility - add_cugencodes("compute_75") - - -- -- generate SASS code for each SM architecture - -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") - - -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility - -- add_cugencodes("compute_100") - -${FAQ} diff --git a/xmake/templates/cuda/shared/inc/lib.cuh b/xmake/templates/cuda/shared/inc/lib.cuh deleted file mode 100644 index 5565e3eb5..000000000 --- a/xmake/templates/cuda/shared/inc/lib.cuh +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "cuda_runtime.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if defined(_WIN32) -#define __export __declspec(dllexport) -#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -#define __export __attribute__((visibility("default"))) -#else -#define __export -#endif - - __export cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size); - -#ifdef __cplusplus -} -#endif diff --git a/xmake/templates/cuda/shared/src/lib.cu b/xmake/templates/cuda/shared/src/lib.cu deleted file mode 100644 index d2cff9ac2..000000000 --- a/xmake/templates/cuda/shared/src/lib.cu +++ /dev/null @@ -1,98 +0,0 @@ -#include -#include -#include "device_launch_parameters.h" - -__global__ void addKernel(int *c, const int *a, const int *b) -{ - int i = threadIdx.x; - c[i] = a[i] + b[i]; -} - -// Helper function for using CUDA to add vectors in parallel. -cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size) -{ - int *dev_a = 0; - int *dev_b = 0; - int *dev_c = 0; - cudaError_t cudaStatus; - - // Choose which GPU to run on, change this on a multi-GPU system. - cudaStatus = cudaSetDevice(0); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?"); - goto Error; - } - - // Allocate GPU buffers for three vectors (two input, one output) . - cudaStatus = cudaMalloc((void **)&dev_c, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - cudaStatus = cudaMalloc((void **)&dev_a, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - cudaStatus = cudaMalloc((void **)&dev_b, size * sizeof(int)); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMalloc failed!"); - goto Error; - } - - // Copy input vectors from host memory to GPU buffers. - cudaStatus = cudaMemcpy(dev_a, a, size * sizeof(int), cudaMemcpyHostToDevice); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - - cudaStatus = cudaMemcpy(dev_b, b, size * sizeof(int), cudaMemcpyHostToDevice); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - - // Launch a kernel on the GPU with one thread for each element. - addKernel<<<1, size>>>(dev_c, dev_a, dev_b); - - // Check for any errors launching the kernel - cudaStatus = cudaGetLastError(); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus)); - goto Error; - } - - // cudaDeviceSynchronize waits for the kernel to finish, and returns - // any errors encountered during the launch. - cudaStatus = cudaDeviceSynchronize(); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus); - goto Error; - } - - // Copy output vector from GPU buffer to host memory. - cudaStatus = cudaMemcpy(c, dev_c, size * sizeof(int), cudaMemcpyDeviceToHost); - if (cudaStatus != cudaSuccess) - { - fprintf(stderr, "cudaMemcpy failed!"); - goto Error; - } - -Error: - cudaFree(dev_c); - cudaFree(dev_a); - cudaFree(dev_b); - - return cudaStatus; -} diff --git a/xmake/templates/cuda/shared/xmake.lua b/xmake/templates/cuda/shared/xmake.lua deleted file mode 100644 index 5f53ff87b..000000000 --- a/xmake/templates/cuda/shared/xmake.lua +++ /dev/null @@ -1,20 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("shared") - add_files("src/**.cu") - add_includedirs("inc") - - -- generate SASS code for SM architecture of current host - add_cugencodes("native") - - -- generate PTX code for the virtual architecture to guarantee compatibility - add_cugencodes("compute_75") - - -- -- generate SASS code for each SM architecture - -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") - - -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility - -- add_cugencodes("compute_100") - -${FAQ} diff --git a/xmake/templates/cuda/static/inc/lib.cuh b/xmake/templates/cuda/static/inc/lib.cuh deleted file mode 100644 index 35255e31e..000000000 --- a/xmake/templates/cuda/static/inc/lib.cuh +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -__global__ void addKernel(int *c, const int *a, const int *b); \ No newline at end of file diff --git a/xmake/templates/cuda/static/src/lib.cu b/xmake/templates/cuda/static/src/lib.cu deleted file mode 100644 index a5f054354..000000000 --- a/xmake/templates/cuda/static/src/lib.cu +++ /dev/null @@ -1,7 +0,0 @@ -#include - -__global__ void addKernel(int *c, const int *a, const int *b) -{ - int i = threadIdx.x; - c[i] = a[i] + b[i]; -} \ No newline at end of file diff --git a/xmake/templates/cuda/static/xmake.lua b/xmake/templates/cuda/static/xmake.lua deleted file mode 100644 index 7a582cfbb..000000000 --- a/xmake/templates/cuda/static/xmake.lua +++ /dev/null @@ -1,20 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("static") - add_files("src/**.cu") - add_includedirs("inc") - - -- generate SASS code for SM architecture of current host - add_cugencodes("native") - - -- generate PTX code for the virtual architecture to guarantee compatibility - add_cugencodes("compute_75") - - -- -- generate SASS code for each SM architecture - -- add_cugencodes("sm_75", "sm_80", "sm_89", "sm_90", "sm_100") - - -- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility - -- add_cugencodes("compute_100") - -${FAQ} diff --git a/xmake/templates/dlang/console/src/main.d b/xmake/templates/dlang/console/src/main.d deleted file mode 100644 index 6bea6ec02..000000000 --- a/xmake/templates/dlang/console/src/main.d +++ /dev/null @@ -1,5 +0,0 @@ -import std.stdio; - -void main() { - writeln("hello world!"); -} diff --git a/xmake/templates/dlang/console/xmake.lua b/xmake/templates/dlang/console/xmake.lua deleted file mode 100644 index c242d60c2..000000000 --- a/xmake/templates/dlang/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.d") - -${FAQ} diff --git a/xmake/templates/dlang/shared/src/interfaces.d b/xmake/templates/dlang/shared/src/interfaces.d deleted file mode 100644 index b4f7ab6ba..000000000 --- a/xmake/templates/dlang/shared/src/interfaces.d +++ /dev/null @@ -1,15 +0,0 @@ -version(Windows) { - import core.sys.windows.windows; - import core.sys.windows.dll; - mixin SimpleDllMain; -} - -extern(C) int add(int a, int b) { - return a + b; -} - -extern(C) int sub(int a, int b) { - return a - b; -} - - diff --git a/xmake/templates/dlang/shared/src/main.d b/xmake/templates/dlang/shared/src/main.d deleted file mode 100644 index bfcf9cf56..000000000 --- a/xmake/templates/dlang/shared/src/main.d +++ /dev/null @@ -1,7 +0,0 @@ -import std.stdio; -import interfaces; - -void main() { - printf("add: %d\n", interfaces.add(1, 1)); - printf("sub: %d\n", interfaces.sub(2, 1)); -} diff --git a/xmake/templates/dlang/shared/xmake.lua b/xmake/templates/dlang/shared/xmake.lua deleted file mode 100644 index 0086bebae..000000000 --- a/xmake/templates/dlang/shared/xmake.lua +++ /dev/null @@ -1,16 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("shared") - add_files("src/interfaces.d") - add_includedirs("src", {public = true}) - add_rules("utils.symbols.export_list", {symbols = { - "add", - "sub"}}) - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.d") - -${FAQ} diff --git a/xmake/templates/dlang/static/src/interfaces.d b/xmake/templates/dlang/static/src/interfaces.d deleted file mode 100644 index 3386c9124..000000000 --- a/xmake/templates/dlang/static/src/interfaces.d +++ /dev/null @@ -1,9 +0,0 @@ -extern(C) int add(int a, int b) -{ - return a + b; -} - -extern(C) int sub(int a, int b) -{ - return a - b; -} diff --git a/xmake/templates/dlang/static/src/main.d b/xmake/templates/dlang/static/src/main.d deleted file mode 100644 index bfcf9cf56..000000000 --- a/xmake/templates/dlang/static/src/main.d +++ /dev/null @@ -1,7 +0,0 @@ -import std.stdio; -import interfaces; - -void main() { - printf("add: %d\n", interfaces.add(1, 1)); - printf("sub: %d\n", interfaces.sub(2, 1)); -} diff --git a/xmake/templates/dlang/static/xmake.lua b/xmake/templates/dlang/static/xmake.lua deleted file mode 100644 index b8fb24b37..000000000 --- a/xmake/templates/dlang/static/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("static") - add_files("src/interfaces.d") - add_includedirs("src", {public = true}) - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.d") - -${FAQ} diff --git a/xmake/templates/fortran/console/src/main.f90 b/xmake/templates/fortran/console/src/main.f90 deleted file mode 100644 index a332e8401..000000000 --- a/xmake/templates/fortran/console/src/main.f90 +++ /dev/null @@ -1,3 +0,0 @@ -program hello - print *, "Hello World!" -end program hello diff --git a/xmake/templates/fortran/console/xmake.lua b/xmake/templates/fortran/console/xmake.lua deleted file mode 100644 index 70faf8aea..000000000 --- a/xmake/templates/fortran/console/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.f90") - diff --git a/xmake/templates/fortran/shared/src/main.f90 b/xmake/templates/fortran/shared/src/main.f90 deleted file mode 100644 index 9adea3e26..000000000 --- a/xmake/templates/fortran/shared/src/main.f90 +++ /dev/null @@ -1,5 +0,0 @@ -program hello - use test, only: print_hello - implicit none (type, external) - call print_hello() -end program hello diff --git a/xmake/templates/fortran/shared/src/test.f90 b/xmake/templates/fortran/shared/src/test.f90 deleted file mode 100644 index 7b215fcdf..000000000 --- a/xmake/templates/fortran/shared/src/test.f90 +++ /dev/null @@ -1,8 +0,0 @@ -module test - implicit none (type, external) - -contains - subroutine print_hello() - print *, "Hello World!" - end subroutine print_hello -end module test diff --git a/xmake/templates/fortran/shared/xmake.lua b/xmake/templates/fortran/shared/xmake.lua deleted file mode 100644 index da6d6da3f..000000000 --- a/xmake/templates/fortran/shared/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}_lib") - set_kind("shared") - add_files("src/test.f90") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("${TARGET_NAME}_lib") - add_files("src/main.f90") - diff --git a/xmake/templates/fortran/static/src/main.f90 b/xmake/templates/fortran/static/src/main.f90 deleted file mode 100644 index 9adea3e26..000000000 --- a/xmake/templates/fortran/static/src/main.f90 +++ /dev/null @@ -1,5 +0,0 @@ -program hello - use test, only: print_hello - implicit none (type, external) - call print_hello() -end program hello diff --git a/xmake/templates/fortran/static/src/test.f90 b/xmake/templates/fortran/static/src/test.f90 deleted file mode 100644 index 7b215fcdf..000000000 --- a/xmake/templates/fortran/static/src/test.f90 +++ /dev/null @@ -1,8 +0,0 @@ -module test - implicit none (type, external) - -contains - subroutine print_hello() - print *, "Hello World!" - end subroutine print_hello -end module test diff --git a/xmake/templates/fortran/static/xmake.lua b/xmake/templates/fortran/static/xmake.lua deleted file mode 100644 index 4b91ad207..000000000 --- a/xmake/templates/fortran/static/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}_lib") - set_kind("static") - add_files("src/test.f90") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("${TARGET_NAME}_lib") - add_files("src/main.f90") - diff --git a/xmake/templates/go/console/src/main.go b/xmake/templates/go/console/src/main.go deleted file mode 100644 index b689db480..000000000 --- a/xmake/templates/go/console/src/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("hello xmake!") -} diff --git a/xmake/templates/go/console/xmake.lua b/xmake/templates/go/console/xmake.lua deleted file mode 100644 index a7861eb2a..000000000 --- a/xmake/templates/go/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.go") - -${FAQ} diff --git a/xmake/templates/go/static/src/main.go b/xmake/templates/go/static/src/main.go deleted file mode 100644 index f2b477453..000000000 --- a/xmake/templates/go/static/src/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -func main() { - - Run() -} - diff --git a/xmake/templates/go/static/src/module/add.go b/xmake/templates/go/static/src/module/add.go deleted file mode 100644 index 98ffef600..000000000 --- a/xmake/templates/go/static/src/module/add.go +++ /dev/null @@ -1,6 +0,0 @@ -package module - -func Add(a int, b int) int { - return a + b; -} - diff --git a/xmake/templates/go/static/src/module/sub.go b/xmake/templates/go/static/src/module/sub.go deleted file mode 100644 index a24a9abb7..000000000 --- a/xmake/templates/go/static/src/module/sub.go +++ /dev/null @@ -1,6 +0,0 @@ -package module - -func Sub(a int, b int) int { - return a - b; -} - diff --git a/xmake/templates/go/static/src/test.go b/xmake/templates/go/static/src/test.go deleted file mode 100644 index cf10523f9..000000000 --- a/xmake/templates/go/static/src/test.go +++ /dev/null @@ -1,12 +0,0 @@ -package main - -import ( - "fmt" - "module" -) - -func Run() { - - fmt.Printf("add: %d\n", module.Add(1, 2)); - fmt.Printf("sub: %d\n", module.Sub(1, 2)); -} diff --git a/xmake/templates/go/static/xmake.lua b/xmake/templates/go/static/xmake.lua deleted file mode 100644 index 4391d7799..000000000 --- a/xmake/templates/go/static/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("module") - set_kind("static") - add_files("src/module/*.go") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("module") - add_files("src/*.go") - -${FAQ} diff --git a/xmake/templates/kotlin/console/src/main.kt b/xmake/templates/kotlin/console/src/main.kt deleted file mode 100644 index 543f5ac8f..000000000 --- a/xmake/templates/kotlin/console/src/main.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("hello xmake!") -} diff --git a/xmake/templates/kotlin/console/xmake.lua b/xmake/templates/kotlin/console/xmake.lua deleted file mode 100644 index 935dc7c75..000000000 --- a/xmake/templates/kotlin/console/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("kotlin-native") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/main.kt") - set_toolchains("@kotlin-native") - -${FAQ} diff --git a/xmake/templates/kotlin/shared/src/foo.kt b/xmake/templates/kotlin/shared/src/foo.kt deleted file mode 100644 index cc5184bd7..000000000 --- a/xmake/templates/kotlin/shared/src/foo.kt +++ /dev/null @@ -1,2 +0,0 @@ -@CName("kotlin_add") -fun add(a: Int, b: Int): Int = a + b diff --git a/xmake/templates/kotlin/shared/src/main.c b/xmake/templates/kotlin/shared/src/main.c deleted file mode 100644 index abb3f2c12..000000000 --- a/xmake/templates/kotlin/shared/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libfoo_api.h" -#include - -int main(int argc, char **argv) { - printf("add(1, 2) = %d\n", kotlin_add(1, 2)); - return 0; -} diff --git a/xmake/templates/kotlin/shared/xmake.lua b/xmake/templates/kotlin/shared/xmake.lua deleted file mode 100644 index 97bebf8a6..000000000 --- a/xmake/templates/kotlin/shared/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") -add_requires("kotlin-native") -target("foo") - set_kind("shared") - add_files("src/foo.kt") - set_toolchains("@kotlin-native") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/main.c") - add_deps("foo") - -${FAQ} diff --git a/xmake/templates/kotlin/static/src/foo.kt b/xmake/templates/kotlin/static/src/foo.kt deleted file mode 100644 index cc5184bd7..000000000 --- a/xmake/templates/kotlin/static/src/foo.kt +++ /dev/null @@ -1,2 +0,0 @@ -@CName("kotlin_add") -fun add(a: Int, b: Int): Int = a + b diff --git a/xmake/templates/kotlin/static/src/main.c b/xmake/templates/kotlin/static/src/main.c deleted file mode 100644 index abb3f2c12..000000000 --- a/xmake/templates/kotlin/static/src/main.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "libfoo_api.h" -#include - -int main(int argc, char **argv) { - printf("add(1, 2) = %d\n", kotlin_add(1, 2)); - return 0; -} diff --git a/xmake/templates/kotlin/static/xmake.lua b/xmake/templates/kotlin/static/xmake.lua deleted file mode 100644 index 6095dbe93..000000000 --- a/xmake/templates/kotlin/static/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") -add_requires("kotlin-native") -target("foo") - set_kind("static") - add_files("src/foo.kt") - set_toolchains("@kotlin-native") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/main.c") - add_deps("foo") - -${FAQ} diff --git a/xmake/templates/nim/console/src/main.nim b/xmake/templates/nim/console/src/main.nim deleted file mode 100644 index 17179284f..000000000 --- a/xmake/templates/nim/console/src/main.nim +++ /dev/null @@ -1 +0,0 @@ -echo "hello xmake!" diff --git a/xmake/templates/nim/console/xmake.lua b/xmake/templates/nim/console/xmake.lua deleted file mode 100644 index 662945bbb..000000000 --- a/xmake/templates/nim/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/main.nim") - -${FAQ} diff --git a/xmake/templates/nim/shared/src/foo.nim b/xmake/templates/nim/shared/src/foo.nim deleted file mode 100644 index cde4de7ca..000000000 --- a/xmake/templates/nim/shared/src/foo.nim +++ /dev/null @@ -1,6 +0,0 @@ -proc foo(n: int): int {.cdecl, exportc, dynlib.} = - if n < 2: - result = n - else: - result = foo(n - 1) + (n - 2).foo - diff --git a/xmake/templates/nim/shared/src/main.nim b/xmake/templates/nim/shared/src/main.nim deleted file mode 100644 index 1be3abe69..000000000 --- a/xmake/templates/nim/shared/src/main.nim +++ /dev/null @@ -1,3 +0,0 @@ -proc foo(n: int): int {.cdecl, importc} - -echo foo(2) diff --git a/xmake/templates/nim/shared/xmake.lua b/xmake/templates/nim/shared/xmake.lua deleted file mode 100644 index 5067dafb3..000000000 --- a/xmake/templates/nim/shared/xmake.lua +++ /dev/null @@ -1,14 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("shared") - add_files("src/foo.nim") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.nim") - -${FAQ} - - diff --git a/xmake/templates/nim/static/src/foo.nim b/xmake/templates/nim/static/src/foo.nim deleted file mode 100644 index be0904262..000000000 --- a/xmake/templates/nim/static/src/foo.nim +++ /dev/null @@ -1,6 +0,0 @@ -proc foo(n: int): int {.cdecl, exportc} = - if n < 2: - result = n - else: - result = foo(n - 1) + (n - 2).foo - diff --git a/xmake/templates/nim/static/src/main.nim b/xmake/templates/nim/static/src/main.nim deleted file mode 100644 index 1be3abe69..000000000 --- a/xmake/templates/nim/static/src/main.nim +++ /dev/null @@ -1,3 +0,0 @@ -proc foo(n: int): int {.cdecl, importc} - -echo foo(2) diff --git a/xmake/templates/nim/static/xmake.lua b/xmake/templates/nim/static/xmake.lua deleted file mode 100644 index 3f2cb7dfc..000000000 --- a/xmake/templates/nim/static/xmake.lua +++ /dev/null @@ -1,14 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("static") - add_files("src/foo.nim") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.nim") - -${FAQ} - - diff --git a/xmake/templates/objc++/console/src/main.mm b/xmake/templates/objc++/console/src/main.mm deleted file mode 100644 index cbd1e8906..000000000 --- a/xmake/templates/objc++/console/src/main.mm +++ /dev/null @@ -1,8 +0,0 @@ -#import - -int main(int argc, char** argv) { - @autoreleasepool { - NSLog(@"hello world!"); - } - return 0; -} diff --git a/xmake/templates/objc++/console/xmake.lua b/xmake/templates/objc++/console/xmake.lua deleted file mode 100644 index 99749f901..000000000 --- a/xmake/templates/objc++/console/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGET_NAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.mm") - -${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/console/src/main.m b/xmake/templates/objc/console/src/main.m deleted file mode 100644 index cbd1e8906..000000000 --- a/xmake/templates/objc/console/src/main.m +++ /dev/null @@ -1,8 +0,0 @@ -#import - -int main(int argc, char** argv) { - @autoreleasepool { - NSLog(@"hello world!"); - } - return 0; -} diff --git a/xmake/templates/objc/console/xmake.lua b/xmake/templates/objc/console/xmake.lua deleted file mode 100644 index 37c01442a..000000000 --- a/xmake/templates/objc/console/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGET_NAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.m") - -${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/pascal/console/src/main.pas b/xmake/templates/pascal/console/src/main.pas deleted file mode 100644 index a908ffab7..000000000 --- a/xmake/templates/pascal/console/src/main.pas +++ /dev/null @@ -1,4 +0,0 @@ -program Hello; -begin - writeln ('Hello, world.'); -end. diff --git a/xmake/templates/pascal/console/xmake.lua b/xmake/templates/pascal/console/xmake.lua deleted file mode 100644 index 52168c3a4..000000000 --- a/xmake/templates/pascal/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.pas") - -${FAQ} diff --git a/xmake/templates/pascal/shared/src/foo.pas b/xmake/templates/pascal/shared/src/foo.pas deleted file mode 100644 index 788950f46..000000000 --- a/xmake/templates/pascal/shared/src/foo.pas +++ /dev/null @@ -1,19 +0,0 @@ -library foo; - -{$mode objfpc}{$H+} - -function fib(n : Int64) : Int64; cdecl; -begin - if n > 1 then - begin - Result := fib(n - 1) + fib(n - 2); - end - else - Result := 1; -end; - -exports - fib; -end. - - diff --git a/xmake/templates/pascal/shared/src/main.pas b/xmake/templates/pascal/shared/src/main.pas deleted file mode 100644 index 02d5e88d0..000000000 --- a/xmake/templates/pascal/shared/src/main.pas +++ /dev/null @@ -1,13 +0,0 @@ -program hello; - -function fib(n: Int64): Int64; - cdecl; external 'foo'; - -var - Value: Integer; -begin - Value := 5; - WriteLn(fib(Value)); -end. - - diff --git a/xmake/templates/pascal/shared/xmake.lua b/xmake/templates/pascal/shared/xmake.lua deleted file mode 100644 index fad68bd07..000000000 --- a/xmake/templates/pascal/shared/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") -target("foo") - set_kind("shared") - add_files("src/foo.pas") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.pas") - - -${FAQ} diff --git a/xmake/templates/rust/console/src/main.rs b/xmake/templates/rust/console/src/main.rs deleted file mode 100644 index 88d5e2749..000000000 --- a/xmake/templates/rust/console/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("hello xmake!"); -} diff --git a/xmake/templates/rust/console/xmake.lua b/xmake/templates/rust/console/xmake.lua deleted file mode 100644 index 684ea720a..000000000 --- a/xmake/templates/rust/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/main.rs") - -${FAQ} diff --git a/xmake/templates/rust/shared/src/foo.rs b/xmake/templates/rust/shared/src/foo.rs deleted file mode 100644 index a3a3aa4a6..000000000 --- a/xmake/templates/rust/shared/src/foo.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub fn add(a: i32, b: i32) -> i32 { - return a + b; -} - diff --git a/xmake/templates/rust/shared/src/main.rs b/xmake/templates/rust/shared/src/main.rs deleted file mode 100644 index 205d23da3..000000000 --- a/xmake/templates/rust/shared/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -extern crate foo; - -fn main() { - println!("hello xmake!"); - println!("add: {}", foo::add(1, 1)); -} diff --git a/xmake/templates/rust/shared/xmake.lua b/xmake/templates/rust/shared/xmake.lua deleted file mode 100644 index 52effc17b..000000000 --- a/xmake/templates/rust/shared/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -target("foo") - set_kind("shared") - add_files("src/foo.rs") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("foo") - add_files("src/main.rs") - -${FAQ} diff --git a/xmake/templates/rust/static/src/foo.rs b/xmake/templates/rust/static/src/foo.rs deleted file mode 100644 index a3a3aa4a6..000000000 --- a/xmake/templates/rust/static/src/foo.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub fn add(a: i32, b: i32) -> i32 { - return a + b; -} - diff --git a/xmake/templates/rust/static/src/main.rs b/xmake/templates/rust/static/src/main.rs deleted file mode 100644 index 205d23da3..000000000 --- a/xmake/templates/rust/static/src/main.rs +++ /dev/null @@ -1,6 +0,0 @@ -extern crate foo; - -fn main() { - println!("hello xmake!"); - println!("add: {}", foo::add(1, 1)); -} diff --git a/xmake/templates/rust/static/xmake.lua b/xmake/templates/rust/static/xmake.lua deleted file mode 100644 index 9eb48bef1..000000000 --- a/xmake/templates/rust/static/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -target("foo") - set_kind("static") - add_files("src/foo.rs") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("foo") - add_files("src/main.rs") - -${FAQ} diff --git a/xmake/templates/swift/console/src/main.swift b/xmake/templates/swift/console/src/main.swift deleted file mode 100644 index ee21045f4..000000000 --- a/xmake/templates/swift/console/src/main.swift +++ /dev/null @@ -1,3 +0,0 @@ -import Foundation - -print("hello world!") diff --git a/xmake/templates/swift/console/xmake.lua b/xmake/templates/swift/console/xmake.lua deleted file mode 100644 index d07f6547b..000000000 --- a/xmake/templates/swift/console/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGET_NAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.swift") - -${FAQ} diff --git a/xmake/templates/vala/console/src/main.vala b/xmake/templates/vala/console/src/main.vala deleted file mode 100644 index 8e8a32da0..000000000 --- a/xmake/templates/vala/console/src/main.vala +++ /dev/null @@ -1,21 +0,0 @@ -using Lua; - -static int my_func (LuaVM vm) { - stdout.printf ("Vala Code From Lua Code! (%f)\n", vm.to_number (1)); - return 1; -} - -static int main (string[] args) { - - string code = """ - print "Lua Code From Vala Code!" - my_func(33) - """; - - var vm = new LuaVM (); - vm.open_libs (); - vm.register ("my_func", my_func); - vm.do_string (code); - - return 0; -} diff --git a/xmake/templates/vala/console/xmake.lua b/xmake/templates/vala/console/xmake.lua deleted file mode 100644 index 4fb124a8a..000000000 --- a/xmake/templates/vala/console/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("lua", "glib") - -target("${TARGET_NAME}") - set_kind("binary") - add_rules("vala") - add_files("src/*.vala") - add_packages("lua", "glib") - add_values("vala.packages", "lua") - -${FAQ} diff --git a/xmake/templates/vala/shared/src/main.vala b/xmake/templates/vala/shared/src/main.vala deleted file mode 100644 index da9fd895e..000000000 --- a/xmake/templates/vala/shared/src/main.vala +++ /dev/null @@ -1,6 +0,0 @@ -using MyMath; - -public void main() { - stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); - stdout.printf("\n\t8 squared is %d\n", square(8)); -} diff --git a/xmake/templates/vala/shared/src/mymath.vala b/xmake/templates/vala/shared/src/mymath.vala deleted file mode 100644 index 4f4e761c5..000000000 --- a/xmake/templates/vala/shared/src/mymath.vala +++ /dev/null @@ -1,9 +0,0 @@ -namespace MyMath { - public int sum(int a, int b) { - return(a + b); - } - - public int square(int a) { - return(a * a); - } -} diff --git a/xmake/templates/vala/shared/xmake.lua b/xmake/templates/vala/shared/xmake.lua deleted file mode 100644 index 4b4291a78..000000000 --- a/xmake/templates/vala/shared/xmake.lua +++ /dev/null @@ -1,18 +0,0 @@ -add_rules("mode.release", "mode.debug") - -add_requires("glib") - -target("mymath") - set_kind("shared") - add_rules("vala") - add_files("src/mymath.vala") - add_values("vala.header", "mymath.h") - add_values("vala.vapi", "mymath-1.0.vapi") - add_packages("glib") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("mymath") - add_rules("vala") - add_files("src/main.vala") - add_packages("glib") diff --git a/xmake/templates/vala/static/src/main.vala b/xmake/templates/vala/static/src/main.vala deleted file mode 100644 index da9fd895e..000000000 --- a/xmake/templates/vala/static/src/main.vala +++ /dev/null @@ -1,6 +0,0 @@ -using MyMath; - -public void main() { - stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); - stdout.printf("\n\t8 squared is %d\n", square(8)); -} diff --git a/xmake/templates/vala/static/src/mymath.vala b/xmake/templates/vala/static/src/mymath.vala deleted file mode 100644 index 4f4e761c5..000000000 --- a/xmake/templates/vala/static/src/mymath.vala +++ /dev/null @@ -1,9 +0,0 @@ -namespace MyMath { - public int sum(int a, int b) { - return(a + b); - } - - public int square(int a) { - return(a * a); - } -} diff --git a/xmake/templates/vala/static/xmake.lua b/xmake/templates/vala/static/xmake.lua deleted file mode 100644 index 8e2430db7..000000000 --- a/xmake/templates/vala/static/xmake.lua +++ /dev/null @@ -1,18 +0,0 @@ -add_rules("mode.release", "mode.debug") - -add_requires("glib") - -target("mymath") - set_kind("static") - add_rules("vala") - add_files("src/mymath.vala") - add_values("vala.header", "mymath.h") - add_values("vala.vapi", "mymath-1.0.vapi") - add_packages("glib") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("mymath") - add_rules("vala") - add_files("src/main.vala") - add_packages("glib") diff --git a/xmake/templates/zig/console/src/main.zig b/xmake/templates/zig/console/src/main.zig deleted file mode 100644 index db34441e1..000000000 --- a/xmake/templates/zig/console/src/main.zig +++ /dev/null @@ -1,5 +0,0 @@ -const std = @import("std"); - -pub fn main() !void { - std.debug.print("Hello, {s}!\n", .{"world"}); -} diff --git a/xmake/templates/zig/console/xmake.lua b/xmake/templates/zig/console/xmake.lua deleted file mode 100644 index 28940257d..000000000 --- a/xmake/templates/zig/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.zig") - -${FAQ} diff --git a/xmake/templates/zig/shared/src/main.zig b/xmake/templates/zig/shared/src/main.zig deleted file mode 100644 index 7dc7b2bc4..000000000 --- a/xmake/templates/zig/shared/src/main.zig +++ /dev/null @@ -1,7 +0,0 @@ -const std = @import("std"); - -extern fn add(a: i32, b: i32) i32; - -pub fn main() !void { - std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); -} diff --git a/xmake/templates/zig/shared/src/test.zig b/xmake/templates/zig/shared/src/test.zig deleted file mode 100644 index a04ec1544..000000000 --- a/xmake/templates/zig/shared/src/test.zig +++ /dev/null @@ -1,3 +0,0 @@ -export fn add(a: i32, b: i32) i32 { - return a + b; -} diff --git a/xmake/templates/zig/shared/xmake.lua b/xmake/templates/zig/shared/xmake.lua deleted file mode 100644 index 2577bde9f..000000000 --- a/xmake/templates/zig/shared/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("shared") - add_files("src/test.zig") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.zig") - -${FAQ} diff --git a/xmake/templates/zig/static/src/main.zig b/xmake/templates/zig/static/src/main.zig deleted file mode 100644 index 7dc7b2bc4..000000000 --- a/xmake/templates/zig/static/src/main.zig +++ /dev/null @@ -1,7 +0,0 @@ -const std = @import("std"); - -extern fn add(a: i32, b: i32) i32; - -pub fn main() !void { - std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); -} diff --git a/xmake/templates/zig/static/src/test.zig b/xmake/templates/zig/static/src/test.zig deleted file mode 100644 index a04ec1544..000000000 --- a/xmake/templates/zig/static/src/test.zig +++ /dev/null @@ -1,3 +0,0 @@ -export fn add(a: i32, b: i32) i32 { - return a + b; -} diff --git a/xmake/templates/zig/static/xmake.lua b/xmake/templates/zig/static/xmake.lua deleted file mode 100644 index 2cc6601d2..000000000 --- a/xmake/templates/zig/static/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("static") - add_files("src/test.zig") - -target("${TARGET_NAME}_demo") - set_kind("binary") - add_deps("${TARGET_NAME}") - add_files("src/main.zig") - -${FAQ} -- cgit v1.3.1 From 6697684c141ef8e80d1e1d9a89770167f2344cdd Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 4 Mar 2026 00:46:35 +0800 Subject: improve tip info --- core/src/cli/xmake.lua | 5 ++--- core/src/cli/xmake.sh | 2 +- xmake/actions/create/main.lua | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/cli/xmake.lua b/core/src/cli/xmake.lua index 98e86b128..7cd50cb2c 100644 --- a/core/src/cli/xmake.lua +++ b/core/src/cli/xmake.lua @@ -58,7 +58,7 @@ target("cli") add_installfiles("$(projectdir)/../NOTICE.md") add_installfiles("$(projectdir)/../xmake/(**.lua)") add_installfiles("$(projectdir)/../xmake/(scripts/**)") - add_installfiles("$(projectdir)/../xmake/(templates/**)") + add_installfiles("$(projectdir)/../xmake/(repository/templates/**)") add_installfiles("$(projectdir)/../scripts/xrepo.bat") add_installfiles("$(projectdir)/../scripts/xrepo.ps1") set_prefixdir("/", {bindir = "/"}) @@ -68,7 +68,7 @@ target("cli") else add_installfiles("$(projectdir)/../(xmake/**.lua)", {prefixdir = "share"}) add_installfiles("$(projectdir)/../(xmake/scripts/**)", {prefixdir = "share"}) - add_installfiles("$(projectdir)/../(xmake/templates/**)", {prefixdir = "share"}) + add_installfiles("$(projectdir)/../(xmake/repository/templates/**)", {prefixdir = "share"}) add_installfiles("$(projectdir)/../scripts/xrepo.sh", {prefixdir = "bin", filename = "xrepo"}) end @@ -91,4 +91,3 @@ target("cli") batchcmds:rmdir(package:installdir("toolchains")) end end) - diff --git a/core/src/cli/xmake.sh b/core/src/cli/xmake.sh index 6ae33ef16..af4e8ba36 100755 --- a/core/src/cli/xmake.sh +++ b/core/src/cli/xmake.sh @@ -32,7 +32,7 @@ target "cli" add_installfiles "${projectdir}/(xmake/scripts/virtualenvs/**)" "share" add_installfiles "${projectdir}/(xmake/scripts/conan/**)" "share" add_installfiles "${projectdir}/(xmake/scripts/module/**)" "share" - add_installfiles "${projectdir}/(xmake/templates/**)" "share" + add_installfiles "${projectdir}/(xmake/repository/templates/**)" "share" add_installfiles "${projectdir}/scripts/xrepo.sh" "bin" "xrepo" # fix os.exec() call incorrect program from /mingw64/bin. e.g. python, .. diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua index 72b69f3b2..89a4791a6 100644 --- a/xmake/actions/create/main.lua +++ b/xmake/actions/create/main.lua @@ -194,7 +194,9 @@ function _create_project(lang, templateid, targetname) -- create project local sourcedir = template.templatedir(lang, templateid) - assert(sourcedir, "template(%s/%s): not found!", lang, templateid) + if not sourcedir then + raise("template(%s/%s): not found!\nyou can try:\n - xrepo update-repo (update repositories)\n - xmake create --list (show available templates)", lang, templateid) + end -- get the builtin variables local builtinvars = template.builtinvars(targetname) -- cgit v1.3.1 From 074e35d2647a9271d37ecc30f41b4ca7332033ac Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 4 Mar 2026 00:54:44 +0800 Subject: improve language list --- xmake/actions/create/template.lua | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/xmake/actions/create/template.lua b/xmake/actions/create/template.lua index ea4c06b2f..d638034cf 100644 --- a/xmake/actions/create/template.lua +++ b/xmake/actions/create/template.lua @@ -139,20 +139,13 @@ function replace_variables_in_files(files, vars) end -- get all languages from templates +-- +-- scanning template roots to detect languages is too slow, and the language module list does not fully match template language names, +-- so we hardcode it here for better performance. function languages() - local found = hashset.new() - for _, rootdir in ipairs(rootdirs()) do - local languages_dirs = os.dirs(path.join(rootdir, "*")) - if languages_dirs then - for _, d in ipairs(languages_dirs) do - local name = path.filename(d) - found:insert(name) - end - end - end - local results = found:to_array() - table.sort(results) - return results + return {"c", "c++", "cuda", "dlang", "fortran", "go", + "kotlin", "nim", "objc", "objc++", "pascal", + "rust", "swift", "vala", "zig"} end -- get all templates for the given language -- cgit v1.3.1