From 5280c9480cb0d7d3ab55d516e296152ec273e14a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 28 Feb 2026 21:55:13 +0800 Subject: rewrite templates --- xmake/actions/create/main.lua | 88 +-- xmake/actions/create/template.lua | 134 ++++ xmake/actions/create/xmake.lua | 143 ++-- xmake/core/project/template.lua | 168 ----- .../modules/import/core/project/template.lua | 39 -- xmake/templates/c++/console/project/src/main.cpp | 6 - xmake/templates/c++/console/project/xmake.lua | 7 - xmake/templates/c++/console/src/main.cpp | 6 + xmake/templates/c++/console/template.lua | 2 - xmake/templates/c++/console/xmake.lua | 7 + .../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 + .../project/modules/binary/bar/.gitignore | 8 - .../project/modules/binary/bar/src/add.cpp | 9 - .../project/modules/binary/bar/src/sub.cpp | 9 - .../project/modules/binary/bar/xmake.lua | 10 - .../c++/module.binary/project/src/main.cpp | 6 - .../templates/c++/module.binary/project/xmake.lua | 15 - xmake/templates/c++/module.binary/src/main.cpp | 6 + xmake/templates/c++/module.binary/template.lua | 2 - xmake/templates/c++/module.binary/xmake.lua | 15 + .../module.shared/modules/shared/foo/src/foo.cpp | 22 + .../c++/module.shared/modules/shared/foo/xmake.lua | 6 + .../project/modules/shared/foo/src/foo.cpp | 22 - .../project/modules/shared/foo/xmake.lua | 6 - .../c++/module.shared/project/src/main.cpp | 6 - .../templates/c++/module.shared/project/xmake.lua | 15 - xmake/templates/c++/module.shared/src/main.cpp | 6 + xmake/templates/c++/module.shared/template.lua | 2 - xmake/templates/c++/module.shared/xmake.lua | 15 + .../templates/c++/qt.console/project/src/main.cpp | 7 - xmake/templates/c++/qt.console/project/xmake.lua | 7 - xmake/templates/c++/qt.console/src/main.cpp | 7 + xmake/templates/c++/qt.console/template.lua | 3 - xmake/templates/c++/qt.console/xmake.lua | 7 + .../templates/c++/qt.quickapp/project/src/main.cpp | 17 - .../templates/c++/qt.quickapp/project/src/main.qml | 18 - .../templates/c++/qt.quickapp/project/src/qml.qrc | 5 - xmake/templates/c++/qt.quickapp/project/xmake.lua | 9 - 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/template.lua | 3 - xmake/templates/c++/qt.quickapp/xmake.lua | 9 + .../c++/qt.quickapp_static/project/src/main.cpp | 17 - .../c++/qt.quickapp_static/project/src/main.qml | 18 - .../c++/qt.quickapp_static/project/src/qml.qrc | 5 - .../c++/qt.quickapp_static/project/xmake.lua | 16 - .../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 + .../templates/c++/qt.quickapp_static/template.lua | 3 - xmake/templates/c++/qt.quickapp_static/xmake.lua | 16 + xmake/templates/c++/qt.shared/project/src/demo.cpp | 4 - xmake/templates/c++/qt.shared/project/src/demo.h | 11 - .../c++/qt.shared/project/src/demo_global.h | 12 - xmake/templates/c++/qt.shared/project/xmake.lua | 10 - 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/template.lua | 3 - xmake/templates/c++/qt.shared/xmake.lua | 10 + xmake/templates/c++/qt.static/project/src/demo.cpp | 4 - xmake/templates/c++/qt.static/project/src/demo.h | 9 - xmake/templates/c++/qt.static/project/xmake.lua | 9 - xmake/templates/c++/qt.static/src/demo.cpp | 4 + xmake/templates/c++/qt.static/src/demo.h | 9 + xmake/templates/c++/qt.static/template.lua | 3 - xmake/templates/c++/qt.static/xmake.lua | 9 + .../c++/qt.widgetapp/project/src/main.cpp | 9 - .../c++/qt.widgetapp/project/src/mainwindow.cpp | 10 - .../c++/qt.widgetapp/project/src/mainwindow.h | 21 - .../c++/qt.widgetapp/project/src/mainwindow.ui | 24 - xmake/templates/c++/qt.widgetapp/project/xmake.lua | 11 - 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/template.lua | 3 - xmake/templates/c++/qt.widgetapp/xmake.lua | 11 + .../c++/qt.widgetapp_static/project/src/main.cpp | 10 - .../qt.widgetapp_static/project/src/mainwindow.cpp | 10 - .../qt.widgetapp_static/project/src/mainwindow.h | 21 - .../qt.widgetapp_static/project/src/mainwindow.ui | 24 - .../c++/qt.widgetapp_static/project/xmake.lua | 18 - .../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/template.lua | 3 - xmake/templates/c++/qt.widgetapp_static/xmake.lua | 18 + xmake/templates/c++/shared/project/src/foo.cpp | 5 - xmake/templates/c++/shared/project/src/foo.h | 17 - xmake/templates/c++/shared/project/src/main.cpp | 7 - xmake/templates/c++/shared/project/xmake.lua | 12 - 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/template.lua | 2 - xmake/templates/c++/shared/xmake.lua | 12 + xmake/templates/c++/static/project/src/foo.cpp | 5 - xmake/templates/c++/static/project/src/foo.h | 9 - xmake/templates/c++/static/project/src/main.cpp | 7 - xmake/templates/c++/static/project/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/template.lua | 2 - xmake/templates/c++/static/xmake.lua | 12 + .../c++/tbox.console/project/src/main.cpp | 15 - .../c++/tbox.console/project/src/xmake.lua | 15 - xmake/templates/c++/tbox.console/project/xmake.lua | 21 - xmake/templates/c++/tbox.console/src/main.cpp | 15 + xmake/templates/c++/tbox.console/src/xmake.lua | 15 + xmake/templates/c++/tbox.console/template.lua | 4 - xmake/templates/c++/tbox.console/xmake.lua | 21 + .../c++/tbox.shared/project/src/_demo/main.cpp | 16 - .../c++/tbox.shared/project/src/_demo/xmake.lua | 7 - .../tbox.shared/project/src/_library/interface.cpp | 11 - .../tbox.shared/project/src/_library/interface.h | 22 - .../c++/tbox.shared/project/src/_library/xmake.lua | 21 - xmake/templates/c++/tbox.shared/project/xmake.lua | 21 - .../tbox.shared/src/${TARGETNAME}/interface.cpp | 11 + .../c++/tbox.shared/src/${TARGETNAME}/interface.h | 22 + .../c++/tbox.shared/src/${TARGETNAME}/xmake.lua | 21 + .../tbox.shared/src/${TARGETNAME}_demo/main.cpp | 16 + .../tbox.shared/src/${TARGETNAME}_demo/xmake.lua | 7 + xmake/templates/c++/tbox.shared/template.lua | 9 - xmake/templates/c++/tbox.shared/xmake.lua | 21 + .../c++/tbox.static/project/src/_demo/main.cpp | 16 - .../c++/tbox.static/project/src/_demo/xmake.lua | 7 - .../tbox.static/project/src/_library/interface.cpp | 11 - .../tbox.static/project/src/_library/interface.h | 22 - .../c++/tbox.static/project/src/_library/xmake.lua | 21 - xmake/templates/c++/tbox.static/project/xmake.lua | 21 - .../tbox.static/src/${TARGETNAME}/interface.cpp | 11 + .../c++/tbox.static/src/${TARGETNAME}/interface.h | 22 + .../c++/tbox.static/src/${TARGETNAME}/xmake.lua | 21 + .../tbox.static/src/${TARGETNAME}_demo/main.cpp | 16 + .../tbox.static/src/${TARGETNAME}_demo/xmake.lua | 7 + xmake/templates/c++/tbox.static/template.lua | 9 - xmake/templates/c++/tbox.static/xmake.lua | 21 + xmake/templates/c++/wxwidgets/project/src/main.cpp | 48 -- xmake/templates/c++/wxwidgets/project/xmake.lua | 11 - xmake/templates/c++/wxwidgets/src/main.cpp | 48 ++ xmake/templates/c++/wxwidgets/template.lua | 3 - xmake/templates/c++/wxwidgets/xmake.lua | 11 + .../c++/xmake.cli/project/src/lni/main.cpp | 23 - .../c++/xmake.cli/project/src/lua/main.lua | 10 - xmake/templates/c++/xmake.cli/project/xmake.lua | 12 - xmake/templates/c++/xmake.cli/src/lni/main.cpp | 23 + xmake/templates/c++/xmake.cli/src/lua/main.lua | 10 + xmake/templates/c++/xmake.cli/template.lua | 3 - xmake/templates/c++/xmake.cli/xmake.lua | 12 + xmake/templates/c/console/project/src/main.c | 6 - xmake/templates/c/console/project/xmake.lua | 7 - xmake/templates/c/console/src/main.c | 6 + xmake/templates/c/console/template.lua | 2 - xmake/templates/c/console/xmake.lua | 7 + .../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 + .../project/modules/binary/bar/.gitignore | 8 - .../project/modules/binary/bar/src/add.c | 9 - .../project/modules/binary/bar/src/sub.c | 9 - .../project/modules/binary/bar/xmake.lua | 10 - xmake/templates/c/module.binary/project/src/main.c | 6 - xmake/templates/c/module.binary/project/xmake.lua | 15 - xmake/templates/c/module.binary/src/main.c | 6 + xmake/templates/c/module.binary/template.lua | 2 - xmake/templates/c/module.binary/xmake.lua | 15 + .../c/module.shared/modules/shared/foo/src/foo.c | 22 + .../c/module.shared/modules/shared/foo/xmake.lua | 6 + .../project/modules/shared/foo/src/foo.c | 22 - .../project/modules/shared/foo/xmake.lua | 6 - xmake/templates/c/module.shared/project/src/main.c | 6 - xmake/templates/c/module.shared/project/xmake.lua | 15 - xmake/templates/c/module.shared/src/main.c | 6 + xmake/templates/c/module.shared/template.lua | 2 - xmake/templates/c/module.shared/xmake.lua | 15 + xmake/templates/c/shared/project/src/foo.c | 5 - xmake/templates/c/shared/project/src/foo.h | 9 - xmake/templates/c/shared/project/src/main.c | 7 - xmake/templates/c/shared/project/xmake.lua | 12 - 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/template.lua | 2 - xmake/templates/c/shared/xmake.lua | 12 + xmake/templates/c/static/project/src/foo.c | 5 - xmake/templates/c/static/project/src/foo.h | 1 - xmake/templates/c/static/project/src/main.c | 7 - xmake/templates/c/static/project/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/template.lua | 2 - xmake/templates/c/static/xmake.lua | 12 + xmake/templates/c/tbox.console/project/src/main.c | 15 - .../templates/c/tbox.console/project/src/xmake.lua | 15 - xmake/templates/c/tbox.console/project/xmake.lua | 19 - xmake/templates/c/tbox.console/src/main.c | 15 + xmake/templates/c/tbox.console/src/xmake.lua | 15 + xmake/templates/c/tbox.console/template.lua | 4 - xmake/templates/c/tbox.console/xmake.lua | 19 + .../c/tbox.shared/project/src/_demo/main.c | 16 - .../c/tbox.shared/project/src/_demo/xmake.lua | 7 - .../c/tbox.shared/project/src/_library/interface.c | 11 - .../c/tbox.shared/project/src/_library/interface.h | 22 - .../c/tbox.shared/project/src/_library/xmake.lua | 21 - xmake/templates/c/tbox.shared/project/xmake.lua | 21 - .../c/tbox.shared/src/${TARGETNAME}/interface.c | 11 + .../c/tbox.shared/src/${TARGETNAME}/interface.h | 22 + .../c/tbox.shared/src/${TARGETNAME}/xmake.lua | 21 + .../c/tbox.shared/src/${TARGETNAME}_demo/main.c | 16 + .../c/tbox.shared/src/${TARGETNAME}_demo/xmake.lua | 7 + xmake/templates/c/tbox.shared/template.lua | 9 - xmake/templates/c/tbox.shared/xmake.lua | 21 + .../c/tbox.static/project/src/_demo/main.c | 16 - .../c/tbox.static/project/src/_demo/xmake.lua | 7 - .../c/tbox.static/project/src/_library/interface.c | 11 - .../c/tbox.static/project/src/_library/interface.h | 22 - .../c/tbox.static/project/src/_library/xmake.lua | 21 - xmake/templates/c/tbox.static/project/xmake.lua | 21 - .../c/tbox.static/src/${TARGETNAME}/interface.c | 11 + .../c/tbox.static/src/${TARGETNAME}/interface.h | 22 + .../c/tbox.static/src/${TARGETNAME}/xmake.lua | 21 + .../c/tbox.static/src/${TARGETNAME}_demo/main.c | 16 + .../c/tbox.static/src/${TARGETNAME}_demo/xmake.lua | 7 + xmake/templates/c/tbox.static/template.lua | 9 - xmake/templates/c/tbox.static/xmake.lua | 21 + xmake/templates/c/xmake.cli/project/src/lni/main.c | 21 - .../templates/c/xmake.cli/project/src/lua/main.lua | 10 - xmake/templates/c/xmake.cli/project/xmake.lua | 11 - xmake/templates/c/xmake.cli/src/lni/main.c | 21 + xmake/templates/c/xmake.cli/src/lua/main.lua | 10 + xmake/templates/c/xmake.cli/template.lua | 3 - xmake/templates/c/xmake.cli/xmake.lua | 11 + xmake/templates/cuda/console/project/src/main.cu | 132 ---- xmake/templates/cuda/console/project/xmake.lua | 19 - xmake/templates/cuda/console/src/main.cu | 132 ++++ xmake/templates/cuda/console/template.lua | 2 - xmake/templates/cuda/console/xmake.lua | 19 + xmake/templates/cuda/shared/inc/lib.cuh | 22 + xmake/templates/cuda/shared/project/inc/lib.cuh | 22 - xmake/templates/cuda/shared/project/src/lib.cu | 98 --- xmake/templates/cuda/shared/project/xmake.lua | 20 - xmake/templates/cuda/shared/src/lib.cu | 98 +++ xmake/templates/cuda/shared/template.lua | 2 - xmake/templates/cuda/shared/xmake.lua | 20 + xmake/templates/cuda/static/inc/lib.cuh | 3 + xmake/templates/cuda/static/project/inc/lib.cuh | 3 - xmake/templates/cuda/static/project/src/lib.cu | 7 - xmake/templates/cuda/static/project/xmake.lua | 20 - xmake/templates/cuda/static/src/lib.cu | 7 + xmake/templates/cuda/static/template.lua | 2 - xmake/templates/cuda/static/xmake.lua | 20 + xmake/templates/dlang/console/project/src/main.d | 5 - xmake/templates/dlang/console/project/xmake.lua | 7 - xmake/templates/dlang/console/src/main.d | 5 + xmake/templates/dlang/console/template.lua | 2 - xmake/templates/dlang/console/xmake.lua | 7 + .../dlang/shared/project/src/interfaces.d | 15 - xmake/templates/dlang/shared/project/src/main.d | 7 - xmake/templates/dlang/shared/project/xmake.lua | 16 - xmake/templates/dlang/shared/src/interfaces.d | 15 + xmake/templates/dlang/shared/src/main.d | 7 + xmake/templates/dlang/shared/template.lua | 2 - xmake/templates/dlang/shared/xmake.lua | 16 + .../dlang/static/project/src/interfaces.d | 9 - xmake/templates/dlang/static/project/src/main.d | 7 - xmake/templates/dlang/static/project/xmake.lua | 13 - xmake/templates/dlang/static/src/interfaces.d | 9 + xmake/templates/dlang/static/src/main.d | 7 + xmake/templates/dlang/static/template.lua | 2 - xmake/templates/dlang/static/xmake.lua | 13 + .../templates/fortran/console/project/src/main.f90 | 3 - xmake/templates/fortran/console/project/xmake.lua | 6 - xmake/templates/fortran/console/src/main.f90 | 3 + xmake/templates/fortran/console/template.lua | 2 - xmake/templates/fortran/console/xmake.lua | 6 + .../templates/fortran/shared/project/src/main.f90 | 5 - .../templates/fortran/shared/project/src/test.f90 | 8 - xmake/templates/fortran/shared/project/xmake.lua | 11 - xmake/templates/fortran/shared/src/main.f90 | 5 + xmake/templates/fortran/shared/src/test.f90 | 8 + xmake/templates/fortran/shared/template.lua | 2 - xmake/templates/fortran/shared/xmake.lua | 11 + .../templates/fortran/static/project/src/main.f90 | 5 - .../templates/fortran/static/project/src/test.f90 | 8 - xmake/templates/fortran/static/project/xmake.lua | 11 - xmake/templates/fortran/static/src/main.f90 | 5 + xmake/templates/fortran/static/src/test.f90 | 8 + xmake/templates/fortran/static/template.lua | 2 - xmake/templates/fortran/static/xmake.lua | 11 + xmake/templates/go/console/project/src/main.go | 7 - xmake/templates/go/console/project/xmake.lua | 7 - xmake/templates/go/console/src/main.go | 7 + xmake/templates/go/console/template.lua | 2 - xmake/templates/go/console/xmake.lua | 7 + xmake/templates/go/static/project/src/main.go | 7 - .../templates/go/static/project/src/module/add.go | 6 - .../templates/go/static/project/src/module/sub.go | 6 - xmake/templates/go/static/project/src/test.go | 12 - xmake/templates/go/static/project/xmake.lua | 12 - 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/template.lua | 2 - xmake/templates/go/static/xmake.lua | 12 + xmake/templates/kotlin/console/project/src/main.kt | 3 - xmake/templates/kotlin/console/project/xmake.lua | 10 - xmake/templates/kotlin/console/src/main.kt | 3 + xmake/templates/kotlin/console/template.lua | 2 - 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 + .../kotlin/shared_library/project/src/foo.kt | 2 - .../kotlin/shared_library/project/src/main.c | 7 - .../kotlin/shared_library/project/xmake.lua | 13 - xmake/templates/kotlin/shared_library/template.lua | 2 - xmake/templates/kotlin/static/src/foo.kt | 2 + xmake/templates/kotlin/static/src/main.c | 7 + xmake/templates/kotlin/static/xmake.lua | 13 + .../kotlin/static_library/project/src/foo.kt | 2 - .../kotlin/static_library/project/src/main.c | 7 - .../kotlin/static_library/project/xmake.lua | 13 - xmake/templates/kotlin/static_library/template.lua | 2 - xmake/templates/nim/console/project/src/main.nim | 1 - xmake/templates/nim/console/project/xmake.lua | 7 - xmake/templates/nim/console/src/main.nim | 1 + xmake/templates/nim/console/template.lua | 2 - xmake/templates/nim/console/xmake.lua | 7 + xmake/templates/nim/shared/project/src/foo.nim | 6 - xmake/templates/nim/shared/project/src/main.nim | 3 - xmake/templates/nim/shared/project/xmake.lua | 14 - xmake/templates/nim/shared/src/foo.nim | 6 + xmake/templates/nim/shared/src/main.nim | 3 + xmake/templates/nim/shared/template.lua | 2 - xmake/templates/nim/shared/xmake.lua | 14 + xmake/templates/nim/static/project/src/foo.nim | 6 - xmake/templates/nim/static/project/src/main.nim | 3 - xmake/templates/nim/static/project/xmake.lua | 14 - xmake/templates/nim/static/src/foo.nim | 6 + xmake/templates/nim/static/src/main.nim | 3 + xmake/templates/nim/static/template.lua | 2 - xmake/templates/nim/static/xmake.lua | 14 + .../templates/objc++/bundle/project/src/Info.plist | 24 - xmake/templates/objc++/bundle/project/src/test.h | 3 - xmake/templates/objc++/bundle/project/src/test.mm | 5 - xmake/templates/objc++/bundle/project/xmake.lua | 9 - xmake/templates/objc++/bundle/template.lua | 2 - xmake/templates/objc++/console/project/src/main.mm | 8 - xmake/templates/objc++/console/project/xmake.lua | 13 - xmake/templates/objc++/console/src/main.mm | 8 + xmake/templates/objc++/console/template.lua | 2 - xmake/templates/objc++/console/xmake.lua | 13 + .../objc++/framework/project/src/Info.plist | 24 - .../templates/objc++/framework/project/src/test.h | 3 - .../templates/objc++/framework/project/src/test.mm | 5 - xmake/templates/objc++/framework/project/xmake.lua | 9 - xmake/templates/objc++/framework/template.lua | 2 - 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/bundle/project/src/Info.plist | 24 - xmake/templates/objc/bundle/project/src/test.h | 3 - xmake/templates/objc/bundle/project/src/test.m | 5 - xmake/templates/objc/bundle/project/xmake.lua | 9 - xmake/templates/objc/bundle/template.lua | 2 - xmake/templates/objc/console/project/src/main.m | 8 - xmake/templates/objc/console/project/xmake.lua | 13 - xmake/templates/objc/console/src/main.m | 8 + xmake/templates/objc/console/template.lua | 2 - xmake/templates/objc/console/xmake.lua | 13 + .../objc/framework/project/src/Info.plist | 24 - xmake/templates/objc/framework/project/src/test.h | 3 - xmake/templates/objc/framework/project/src/test.m | 5 - xmake/templates/objc/framework/project/xmake.lua | 9 - xmake/templates/objc/framework/template.lua | 2 - .../objc/iosapp/project/src/AppDelegate.h | 15 - .../objc/iosapp/project/src/AppDelegate.m | 41 -- .../AppIcon.appiconset/Contents.json | 98 --- .../project/src/Assets.xcassets/Contents.json | 6 - .../project/src/Base.lproj/LaunchScreen.storyboard | 25 - .../iosapp/project/src/Base.lproj/Main.storyboard | 24 - xmake/templates/objc/iosapp/project/src/Info.plist | 66 -- .../objc/iosapp/project/src/SceneDelegate.h | 16 - .../objc/iosapp/project/src/SceneDelegate.m | 50 -- .../objc/iosapp/project/src/ViewController.h | 15 - .../objc/iosapp/project/src/ViewController.m | 23 - xmake/templates/objc/iosapp/project/src/main.m | 19 - xmake/templates/objc/iosapp/project/xmake.lua | 6 - xmake/templates/objc/iosapp/template.lua | 2 - .../project/src/app/AppDelegate.h | 15 - .../project/src/app/AppDelegate.m | 45 -- .../AppIcon.appiconset/Contents.json | 98 --- .../project/src/app/Assets.xcassets/Contents.json | 6 - .../src/app/Base.lproj/LaunchScreen.storyboard | 25 - .../project/src/app/Base.lproj/Main.storyboard | 24 - .../project/src/app/Info.plist | 66 -- .../project/src/app/SceneDelegate.h | 16 - .../project/src/app/SceneDelegate.m | 50 -- .../project/src/app/ViewController.h | 15 - .../project/src/app/ViewController.m | 23 - .../iosapp_with_framework/project/src/app/main.m | 19 - .../project/src/framework/Info.plist | 24 - .../project/src/framework/test.h | 3 - .../project/src/framework/test.m | 9 - .../objc/iosapp_with_framework/project/xmake.lua | 13 - .../objc/iosapp_with_framework/template.lua | 2 - .../objc/macapp/project/src/AppDelegate.h | 15 - .../objc/macapp/project/src/AppDelegate.m | 27 - .../AppIcon.appiconset/Contents.json | 58 -- .../project/src/Assets.xcassets/Contents.json | 6 - .../macapp/project/src/Base.lproj/Main.storyboard | 717 --------------------- xmake/templates/objc/macapp/project/src/Info.plist | 38 -- .../objc/macapp/project/src/ViewController.h | 15 - .../objc/macapp/project/src/ViewController.m | 27 - xmake/templates/objc/macapp/project/src/main.m | 16 - .../objc/macapp/project/src/test.entitlements | 10 - xmake/templates/objc/macapp/project/xmake.lua | 6 - xmake/templates/objc/macapp/template.lua | 2 - .../project/src/app/AppDelegate.h | 15 - .../project/src/app/AppDelegate.m | 30 - .../AppIcon.appiconset/Contents.json | 58 -- .../project/src/app/Assets.xcassets/Contents.json | 6 - .../project/src/app/Base.lproj/Main.storyboard | 717 --------------------- .../project/src/app/Info.plist | 38 -- .../project/src/app/ViewController.h | 15 - .../project/src/app/ViewController.m | 27 - .../macapp_with_framework/project/src/app/main.m | 16 - .../project/src/app/test.entitlements | 10 - .../project/src/framework/Info.plist | 24 - .../project/src/framework/test.h | 3 - .../project/src/framework/test.m | 9 - .../objc/macapp_with_framework/project/xmake.lua | 13 - .../objc/macapp_with_framework/template.lua | 2 - xmake/templates/objc/xcode.bundle/src/Info.plist | 24 + xmake/templates/objc/xcode.bundle/src/test.h | 3 + xmake/templates/objc/xcode.bundle/src/test.m | 5 + xmake/templates/objc/xcode.bundle/xmake.lua | 9 + .../templates/objc/xcode.framework/src/Info.plist | 24 + xmake/templates/objc/xcode.framework/src/test.h | 3 + xmake/templates/objc/xcode.framework/src/test.m | 5 + xmake/templates/objc/xcode.framework/xmake.lua | 9 + .../templates/objc/xcode.iosapp/src/AppDelegate.h | 15 + .../templates/objc/xcode.iosapp/src/AppDelegate.m | 41 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../xcode.iosapp/src/Assets.xcassets/Contents.json | 6 + .../src/Base.lproj/LaunchScreen.storyboard | 25 + .../xcode.iosapp/src/Base.lproj/Main.storyboard | 24 + xmake/templates/objc/xcode.iosapp/src/Info.plist | 66 ++ .../objc/xcode.iosapp/src/SceneDelegate.h | 16 + .../objc/xcode.iosapp/src/SceneDelegate.m | 50 ++ .../objc/xcode.iosapp/src/ViewController.h | 15 + .../objc/xcode.iosapp/src/ViewController.m | 23 + xmake/templates/objc/xcode.iosapp/src/main.m | 19 + xmake/templates/objc/xcode.iosapp/xmake.lua | 6 + .../src/app/AppDelegate.h | 15 + .../src/app/AppDelegate.m | 45 ++ .../AppIcon.appiconset/Contents.json | 98 +++ .../src/app/Assets.xcassets/Contents.json | 6 + .../src/app/Base.lproj/LaunchScreen.storyboard | 25 + .../src/app/Base.lproj/Main.storyboard | 24 + .../xcode.iosapp_with_framework/src/app/Info.plist | 66 ++ .../src/app/SceneDelegate.h | 16 + .../src/app/SceneDelegate.m | 50 ++ .../src/app/ViewController.h | 15 + .../src/app/ViewController.m | 23 + .../xcode.iosapp_with_framework/src/app/main.m | 19 + .../src/framework/Info.plist | 24 + .../src/framework/test.h | 3 + .../src/framework/test.m | 9 + .../objc/xcode.iosapp_with_framework/xmake.lua | 13 + .../templates/objc/xcode.macapp/src/AppDelegate.h | 15 + .../templates/objc/xcode.macapp/src/AppDelegate.m | 27 + .../AppIcon.appiconset/Contents.json | 58 ++ .../xcode.macapp/src/Assets.xcassets/Contents.json | 6 + .../xcode.macapp/src/Base.lproj/Main.storyboard | 717 +++++++++++++++++++++ xmake/templates/objc/xcode.macapp/src/Info.plist | 38 ++ .../objc/xcode.macapp/src/ViewController.h | 15 + .../objc/xcode.macapp/src/ViewController.m | 27 + xmake/templates/objc/xcode.macapp/src/main.m | 16 + .../objc/xcode.macapp/src/test.entitlements | 10 + xmake/templates/objc/xcode.macapp/xmake.lua | 6 + .../src/app/AppDelegate.h | 15 + .../src/app/AppDelegate.m | 30 + .../AppIcon.appiconset/Contents.json | 58 ++ .../src/app/Assets.xcassets/Contents.json | 6 + .../src/app/Base.lproj/Main.storyboard | 717 +++++++++++++++++++++ .../xcode.macapp_with_framework/src/app/Info.plist | 38 ++ .../src/app/ViewController.h | 15 + .../src/app/ViewController.m | 27 + .../xcode.macapp_with_framework/src/app/main.m | 16 + .../src/app/test.entitlements | 10 + .../src/framework/Info.plist | 24 + .../src/framework/test.h | 3 + .../src/framework/test.m | 9 + .../objc/xcode.macapp_with_framework/xmake.lua | 13 + .../templates/pascal/console/project/src/main.pas | 4 - xmake/templates/pascal/console/project/xmake.lua | 7 - xmake/templates/pascal/console/src/main.pas | 4 + xmake/templates/pascal/console/template.lua | 2 - xmake/templates/pascal/console/xmake.lua | 7 + xmake/templates/pascal/shared/project/src/foo.pas | 19 - xmake/templates/pascal/shared/project/src/main.pas | 13 - xmake/templates/pascal/shared/project/xmake.lua | 12 - xmake/templates/pascal/shared/src/foo.pas | 19 + xmake/templates/pascal/shared/src/main.pas | 13 + xmake/templates/pascal/shared/template.lua | 2 - xmake/templates/pascal/shared/xmake.lua | 12 + xmake/templates/rust/console/project/src/main.rs | 3 - xmake/templates/rust/console/project/xmake.lua | 7 - xmake/templates/rust/console/src/main.rs | 3 + xmake/templates/rust/console/template.lua | 2 - xmake/templates/rust/console/xmake.lua | 7 + xmake/templates/rust/shared/project/src/foo.rs | 4 - xmake/templates/rust/shared/project/src/main.rs | 6 - xmake/templates/rust/shared/project/xmake.lua | 10 - xmake/templates/rust/shared/src/foo.rs | 4 + xmake/templates/rust/shared/src/main.rs | 6 + xmake/templates/rust/shared/template.lua | 2 - xmake/templates/rust/shared/xmake.lua | 10 + xmake/templates/rust/static/project/src/foo.rs | 4 - xmake/templates/rust/static/project/src/main.rs | 6 - xmake/templates/rust/static/project/xmake.lua | 10 - xmake/templates/rust/static/src/foo.rs | 4 + xmake/templates/rust/static/src/main.rs | 6 + xmake/templates/rust/static/template.lua | 2 - xmake/templates/rust/static/xmake.lua | 10 + .../templates/swift/console/project/src/main.swift | 3 - xmake/templates/swift/console/project/xmake.lua | 13 - xmake/templates/swift/console/src/main.swift | 3 + xmake/templates/swift/console/template.lua | 2 - xmake/templates/swift/console/xmake.lua | 13 + xmake/templates/vala/console/project/src/main.vala | 21 - xmake/templates/vala/console/project/xmake.lua | 12 - xmake/templates/vala/console/src/main.vala | 21 + xmake/templates/vala/console/template.lua | 2 - xmake/templates/vala/console/xmake.lua | 12 + xmake/templates/vala/shared/project/src/main.vala | 6 - .../templates/vala/shared/project/src/mymath.vala | 9 - xmake/templates/vala/shared/project/xmake.lua | 18 - xmake/templates/vala/shared/src/main.vala | 6 + xmake/templates/vala/shared/src/mymath.vala | 9 + xmake/templates/vala/shared/template.lua | 2 - xmake/templates/vala/shared/xmake.lua | 18 + xmake/templates/vala/static/project/src/main.vala | 6 - .../templates/vala/static/project/src/mymath.vala | 9 - xmake/templates/vala/static/project/xmake.lua | 18 - xmake/templates/vala/static/src/main.vala | 6 + xmake/templates/vala/static/src/mymath.vala | 9 + xmake/templates/vala/static/template.lua | 2 - xmake/templates/vala/static/xmake.lua | 18 + xmake/templates/zig/console/project/src/main.zig | 5 - xmake/templates/zig/console/project/xmake.lua | 7 - xmake/templates/zig/console/src/main.zig | 5 + xmake/templates/zig/console/template.lua | 2 - xmake/templates/zig/console/xmake.lua | 7 + xmake/templates/zig/shared/project/src/main.zig | 7 - xmake/templates/zig/shared/project/src/test.zig | 3 - xmake/templates/zig/shared/project/xmake.lua | 12 - xmake/templates/zig/shared/src/main.zig | 7 + xmake/templates/zig/shared/src/test.zig | 3 + xmake/templates/zig/shared/template.lua | 2 - xmake/templates/zig/shared/xmake.lua | 12 + xmake/templates/zig/static/project/src/main.zig | 7 - xmake/templates/zig/static/project/src/test.zig | 3 - xmake/templates/zig/static/project/xmake.lua | 12 - xmake/templates/zig/static/src/main.zig | 7 + xmake/templates/zig/static/src/test.zig | 3 + xmake/templates/zig/static/template.lua | 2 - xmake/templates/zig/static/xmake.lua | 12 + 584 files changed, 5416 insertions(+), 5772 deletions(-) create mode 100644 xmake/actions/create/template.lua delete mode 100644 xmake/core/project/template.lua delete mode 100644 xmake/core/sandbox/modules/import/core/project/template.lua delete mode 100644 xmake/templates/c++/console/project/src/main.cpp delete mode 100644 xmake/templates/c++/console/project/xmake.lua create mode 100644 xmake/templates/c++/console/src/main.cpp delete mode 100644 xmake/templates/c++/console/template.lua create mode 100644 xmake/templates/c++/console/xmake.lua create mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/.gitignore create mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp create mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp create mode 100644 xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c++/module.binary/project/modules/binary/bar/.gitignore delete mode 100644 xmake/templates/c++/module.binary/project/modules/binary/bar/src/add.cpp delete mode 100644 xmake/templates/c++/module.binary/project/modules/binary/bar/src/sub.cpp delete mode 100644 xmake/templates/c++/module.binary/project/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c++/module.binary/project/src/main.cpp delete mode 100644 xmake/templates/c++/module.binary/project/xmake.lua create mode 100644 xmake/templates/c++/module.binary/src/main.cpp delete mode 100644 xmake/templates/c++/module.binary/template.lua create mode 100644 xmake/templates/c++/module.binary/xmake.lua create mode 100644 xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp create mode 100644 xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp delete mode 100644 xmake/templates/c++/module.shared/project/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c++/module.shared/project/src/main.cpp delete mode 100644 xmake/templates/c++/module.shared/project/xmake.lua create mode 100644 xmake/templates/c++/module.shared/src/main.cpp delete mode 100644 xmake/templates/c++/module.shared/template.lua create mode 100644 xmake/templates/c++/module.shared/xmake.lua delete mode 100644 xmake/templates/c++/qt.console/project/src/main.cpp delete mode 100644 xmake/templates/c++/qt.console/project/xmake.lua create mode 100644 xmake/templates/c++/qt.console/src/main.cpp delete mode 100644 xmake/templates/c++/qt.console/template.lua create mode 100644 xmake/templates/c++/qt.console/xmake.lua delete mode 100644 xmake/templates/c++/qt.quickapp/project/src/main.cpp delete mode 100644 xmake/templates/c++/qt.quickapp/project/src/main.qml delete mode 100644 xmake/templates/c++/qt.quickapp/project/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp/project/xmake.lua create mode 100644 xmake/templates/c++/qt.quickapp/src/main.cpp create mode 100644 xmake/templates/c++/qt.quickapp/src/main.qml create mode 100644 xmake/templates/c++/qt.quickapp/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp/template.lua create mode 100644 xmake/templates/c++/qt.quickapp/xmake.lua delete mode 100644 xmake/templates/c++/qt.quickapp_static/project/src/main.cpp delete mode 100644 xmake/templates/c++/qt.quickapp_static/project/src/main.qml delete mode 100644 xmake/templates/c++/qt.quickapp_static/project/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp_static/project/xmake.lua create mode 100644 xmake/templates/c++/qt.quickapp_static/src/main.cpp create mode 100644 xmake/templates/c++/qt.quickapp_static/src/main.qml create mode 100644 xmake/templates/c++/qt.quickapp_static/src/qml.qrc delete mode 100644 xmake/templates/c++/qt.quickapp_static/template.lua create mode 100644 xmake/templates/c++/qt.quickapp_static/xmake.lua delete mode 100644 xmake/templates/c++/qt.shared/project/src/demo.cpp delete mode 100644 xmake/templates/c++/qt.shared/project/src/demo.h delete mode 100644 xmake/templates/c++/qt.shared/project/src/demo_global.h delete mode 100644 xmake/templates/c++/qt.shared/project/xmake.lua create mode 100644 xmake/templates/c++/qt.shared/src/demo.cpp create mode 100644 xmake/templates/c++/qt.shared/src/demo.h create mode 100644 xmake/templates/c++/qt.shared/src/demo_global.h delete mode 100644 xmake/templates/c++/qt.shared/template.lua create mode 100644 xmake/templates/c++/qt.shared/xmake.lua delete mode 100644 xmake/templates/c++/qt.static/project/src/demo.cpp delete mode 100644 xmake/templates/c++/qt.static/project/src/demo.h delete mode 100644 xmake/templates/c++/qt.static/project/xmake.lua create mode 100644 xmake/templates/c++/qt.static/src/demo.cpp create mode 100644 xmake/templates/c++/qt.static/src/demo.h delete mode 100644 xmake/templates/c++/qt.static/template.lua create mode 100644 xmake/templates/c++/qt.static/xmake.lua delete mode 100644 xmake/templates/c++/qt.widgetapp/project/src/main.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp/project/src/mainwindow.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp/project/src/mainwindow.h delete mode 100644 xmake/templates/c++/qt.widgetapp/project/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp/project/xmake.lua create mode 100644 xmake/templates/c++/qt.widgetapp/src/main.cpp create mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp create mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.h create mode 100644 xmake/templates/c++/qt.widgetapp/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp/template.lua create mode 100644 xmake/templates/c++/qt.widgetapp/xmake.lua delete mode 100644 xmake/templates/c++/qt.widgetapp_static/project/src/main.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.cpp delete mode 100644 xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.h delete mode 100644 xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp_static/project/xmake.lua create mode 100644 xmake/templates/c++/qt.widgetapp_static/src/main.cpp create mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp create mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h create mode 100644 xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui delete mode 100644 xmake/templates/c++/qt.widgetapp_static/template.lua create mode 100644 xmake/templates/c++/qt.widgetapp_static/xmake.lua delete mode 100644 xmake/templates/c++/shared/project/src/foo.cpp delete mode 100644 xmake/templates/c++/shared/project/src/foo.h delete mode 100644 xmake/templates/c++/shared/project/src/main.cpp delete mode 100644 xmake/templates/c++/shared/project/xmake.lua create mode 100644 xmake/templates/c++/shared/src/foo.cpp create mode 100644 xmake/templates/c++/shared/src/foo.h create mode 100644 xmake/templates/c++/shared/src/main.cpp delete mode 100644 xmake/templates/c++/shared/template.lua create mode 100644 xmake/templates/c++/shared/xmake.lua delete mode 100644 xmake/templates/c++/static/project/src/foo.cpp delete mode 100644 xmake/templates/c++/static/project/src/foo.h delete mode 100644 xmake/templates/c++/static/project/src/main.cpp delete mode 100644 xmake/templates/c++/static/project/xmake.lua create mode 100644 xmake/templates/c++/static/src/foo.cpp create mode 100644 xmake/templates/c++/static/src/foo.h create mode 100644 xmake/templates/c++/static/src/main.cpp delete mode 100644 xmake/templates/c++/static/template.lua create mode 100644 xmake/templates/c++/static/xmake.lua delete mode 100644 xmake/templates/c++/tbox.console/project/src/main.cpp delete mode 100644 xmake/templates/c++/tbox.console/project/src/xmake.lua delete mode 100644 xmake/templates/c++/tbox.console/project/xmake.lua create mode 100644 xmake/templates/c++/tbox.console/src/main.cpp create mode 100644 xmake/templates/c++/tbox.console/src/xmake.lua delete mode 100644 xmake/templates/c++/tbox.console/template.lua create mode 100644 xmake/templates/c++/tbox.console/xmake.lua delete mode 100644 xmake/templates/c++/tbox.shared/project/src/_demo/main.cpp delete mode 100644 xmake/templates/c++/tbox.shared/project/src/_demo/xmake.lua delete mode 100644 xmake/templates/c++/tbox.shared/project/src/_library/interface.cpp delete mode 100644 xmake/templates/c++/tbox.shared/project/src/_library/interface.h delete mode 100644 xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua delete mode 100644 xmake/templates/c++/tbox.shared/project/xmake.lua create mode 100644 xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.cpp create mode 100644 xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.h create mode 100644 xmake/templates/c++/tbox.shared/src/${TARGETNAME}/xmake.lua create mode 100644 xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/main.cpp create mode 100644 xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/xmake.lua delete mode 100644 xmake/templates/c++/tbox.shared/template.lua create mode 100644 xmake/templates/c++/tbox.shared/xmake.lua delete mode 100644 xmake/templates/c++/tbox.static/project/src/_demo/main.cpp delete mode 100644 xmake/templates/c++/tbox.static/project/src/_demo/xmake.lua delete mode 100644 xmake/templates/c++/tbox.static/project/src/_library/interface.cpp delete mode 100644 xmake/templates/c++/tbox.static/project/src/_library/interface.h delete mode 100644 xmake/templates/c++/tbox.static/project/src/_library/xmake.lua delete mode 100644 xmake/templates/c++/tbox.static/project/xmake.lua create mode 100644 xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.cpp create mode 100644 xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.h create mode 100644 xmake/templates/c++/tbox.static/src/${TARGETNAME}/xmake.lua create mode 100644 xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/main.cpp create mode 100644 xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/xmake.lua delete mode 100644 xmake/templates/c++/tbox.static/template.lua create mode 100644 xmake/templates/c++/tbox.static/xmake.lua delete mode 100644 xmake/templates/c++/wxwidgets/project/src/main.cpp delete mode 100644 xmake/templates/c++/wxwidgets/project/xmake.lua create mode 100644 xmake/templates/c++/wxwidgets/src/main.cpp delete mode 100644 xmake/templates/c++/wxwidgets/template.lua create mode 100644 xmake/templates/c++/wxwidgets/xmake.lua delete mode 100644 xmake/templates/c++/xmake.cli/project/src/lni/main.cpp delete mode 100644 xmake/templates/c++/xmake.cli/project/src/lua/main.lua delete mode 100644 xmake/templates/c++/xmake.cli/project/xmake.lua create mode 100644 xmake/templates/c++/xmake.cli/src/lni/main.cpp create mode 100644 xmake/templates/c++/xmake.cli/src/lua/main.lua delete mode 100644 xmake/templates/c++/xmake.cli/template.lua create mode 100644 xmake/templates/c++/xmake.cli/xmake.lua delete mode 100644 xmake/templates/c/console/project/src/main.c delete mode 100644 xmake/templates/c/console/project/xmake.lua create mode 100644 xmake/templates/c/console/src/main.c delete mode 100644 xmake/templates/c/console/template.lua create mode 100644 xmake/templates/c/console/xmake.lua create mode 100644 xmake/templates/c/module.binary/modules/binary/bar/.gitignore create mode 100644 xmake/templates/c/module.binary/modules/binary/bar/src/add.c create mode 100644 xmake/templates/c/module.binary/modules/binary/bar/src/sub.c create mode 100644 xmake/templates/c/module.binary/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore delete mode 100644 xmake/templates/c/module.binary/project/modules/binary/bar/src/add.c delete mode 100644 xmake/templates/c/module.binary/project/modules/binary/bar/src/sub.c delete mode 100644 xmake/templates/c/module.binary/project/modules/binary/bar/xmake.lua delete mode 100644 xmake/templates/c/module.binary/project/src/main.c delete mode 100644 xmake/templates/c/module.binary/project/xmake.lua create mode 100644 xmake/templates/c/module.binary/src/main.c delete mode 100644 xmake/templates/c/module.binary/template.lua create mode 100644 xmake/templates/c/module.binary/xmake.lua create mode 100644 xmake/templates/c/module.shared/modules/shared/foo/src/foo.c create mode 100644 xmake/templates/c/module.shared/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c/module.shared/project/modules/shared/foo/src/foo.c delete mode 100644 xmake/templates/c/module.shared/project/modules/shared/foo/xmake.lua delete mode 100644 xmake/templates/c/module.shared/project/src/main.c delete mode 100644 xmake/templates/c/module.shared/project/xmake.lua create mode 100644 xmake/templates/c/module.shared/src/main.c delete mode 100644 xmake/templates/c/module.shared/template.lua create mode 100644 xmake/templates/c/module.shared/xmake.lua delete mode 100644 xmake/templates/c/shared/project/src/foo.c delete mode 100644 xmake/templates/c/shared/project/src/foo.h delete mode 100644 xmake/templates/c/shared/project/src/main.c delete mode 100644 xmake/templates/c/shared/project/xmake.lua create mode 100644 xmake/templates/c/shared/src/foo.c create mode 100644 xmake/templates/c/shared/src/foo.h create mode 100644 xmake/templates/c/shared/src/main.c delete mode 100644 xmake/templates/c/shared/template.lua create mode 100644 xmake/templates/c/shared/xmake.lua delete mode 100644 xmake/templates/c/static/project/src/foo.c delete mode 100644 xmake/templates/c/static/project/src/foo.h delete mode 100644 xmake/templates/c/static/project/src/main.c delete mode 100644 xmake/templates/c/static/project/xmake.lua create mode 100644 xmake/templates/c/static/src/foo.c create mode 100644 xmake/templates/c/static/src/foo.h create mode 100644 xmake/templates/c/static/src/main.c delete mode 100644 xmake/templates/c/static/template.lua create mode 100644 xmake/templates/c/static/xmake.lua delete mode 100644 xmake/templates/c/tbox.console/project/src/main.c delete mode 100644 xmake/templates/c/tbox.console/project/src/xmake.lua delete mode 100644 xmake/templates/c/tbox.console/project/xmake.lua create mode 100644 xmake/templates/c/tbox.console/src/main.c create mode 100644 xmake/templates/c/tbox.console/src/xmake.lua delete mode 100644 xmake/templates/c/tbox.console/template.lua create mode 100644 xmake/templates/c/tbox.console/xmake.lua delete mode 100644 xmake/templates/c/tbox.shared/project/src/_demo/main.c delete mode 100644 xmake/templates/c/tbox.shared/project/src/_demo/xmake.lua delete mode 100644 xmake/templates/c/tbox.shared/project/src/_library/interface.c delete mode 100644 xmake/templates/c/tbox.shared/project/src/_library/interface.h delete mode 100644 xmake/templates/c/tbox.shared/project/src/_library/xmake.lua delete mode 100644 xmake/templates/c/tbox.shared/project/xmake.lua create mode 100644 xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.c create mode 100644 xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.h create mode 100644 xmake/templates/c/tbox.shared/src/${TARGETNAME}/xmake.lua create mode 100644 xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/main.c create mode 100644 xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/xmake.lua delete mode 100644 xmake/templates/c/tbox.shared/template.lua create mode 100644 xmake/templates/c/tbox.shared/xmake.lua delete mode 100644 xmake/templates/c/tbox.static/project/src/_demo/main.c delete mode 100644 xmake/templates/c/tbox.static/project/src/_demo/xmake.lua delete mode 100644 xmake/templates/c/tbox.static/project/src/_library/interface.c delete mode 100644 xmake/templates/c/tbox.static/project/src/_library/interface.h delete mode 100644 xmake/templates/c/tbox.static/project/src/_library/xmake.lua delete mode 100644 xmake/templates/c/tbox.static/project/xmake.lua create mode 100644 xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.c create mode 100644 xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.h create mode 100644 xmake/templates/c/tbox.static/src/${TARGETNAME}/xmake.lua create mode 100644 xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/main.c create mode 100644 xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/xmake.lua delete mode 100644 xmake/templates/c/tbox.static/template.lua create mode 100644 xmake/templates/c/tbox.static/xmake.lua delete mode 100644 xmake/templates/c/xmake.cli/project/src/lni/main.c delete mode 100644 xmake/templates/c/xmake.cli/project/src/lua/main.lua delete mode 100644 xmake/templates/c/xmake.cli/project/xmake.lua create mode 100644 xmake/templates/c/xmake.cli/src/lni/main.c create mode 100644 xmake/templates/c/xmake.cli/src/lua/main.lua delete mode 100644 xmake/templates/c/xmake.cli/template.lua create mode 100644 xmake/templates/c/xmake.cli/xmake.lua delete mode 100644 xmake/templates/cuda/console/project/src/main.cu delete mode 100644 xmake/templates/cuda/console/project/xmake.lua create mode 100644 xmake/templates/cuda/console/src/main.cu delete mode 100644 xmake/templates/cuda/console/template.lua create mode 100644 xmake/templates/cuda/console/xmake.lua create mode 100644 xmake/templates/cuda/shared/inc/lib.cuh delete mode 100644 xmake/templates/cuda/shared/project/inc/lib.cuh delete mode 100644 xmake/templates/cuda/shared/project/src/lib.cu delete mode 100644 xmake/templates/cuda/shared/project/xmake.lua create mode 100644 xmake/templates/cuda/shared/src/lib.cu delete mode 100644 xmake/templates/cuda/shared/template.lua create mode 100644 xmake/templates/cuda/shared/xmake.lua create mode 100644 xmake/templates/cuda/static/inc/lib.cuh delete mode 100644 xmake/templates/cuda/static/project/inc/lib.cuh delete mode 100644 xmake/templates/cuda/static/project/src/lib.cu delete mode 100644 xmake/templates/cuda/static/project/xmake.lua create mode 100644 xmake/templates/cuda/static/src/lib.cu delete mode 100644 xmake/templates/cuda/static/template.lua create mode 100644 xmake/templates/cuda/static/xmake.lua delete mode 100644 xmake/templates/dlang/console/project/src/main.d delete mode 100644 xmake/templates/dlang/console/project/xmake.lua create mode 100644 xmake/templates/dlang/console/src/main.d delete mode 100644 xmake/templates/dlang/console/template.lua create mode 100644 xmake/templates/dlang/console/xmake.lua delete mode 100644 xmake/templates/dlang/shared/project/src/interfaces.d delete mode 100644 xmake/templates/dlang/shared/project/src/main.d delete mode 100644 xmake/templates/dlang/shared/project/xmake.lua create mode 100644 xmake/templates/dlang/shared/src/interfaces.d create mode 100644 xmake/templates/dlang/shared/src/main.d delete mode 100644 xmake/templates/dlang/shared/template.lua create mode 100644 xmake/templates/dlang/shared/xmake.lua delete mode 100644 xmake/templates/dlang/static/project/src/interfaces.d delete mode 100644 xmake/templates/dlang/static/project/src/main.d delete mode 100644 xmake/templates/dlang/static/project/xmake.lua create mode 100644 xmake/templates/dlang/static/src/interfaces.d create mode 100644 xmake/templates/dlang/static/src/main.d delete mode 100644 xmake/templates/dlang/static/template.lua create mode 100644 xmake/templates/dlang/static/xmake.lua delete mode 100644 xmake/templates/fortran/console/project/src/main.f90 delete mode 100644 xmake/templates/fortran/console/project/xmake.lua create mode 100644 xmake/templates/fortran/console/src/main.f90 delete mode 100644 xmake/templates/fortran/console/template.lua create mode 100644 xmake/templates/fortran/console/xmake.lua delete mode 100644 xmake/templates/fortran/shared/project/src/main.f90 delete mode 100644 xmake/templates/fortran/shared/project/src/test.f90 delete mode 100644 xmake/templates/fortran/shared/project/xmake.lua create mode 100644 xmake/templates/fortran/shared/src/main.f90 create mode 100644 xmake/templates/fortran/shared/src/test.f90 delete mode 100644 xmake/templates/fortran/shared/template.lua create mode 100644 xmake/templates/fortran/shared/xmake.lua delete mode 100644 xmake/templates/fortran/static/project/src/main.f90 delete mode 100644 xmake/templates/fortran/static/project/src/test.f90 delete mode 100644 xmake/templates/fortran/static/project/xmake.lua create mode 100644 xmake/templates/fortran/static/src/main.f90 create mode 100644 xmake/templates/fortran/static/src/test.f90 delete mode 100644 xmake/templates/fortran/static/template.lua create mode 100644 xmake/templates/fortran/static/xmake.lua delete mode 100644 xmake/templates/go/console/project/src/main.go delete mode 100644 xmake/templates/go/console/project/xmake.lua create mode 100644 xmake/templates/go/console/src/main.go delete mode 100644 xmake/templates/go/console/template.lua create mode 100644 xmake/templates/go/console/xmake.lua delete mode 100644 xmake/templates/go/static/project/src/main.go delete mode 100644 xmake/templates/go/static/project/src/module/add.go delete mode 100644 xmake/templates/go/static/project/src/module/sub.go delete mode 100644 xmake/templates/go/static/project/src/test.go delete mode 100644 xmake/templates/go/static/project/xmake.lua create mode 100644 xmake/templates/go/static/src/main.go create mode 100644 xmake/templates/go/static/src/module/add.go create mode 100644 xmake/templates/go/static/src/module/sub.go create mode 100644 xmake/templates/go/static/src/test.go delete mode 100644 xmake/templates/go/static/template.lua create mode 100644 xmake/templates/go/static/xmake.lua delete mode 100644 xmake/templates/kotlin/console/project/src/main.kt delete mode 100644 xmake/templates/kotlin/console/project/xmake.lua create mode 100644 xmake/templates/kotlin/console/src/main.kt delete mode 100644 xmake/templates/kotlin/console/template.lua create mode 100644 xmake/templates/kotlin/console/xmake.lua create mode 100644 xmake/templates/kotlin/shared/src/foo.kt create mode 100644 xmake/templates/kotlin/shared/src/main.c create mode 100644 xmake/templates/kotlin/shared/xmake.lua delete mode 100644 xmake/templates/kotlin/shared_library/project/src/foo.kt delete mode 100644 xmake/templates/kotlin/shared_library/project/src/main.c delete mode 100644 xmake/templates/kotlin/shared_library/project/xmake.lua delete mode 100644 xmake/templates/kotlin/shared_library/template.lua create mode 100644 xmake/templates/kotlin/static/src/foo.kt create mode 100644 xmake/templates/kotlin/static/src/main.c create mode 100644 xmake/templates/kotlin/static/xmake.lua delete mode 100644 xmake/templates/kotlin/static_library/project/src/foo.kt delete mode 100644 xmake/templates/kotlin/static_library/project/src/main.c delete mode 100644 xmake/templates/kotlin/static_library/project/xmake.lua delete mode 100644 xmake/templates/kotlin/static_library/template.lua delete mode 100644 xmake/templates/nim/console/project/src/main.nim delete mode 100644 xmake/templates/nim/console/project/xmake.lua create mode 100644 xmake/templates/nim/console/src/main.nim delete mode 100644 xmake/templates/nim/console/template.lua create mode 100644 xmake/templates/nim/console/xmake.lua delete mode 100644 xmake/templates/nim/shared/project/src/foo.nim delete mode 100644 xmake/templates/nim/shared/project/src/main.nim delete mode 100644 xmake/templates/nim/shared/project/xmake.lua create mode 100644 xmake/templates/nim/shared/src/foo.nim create mode 100644 xmake/templates/nim/shared/src/main.nim delete mode 100644 xmake/templates/nim/shared/template.lua create mode 100644 xmake/templates/nim/shared/xmake.lua delete mode 100644 xmake/templates/nim/static/project/src/foo.nim delete mode 100644 xmake/templates/nim/static/project/src/main.nim delete mode 100644 xmake/templates/nim/static/project/xmake.lua create mode 100644 xmake/templates/nim/static/src/foo.nim create mode 100644 xmake/templates/nim/static/src/main.nim delete mode 100644 xmake/templates/nim/static/template.lua create mode 100644 xmake/templates/nim/static/xmake.lua delete mode 100644 xmake/templates/objc++/bundle/project/src/Info.plist delete mode 100644 xmake/templates/objc++/bundle/project/src/test.h delete mode 100644 xmake/templates/objc++/bundle/project/src/test.mm delete mode 100644 xmake/templates/objc++/bundle/project/xmake.lua delete mode 100644 xmake/templates/objc++/bundle/template.lua delete mode 100644 xmake/templates/objc++/console/project/src/main.mm delete mode 100644 xmake/templates/objc++/console/project/xmake.lua create mode 100644 xmake/templates/objc++/console/src/main.mm delete mode 100644 xmake/templates/objc++/console/template.lua create mode 100644 xmake/templates/objc++/console/xmake.lua delete mode 100644 xmake/templates/objc++/framework/project/src/Info.plist delete mode 100644 xmake/templates/objc++/framework/project/src/test.h delete mode 100644 xmake/templates/objc++/framework/project/src/test.mm delete mode 100644 xmake/templates/objc++/framework/project/xmake.lua delete mode 100644 xmake/templates/objc++/framework/template.lua create mode 100644 xmake/templates/objc++/xcode.bundle/src/Info.plist create mode 100644 xmake/templates/objc++/xcode.bundle/src/test.h create mode 100644 xmake/templates/objc++/xcode.bundle/src/test.mm create mode 100644 xmake/templates/objc++/xcode.bundle/xmake.lua create mode 100644 xmake/templates/objc++/xcode.framework/src/Info.plist create mode 100644 xmake/templates/objc++/xcode.framework/src/test.h create mode 100644 xmake/templates/objc++/xcode.framework/src/test.mm create mode 100644 xmake/templates/objc++/xcode.framework/xmake.lua delete mode 100644 xmake/templates/objc/bundle/project/src/Info.plist delete mode 100644 xmake/templates/objc/bundle/project/src/test.h delete mode 100644 xmake/templates/objc/bundle/project/src/test.m delete mode 100644 xmake/templates/objc/bundle/project/xmake.lua delete mode 100644 xmake/templates/objc/bundle/template.lua delete mode 100644 xmake/templates/objc/console/project/src/main.m delete mode 100644 xmake/templates/objc/console/project/xmake.lua create mode 100644 xmake/templates/objc/console/src/main.m delete mode 100644 xmake/templates/objc/console/template.lua create mode 100644 xmake/templates/objc/console/xmake.lua delete mode 100644 xmake/templates/objc/framework/project/src/Info.plist delete mode 100644 xmake/templates/objc/framework/project/src/test.h delete mode 100644 xmake/templates/objc/framework/project/src/test.m delete mode 100644 xmake/templates/objc/framework/project/xmake.lua delete mode 100644 xmake/templates/objc/framework/template.lua delete mode 100644 xmake/templates/objc/iosapp/project/src/AppDelegate.h delete mode 100644 xmake/templates/objc/iosapp/project/src/AppDelegate.m delete mode 100644 xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard delete mode 100644 xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/iosapp/project/src/Info.plist delete mode 100644 xmake/templates/objc/iosapp/project/src/SceneDelegate.h delete mode 100644 xmake/templates/objc/iosapp/project/src/SceneDelegate.m delete mode 100644 xmake/templates/objc/iosapp/project/src/ViewController.h delete mode 100644 xmake/templates/objc/iosapp/project/src/ViewController.m delete mode 100644 xmake/templates/objc/iosapp/project/src/main.m delete mode 100644 xmake/templates/objc/iosapp/project/xmake.lua delete mode 100644 xmake/templates/objc/iosapp/template.lua delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/AppDelegate.h delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/AppDelegate.m delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/LaunchScreen.storyboard delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/Info.plist delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/SceneDelegate.h delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/SceneDelegate.m delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/ViewController.h delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/ViewController.m delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/app/main.m delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/framework/Info.plist delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/framework/test.h delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/src/framework/test.m delete mode 100644 xmake/templates/objc/iosapp_with_framework/project/xmake.lua delete mode 100644 xmake/templates/objc/iosapp_with_framework/template.lua delete mode 100644 xmake/templates/objc/macapp/project/src/AppDelegate.h delete mode 100644 xmake/templates/objc/macapp/project/src/AppDelegate.m delete mode 100644 xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/macapp/project/src/Info.plist delete mode 100644 xmake/templates/objc/macapp/project/src/ViewController.h delete mode 100644 xmake/templates/objc/macapp/project/src/ViewController.m delete mode 100644 xmake/templates/objc/macapp/project/src/main.m delete mode 100644 xmake/templates/objc/macapp/project/src/test.entitlements delete mode 100644 xmake/templates/objc/macapp/project/xmake.lua delete mode 100644 xmake/templates/objc/macapp/template.lua delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/AppDelegate.h delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/AppDelegate.m delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/Assets.xcassets/Contents.json delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/Base.lproj/Main.storyboard delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/Info.plist delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/ViewController.h delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/ViewController.m delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/main.m delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/app/test.entitlements delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/framework/Info.plist delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/framework/test.h delete mode 100644 xmake/templates/objc/macapp_with_framework/project/src/framework/test.m delete mode 100644 xmake/templates/objc/macapp_with_framework/project/xmake.lua delete mode 100644 xmake/templates/objc/macapp_with_framework/template.lua create mode 100644 xmake/templates/objc/xcode.bundle/src/Info.plist create mode 100644 xmake/templates/objc/xcode.bundle/src/test.h create mode 100644 xmake/templates/objc/xcode.bundle/src/test.m create mode 100644 xmake/templates/objc/xcode.bundle/xmake.lua create mode 100644 xmake/templates/objc/xcode.framework/src/Info.plist create mode 100644 xmake/templates/objc/xcode.framework/src/test.h create mode 100644 xmake/templates/objc/xcode.framework/src/test.m create mode 100644 xmake/templates/objc/xcode.framework/xmake.lua create mode 100644 xmake/templates/objc/xcode.iosapp/src/AppDelegate.h create mode 100644 xmake/templates/objc/xcode.iosapp/src/AppDelegate.m create mode 100644 xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode.iosapp/src/Info.plist create mode 100644 xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h create mode 100644 xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m create mode 100644 xmake/templates/objc/xcode.iosapp/src/ViewController.h create mode 100644 xmake/templates/objc/xcode.iosapp/src/ViewController.m create mode 100644 xmake/templates/objc/xcode.iosapp/src/main.m create mode 100644 xmake/templates/objc/xcode.iosapp/xmake.lua create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m create mode 100644 xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua create mode 100644 xmake/templates/objc/xcode.macapp/src/AppDelegate.h create mode 100644 xmake/templates/objc/xcode.macapp/src/AppDelegate.m create mode 100644 xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode.macapp/src/Info.plist create mode 100644 xmake/templates/objc/xcode.macapp/src/ViewController.h create mode 100644 xmake/templates/objc/xcode.macapp/src/ViewController.m create mode 100644 xmake/templates/objc/xcode.macapp/src/main.m create mode 100644 xmake/templates/objc/xcode.macapp/src/test.entitlements create mode 100644 xmake/templates/objc/xcode.macapp/xmake.lua create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m create mode 100644 xmake/templates/objc/xcode.macapp_with_framework/xmake.lua delete mode 100644 xmake/templates/pascal/console/project/src/main.pas delete mode 100644 xmake/templates/pascal/console/project/xmake.lua create mode 100644 xmake/templates/pascal/console/src/main.pas delete mode 100644 xmake/templates/pascal/console/template.lua create mode 100644 xmake/templates/pascal/console/xmake.lua delete mode 100644 xmake/templates/pascal/shared/project/src/foo.pas delete mode 100644 xmake/templates/pascal/shared/project/src/main.pas delete mode 100644 xmake/templates/pascal/shared/project/xmake.lua create mode 100644 xmake/templates/pascal/shared/src/foo.pas create mode 100644 xmake/templates/pascal/shared/src/main.pas delete mode 100644 xmake/templates/pascal/shared/template.lua create mode 100644 xmake/templates/pascal/shared/xmake.lua delete mode 100644 xmake/templates/rust/console/project/src/main.rs delete mode 100644 xmake/templates/rust/console/project/xmake.lua create mode 100644 xmake/templates/rust/console/src/main.rs delete mode 100644 xmake/templates/rust/console/template.lua create mode 100644 xmake/templates/rust/console/xmake.lua delete mode 100644 xmake/templates/rust/shared/project/src/foo.rs delete mode 100644 xmake/templates/rust/shared/project/src/main.rs delete mode 100644 xmake/templates/rust/shared/project/xmake.lua create mode 100644 xmake/templates/rust/shared/src/foo.rs create mode 100644 xmake/templates/rust/shared/src/main.rs delete mode 100644 xmake/templates/rust/shared/template.lua create mode 100644 xmake/templates/rust/shared/xmake.lua delete mode 100644 xmake/templates/rust/static/project/src/foo.rs delete mode 100644 xmake/templates/rust/static/project/src/main.rs delete mode 100644 xmake/templates/rust/static/project/xmake.lua create mode 100644 xmake/templates/rust/static/src/foo.rs create mode 100644 xmake/templates/rust/static/src/main.rs delete mode 100644 xmake/templates/rust/static/template.lua create mode 100644 xmake/templates/rust/static/xmake.lua delete mode 100644 xmake/templates/swift/console/project/src/main.swift delete mode 100644 xmake/templates/swift/console/project/xmake.lua create mode 100644 xmake/templates/swift/console/src/main.swift delete mode 100644 xmake/templates/swift/console/template.lua create mode 100644 xmake/templates/swift/console/xmake.lua delete mode 100644 xmake/templates/vala/console/project/src/main.vala delete mode 100644 xmake/templates/vala/console/project/xmake.lua create mode 100644 xmake/templates/vala/console/src/main.vala delete mode 100644 xmake/templates/vala/console/template.lua create mode 100644 xmake/templates/vala/console/xmake.lua delete mode 100644 xmake/templates/vala/shared/project/src/main.vala delete mode 100644 xmake/templates/vala/shared/project/src/mymath.vala delete mode 100644 xmake/templates/vala/shared/project/xmake.lua create mode 100644 xmake/templates/vala/shared/src/main.vala create mode 100644 xmake/templates/vala/shared/src/mymath.vala delete mode 100644 xmake/templates/vala/shared/template.lua create mode 100644 xmake/templates/vala/shared/xmake.lua delete mode 100644 xmake/templates/vala/static/project/src/main.vala delete mode 100644 xmake/templates/vala/static/project/src/mymath.vala delete mode 100644 xmake/templates/vala/static/project/xmake.lua create mode 100644 xmake/templates/vala/static/src/main.vala create mode 100644 xmake/templates/vala/static/src/mymath.vala delete mode 100644 xmake/templates/vala/static/template.lua create mode 100644 xmake/templates/vala/static/xmake.lua delete mode 100644 xmake/templates/zig/console/project/src/main.zig delete mode 100644 xmake/templates/zig/console/project/xmake.lua create mode 100644 xmake/templates/zig/console/src/main.zig delete mode 100644 xmake/templates/zig/console/template.lua create mode 100644 xmake/templates/zig/console/xmake.lua delete mode 100644 xmake/templates/zig/shared/project/src/main.zig delete mode 100644 xmake/templates/zig/shared/project/src/test.zig delete mode 100644 xmake/templates/zig/shared/project/xmake.lua create mode 100644 xmake/templates/zig/shared/src/main.zig create mode 100644 xmake/templates/zig/shared/src/test.zig delete mode 100644 xmake/templates/zig/shared/template.lua create mode 100644 xmake/templates/zig/shared/xmake.lua delete mode 100644 xmake/templates/zig/static/project/src/main.zig delete mode 100644 xmake/templates/zig/static/project/src/test.zig delete mode 100644 xmake/templates/zig/static/project/xmake.lua create mode 100644 xmake/templates/zig/static/src/main.zig create mode 100644 xmake/templates/zig/static/src/test.zig delete mode 100644 xmake/templates/zig/static/template.lua create mode 100644 xmake/templates/zig/static/xmake.lua diff --git a/xmake/actions/create/main.lua b/xmake/actions/create/main.lua index 2d96741bc..b4f199b69 100644 --- a/xmake/actions/create/main.lua +++ b/xmake/actions/create/main.lua @@ -21,13 +21,7 @@ -- imports import("core.base.option") import("core.project.project") -import("core.project.template") - --- get the builtin variables -function _get_builtinvars(tempinst, targetname) - return {TARGETNAME = targetname, - FAQ = function() return io.readfile(path.join(os.programdir(), "scripts", "faq.lua")) end} -end +import("actions.create.template", {rootdir = os.programdir()}) -- create project from template function _create_project(language, templateid, targetname) @@ -41,36 +35,6 @@ function _create_project(language, templateid, targetname) -- check the template id assert(templateid, "no template id!") - -- load all templates for the given language - local templates = template.templates(language) - - -- TODO: deprecated - -- in order to be compatible with the old version template - local templates_new = { quickapp_qt = "qt.quickapp", - widgetapp_qt = "qt.widgetapp", - console_qt = "qt.console", - static_qt = "qt.static", - shared_qt = "qt.shared", - console_tbox = "tbox.console", - static_tbox = "tbox.static", - shared_tbox = "tbox.shared"} - if templates_new[templateid] then - cprint("${yellow}deprecated: please uses template(%s) instead of template(%s)!", templates_new[templateid], templateid) - templateid = templates_new[templateid] - end - - -- get the given template instance - local tempinst = nil - if templates then - for _, t in ipairs(templates) do - if t:name() == templateid then - tempinst = t - break - end - end - end - assert(tempinst and tempinst:scriptdir(), "invalid template id: %s!", templateid) - -- get project directory local projectdir = path.absolute(option.get("project") or path.join(os.curdir(), targetname)) if not os.isdir(projectdir) then @@ -94,48 +58,24 @@ function _create_project(language, templateid, targetname) os.cd(projectdir) -- create project - local filedirs = {} - local sourcedir = path.join(tempinst:scriptdir(), "project") - if os.isdir(sourcedir) then - for _, filedir in ipairs(os.filedirs(path.join(sourcedir, "*"))) do - -- https://github.com/xmake-io/xmake/issues/5138#issuecomment-2329238617 - os.cp(filedir, projectdir, {writeable = true}) - table.insert(filedirs, path.relative(filedir, sourcedir)) - end - os.cp(path.join(os.programdir(), "scripts", "gitignore"), path.join(projectdir, ".gitignore")) - table.insert(filedirs, ".gitignore") - else - raise("template(%s): project not found!", templateid) - end + local sourcedir = template.templatedir(language, templateid) + assert(os.isdir(sourcedir), "invalid template id: %s!", templateid) -- get the builtin variables - local builtinvars = _get_builtinvars(tempinst, targetname) - - -- replace all variables - for _, configfile in ipairs(tempinst:get("configfiles")) do - local pattern = "%${(.-)}" - io.gsub(configfile, "(" .. pattern .. ")", function(_, variable) - variable = variable:trim() - local value = builtinvars[variable] - return type(value) == "function" and value() or value - end) - end + local builtinvars = template.builtinvars(targetname) + + local createdfiles = template.copy_files(sourcedir, projectdir, builtinvars) - -- do after_create - local after_create = tempinst:get("create_after") - if after_create then - after_create(tempinst, {targetname = targetname}) + if not os.isfile(path.join(projectdir, ".gitignore")) then + os.cp(path.join(os.programdir(), "scripts", "gitignore"), path.join(projectdir, ".gitignore")) + table.insert(createdfiles, path.join(projectdir, ".gitignore")) end - -- trace - for _, filedir in ipairs(filedirs) do - if os.isdir(filedir) then - for _, file in ipairs(os.files(path.join(filedir, "**"))) do - cprint(" ${green}[+]: ${clear}%s", file) - end - else - cprint(" ${green}[+]: ${clear}%s", filedir) - end + template.replace_variables_in_files(createdfiles, builtinvars) + + table.sort(createdfiles) + for _, file in ipairs(createdfiles) do + cprint(" ${green}[+]: ${clear}%s", path.relative(file, projectdir)) end end diff --git a/xmake/actions/create/template.lua b/xmake/actions/create/template.lua new file mode 100644 index 000000000..dec10658f --- /dev/null +++ b/xmake/actions/create/template.lua @@ -0,0 +1,134 @@ +--!A cross-platform build utility based on Lua +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- +-- Copyright (C) 2015-present, Xmake Open Source Community. +-- +-- @author ruki +-- @file template.lua +-- + +function builtinvars(targetname) + return {TARGETNAME = targetname, + FAQ = function() return io.readfile(path.join(os.programdir(), "scripts", "faq.lua")) end} +end + +function replace_variables_in_string(s, vars) + local pattern = "%${(.-)}" + return (s:gsub(pattern, function (variable) + variable = variable:trim() + local value = vars[variable] + if value == nil then + return "${" .. variable .. "}" + end + return type(value) == "function" and value() or tostring(value) + end)) +end + +function is_binary_file(filepath) + local file = io.open(filepath, "rb") + if not file then + return false + end + local data = file:read(4096) or "" + file:close() + return data:find("\0", 1, true) ~= nil +end + +function templatedir(lang, templateid) + assert(lang) + assert(templateid) + return path.join(os.programdir(), "templates", lang, templateid) +end + +function copy_files(sourcedir, projectdir, vars) + local createdfiles = {} + for _, srcfile in ipairs(os.files(path.join(sourcedir, "**"))) do + local relpath = path.relative(srcfile, sourcedir) + if relpath ~= "template.lua" then + local dstrelpath = replace_variables_in_string(relpath, vars) + local dstfile = path.absolute(path.join(projectdir, dstrelpath)) + os.mkdir(path.directory(dstfile)) + os.cp(srcfile, dstfile, {writeable = true}) + table.insert(createdfiles, dstfile) + end + end + return createdfiles +end + +function replace_variables_in_files(files, vars) + local pattern = "%${(.-)}" + for _, file in ipairs(files) do + if os.isfile(file) and not is_binary_file(file) then + io.gsub(file, "(" .. pattern .. ")", function(_, variable) + variable = variable:trim() + local value = vars[variable] + if value == nil then + return "${" .. variable .. "}" + end + return type(value) == "function" and value() or tostring(value) + end, {encoding = "binary"}) + end + end +end + +function languages() + local languages = {} + local languages_dirs = os.dirs(path.join(os.programdir(), "templates", "*")) + if languages_dirs then + for _, d in ipairs(languages_dirs) do + table.insert(languages, path.basename(d)) + end + end + table.sort(languages) + return languages +end + +function templates(lang) + assert(lang) + local results = {} + local templateroot = path.join(os.programdir(), "templates", lang) + local templatedirs = os.dirs(path.join(templateroot, "*")) + if templatedirs then + for _, templatedir in ipairs(templatedirs) do + if os.isfile(path.join(templatedir, "xmake.lua")) then + table.insert(results, path.filename(templatedir)) + end + end + end + table.sort(results) + return results +end + +function languages_for_template(templateid) + local accepted = {} + for _, l in ipairs(languages()) do + if os.isdir(path.join(os.programdir(), "templates", l, templateid)) then + table.insert(accepted, l) + end + end + return accepted +end + +function templates_with_languages() + local templates_map = {} + for _, lang in ipairs(languages()) do + for _, name in ipairs(templates(lang)) do + templates_map[name] = templates_map[name] or {} + if not table.contains(templates_map[name], lang) then + table.insert(templates_map[name], lang) + end + end + end + return templates_map +end diff --git a/xmake/actions/create/xmake.lua b/xmake/actions/create/xmake.lua index 30cfa2684..3d14a856a 100644 --- a/xmake/actions/create/xmake.lua +++ b/xmake/actions/create/xmake.lua @@ -18,105 +18,54 @@ -- @file xmake.lua -- --- define task task("create") - - -- set category set_category("action") - - -- on run on_run("main") - - -- set menu set_menu { - -- usage - usage = "xmake create [options] [target]" - - -- description - , description = "Create a new project." - - -- options - , options = - { - {'f', "force", "k", nil, "Force to create project in a non-empty directory."} - , {'l', "language", "kv", "c++", "The project language" - - -- show the description of all languages - , values = function (complete, opt) - - -- import template - import("core.project.template") - - -- get languages - local languages = template.languages() - - if not complete or not opt.template then return languages end - - local accepted_lang = {} - for _, l in ipairs(languages) do - for _, t in ipairs(template.templates(l)) do - if t:name() == opt.template then - table.insert(accepted_lang, l) - break - end - end - end - - return accepted_lang - end } - , {'t', "template", "kv", "console", "Select the project template id or name of the given language.", - - -- show the description of all templates - function () - - -- import template - import("core.project.template") - - -- get templates - local templates = {} - for _, l in ipairs(template.languages()) do - for _, t in ipairs(template.templates(l)) do - templates[t:name()] = templates[t:name()] or {} - table.insert(templates[t:name()], l) - end - end - - -- get sorted templates - local templates_sorted = {} - for name, languages in pairs(templates) do - table.insert(templates_sorted, {name = name, languages = languages}) - end - table.sort(templates_sorted, function(a, b) return a.name < b.name end) - - -- make description - local description = {} - for _, t in ipairs(templates_sorted) do - table.insert(description, " - " .. t.name .. ": " .. table.concat(t.languages, ", ")) - end - return description + usage = "xmake create [options] [target]", + description = "Create a new project.", + options = { + {'f', "force", "k", nil, "Force to create project in a non-empty directory."}, + {'l', "language", "kv", "c++", "The project language", + values = function (complete, opt) + import("actions.create.template", {rootdir = os.programdir()}) + + local languages = template.languages() + if not complete or not opt.template then + return languages + end + return template.languages_for_template(opt.template) + end }, + {'t', "template", "kv", "console", "Select the project template id or name of the given language.", + function () + import("actions.create.template", {rootdir = os.programdir()}) + + local templates = template.templates_with_languages() + local templates_sorted = {} + for name, languages in pairs(templates) do + table.insert(templates_sorted, {name = name, languages = languages}) + end + table.sort(templates_sorted, function(a, b) return a.name < b.name end) + + local description = {} + for _, t in ipairs(templates_sorted) do + table.insert(description, " - " .. t.name .. ": " .. table.concat(t.languages, ", ")) + end + return description + end, + values = function (complete, opt) + if complete then + import("actions.create.template", {rootdir = os.programdir()}) + local templates = {} + local languages = opt.language and {opt.language} or template.languages() + for _, l in ipairs(languages) do + table.join2(templates, template.templates(l)) end - , values = function (complete, opt) - if not complete then return end - - -- import template - import("core.project.template") - - -- get templates - local templates = {} - for _, l in ipairs(opt.language and {opt.language} or template.languages()) do - for _, t in ipairs(template.templates(l)) do - table.insert(templates, t:name()) - end - end - - return templates - end } - - , {} - , {nil, "target", "v", nil, "Create the given target." - , "Uses the project name as target if not exists." } - } - } - - - + return templates + end + end}, + {}, + {nil, "target", "v", nil, "Create the given target." + , "Uses the project name as target if not exists."} + } + } diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua deleted file mode 100644 index aa246c4c6..000000000 --- a/xmake/core/project/template.lua +++ /dev/null @@ -1,168 +0,0 @@ ---!A cross-platform build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file template.lua --- - --- define module: template -local template = template or {} -local _instance = _instance or {} - --- load modules -local os = require("base/os") -local io = require("base/io") -local path = require("base/path") -local table = require("base/table") -local utils = require("base/utils") -local string = require("base/string") -local interpreter = require("base/interpreter") - --- new an instance -function _instance.new(name, info, scriptdir) - local instance = table.inherit(_instance) - instance._NAME = name - instance._INFO = info - instance._SCRIPTDIR = scriptdir - return instance -end - --- get the package name -function _instance:name() - return self._NAME -end - --- get the package configure -function _instance:get(name) - - -- get it from info first - local value = self._INFO:get(name) - if value ~= nil then - return value - end -end - --- get the script directory -function _instance:scriptdir() - return self._SCRIPTDIR -end - --- the interpreter -function template._interpreter() - - -- the interpreter has been initialized? return it directly - if template._INTERPRETER then - return template._INTERPRETER - end - - -- init interpreter - local interp = interpreter.new() - assert(interp) - - -- define apis - interp:api_define - { - values = - { - -- add_xxx - "template.add_configfiles" - } - , script = - { - -- after_xxx - "template.after_create" - } - } - - -- save interpreter - template._INTERPRETER = interp - - -- ok? - return interp -end - --- get the language list -function template.languages() - - -- make list - local list = {} - - -- get the language list - local languages = os.dirs(path.join(os.programdir(), "templates", "*")) - if languages then - for _, v in ipairs(languages) do - table.insert(list, path.basename(v)) - end - end - - -- ok? - return list -end - --- load all templates from the given language -function template.templates(language) - - -- check - assert(language) - - -- get interpreter - local interp = template._interpreter() - assert(interp) - - -- load all templates - local templates = {} - local templatefiles = os.files(path.join(os.programdir(), "templates", language, "*", "template.lua")) - if templatefiles then - - -- load template - for _, templatefile in ipairs(templatefiles) do - - -- load script - local ok, errors = interp:load(templatefile) - if not ok then - os.raise(errors) - end - - -- load template - local results, errors = interp:make("template", true, true) - if not results then - os.raise(errors) - end - - -- get the template name and info - local templatename = nil - local templateinfo = nil - for name, info in pairs(results) do - templatename = name - templateinfo = info - break - end - if not templateinfo then - return nil, string.format("%s: package not found!", templatefile) - end - - -- new an instance - local instance = _instance.new(templatename, templateinfo, path.directory(templatefile)) - - -- insert to templates - table.insert(templates, instance) - end - end - return templates -end - --- return module: template -return template diff --git a/xmake/core/sandbox/modules/import/core/project/template.lua b/xmake/core/sandbox/modules/import/core/project/template.lua deleted file mode 100644 index 4fe8d378b..000000000 --- a/xmake/core/sandbox/modules/import/core/project/template.lua +++ /dev/null @@ -1,39 +0,0 @@ ---!A cross-platform build utility based on Lua --- --- Licensed under the Apache License, Version 2.0 (the "License"); --- you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- --- Copyright (C) 2015-present, Xmake Open Source Community. --- --- @author ruki --- @file template.lua --- - --- define module -local sandbox_core_project_template = sandbox_core_project_template or {} - --- load modules -local template = require("project/template") -local raise = require("sandbox/modules/raise") - --- get all languages -function sandbox_core_project_template.languages() - return assert(template.languages()) -end - --- load all templates from the given language -function sandbox_core_project_template.templates(language) - return assert(template.templates(language)) -end - --- return module -return sandbox_core_project_template diff --git a/xmake/templates/c++/console/project/src/main.cpp b/xmake/templates/c++/console/project/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/console/project/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/project/xmake.lua b/xmake/templates/c++/console/project/xmake.lua deleted file mode 100644 index 649206eb1..000000000 --- a/xmake/templates/c++/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.cpp") - -${FAQ} diff --git a/xmake/templates/c++/console/src/main.cpp b/xmake/templates/c++/console/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/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/templates/c++/console/template.lua b/xmake/templates/c++/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/c++/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/console/xmake.lua b/xmake/templates/c++/console/xmake.lua new file mode 100644 index 000000000..649206eb1 --- /dev/null +++ b/xmake/templates/c++/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.cpp") + +${FAQ} diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c++/module.binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp b/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/templates/c++/module.binary/modules/binary/bar/src/add.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a + b); + return 0; +} diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp b/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/templates/c++/module.binary/modules/binary/bar/src/sub.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a - b); + return 0; +} diff --git a/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..add3c6e97 --- /dev/null +++ b/xmake/templates/c++/module.binary/modules/binary/bar/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("add") + add_rules("module.binary") + add_files("src/add.cpp") + +target("sub") + add_rules("module.binary") + add_files("src/sub.cpp") + diff --git a/xmake/templates/c++/module.binary/project/modules/binary/bar/.gitignore b/xmake/templates/c++/module.binary/project/modules/binary/bar/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module.binary/project/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/project/modules/binary/bar/src/add.cpp b/xmake/templates/c++/module.binary/project/modules/binary/bar/src/add.cpp deleted file mode 100644 index 93fdf0ad8..000000000 --- a/xmake/templates/c++/module.binary/project/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/project/modules/binary/bar/src/sub.cpp b/xmake/templates/c++/module.binary/project/modules/binary/bar/src/sub.cpp deleted file mode 100644 index ae7b6d1f2..000000000 --- a/xmake/templates/c++/module.binary/project/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/project/modules/binary/bar/xmake.lua b/xmake/templates/c++/module.binary/project/modules/binary/bar/xmake.lua deleted file mode 100644 index add3c6e97..000000000 --- a/xmake/templates/c++/module.binary/project/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/project/src/main.cpp b/xmake/templates/c++/module.binary/project/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module.binary/project/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/project/xmake.lua b/xmake/templates/c++/module.binary/project/xmake.lua deleted file mode 100644 index 47fed5bc6..000000000 --- a/xmake/templates/c++/module.binary/project/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGETNAME}") - 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.binary/src/main.cpp b/xmake/templates/c++/module.binary/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/templates/c++/module.binary/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + std::cout << "hello world!" << std::endl; + return 0; +} diff --git a/xmake/templates/c++/module.binary/template.lua b/xmake/templates/c++/module.binary/template.lua deleted file mode 100644 index 917f4eb23..000000000 --- a/xmake/templates/c++/module.binary/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("module.binary") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/module.binary/xmake.lua b/xmake/templates/c++/module.binary/xmake.lua new file mode 100644 index 000000000..47fed5bc6 --- /dev/null +++ b/xmake/templates/c++/module.binary/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGETNAME}") + 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/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/templates/c++/module.shared/modules/shared/foo/src/foo.cpp @@ -0,0 +1,22 @@ +#include + +static int add(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a + b); + return 1; +} + +static int sub(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a - b); + return 1; +} + +int luaopen(foo, lua_State *lua) { + static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; + lua_newtable(lua); + luaL_setfuncs(lua, funcs, 0); + return 1; +} diff --git a/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..9b3423d41 --- /dev/null +++ b/xmake/templates/c++/module.shared/modules/shared/foo/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + add_rules("module.shared") + add_files("src/foo.cpp") + diff --git a/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp deleted file mode 100644 index adde214ca..000000000 --- a/xmake/templates/c++/module.shared/project/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/project/modules/shared/foo/xmake.lua b/xmake/templates/c++/module.shared/project/modules/shared/foo/xmake.lua deleted file mode 100644 index 9b3423d41..000000000 --- a/xmake/templates/c++/module.shared/project/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/project/src/main.cpp b/xmake/templates/c++/module.shared/project/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module.shared/project/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/project/xmake.lua b/xmake/templates/c++/module.shared/project/xmake.lua deleted file mode 100644 index 34496aa5b..000000000 --- a/xmake/templates/c++/module.shared/project/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.cpp") - on_config(function (target) - import("shared.foo") - print("shared: 1 + 1 = %s", foo.add(1, 1)) - print("shared: 1 - 1 = %s", foo.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c++/module.shared/src/main.cpp b/xmake/templates/c++/module.shared/src/main.cpp new file mode 100644 index 000000000..9b6abffea --- /dev/null +++ b/xmake/templates/c++/module.shared/src/main.cpp @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + std::cout << "hello world!" << std::endl; + return 0; +} diff --git a/xmake/templates/c++/module.shared/template.lua b/xmake/templates/c++/module.shared/template.lua deleted file mode 100644 index 7869165b7..000000000 --- a/xmake/templates/c++/module.shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("module.shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/module.shared/xmake.lua b/xmake/templates/c++/module.shared/xmake.lua new file mode 100644 index 000000000..34496aa5b --- /dev/null +++ b/xmake/templates/c++/module.shared/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGETNAME}") + 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/project/src/main.cpp b/xmake/templates/c++/qt.console/project/src/main.cpp deleted file mode 100644 index e876eea4f..000000000 --- a/xmake/templates/c++/qt.console/project/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/project/xmake.lua b/xmake/templates/c++/qt.console/project/xmake.lua deleted file mode 100644 index fc9104ce6..000000000 --- a/xmake/templates/c++/qt.console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("qt.console") - add_files("src/*.cpp") - -${FAQ} diff --git a/xmake/templates/c++/qt.console/src/main.cpp b/xmake/templates/c++/qt.console/src/main.cpp new file mode 100644 index 000000000..e876eea4f --- /dev/null +++ b/xmake/templates/c++/qt.console/src/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char *argv[]) { + QCoreApplication a(argc, argv); + printf("hello xmake\n"); + return a.exec(); +} diff --git a/xmake/templates/c++/qt.console/template.lua b/xmake/templates/c++/qt.console/template.lua deleted file mode 100644 index 6b5c26b3a..000000000 --- a/xmake/templates/c++/qt.console/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.console") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.console/xmake.lua b/xmake/templates/c++/qt.console/xmake.lua new file mode 100644 index 000000000..fc9104ce6 --- /dev/null +++ b/xmake/templates/c++/qt.console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("qt.console") + add_files("src/*.cpp") + +${FAQ} diff --git a/xmake/templates/c++/qt.quickapp/project/src/main.cpp b/xmake/templates/c++/qt.quickapp/project/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt.quickapp/project/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/project/src/main.qml b/xmake/templates/c++/qt.quickapp/project/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt.quickapp/project/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/project/src/qml.qrc b/xmake/templates/c++/qt.quickapp/project/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt.quickapp/project/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/xmake/templates/c++/qt.quickapp/project/xmake.lua b/xmake/templates/c++/qt.quickapp/project/xmake.lua deleted file mode 100644 index 4dd4fc684..000000000 --- a/xmake/templates/c++/qt.quickapp/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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/src/main.cpp b/xmake/templates/c++/qt.quickapp/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/templates/c++/qt.quickapp/src/main.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) { +#if QT_VERSION >= 0x50601 + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/xmake/templates/c++/qt.quickapp/src/main.qml b/xmake/templates/c++/qt.quickapp/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/templates/c++/qt.quickapp/src/main.qml @@ -0,0 +1,18 @@ +import QtQuick 2.6 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.2 + +Window { + id: root + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + Button { + text: "Ok" + onClicked: { + root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); + } + } +} + diff --git a/xmake/templates/c++/qt.quickapp/src/qml.qrc b/xmake/templates/c++/qt.quickapp/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/templates/c++/qt.quickapp/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/templates/c++/qt.quickapp/template.lua b/xmake/templates/c++/qt.quickapp/template.lua deleted file mode 100644 index 144deb174..000000000 --- a/xmake/templates/c++/qt.quickapp/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.quickapp") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.quickapp/xmake.lua b/xmake/templates/c++/qt.quickapp/xmake.lua new file mode 100644 index 000000000..4dd4fc684 --- /dev/null +++ b/xmake/templates/c++/qt.quickapp/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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/project/src/main.cpp b/xmake/templates/c++/qt.quickapp_static/project/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt.quickapp_static/project/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/project/src/main.qml b/xmake/templates/c++/qt.quickapp_static/project/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt.quickapp_static/project/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/project/src/qml.qrc b/xmake/templates/c++/qt.quickapp_static/project/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt.quickapp_static/project/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - main.qml - - diff --git a/xmake/templates/c++/qt.quickapp_static/project/xmake.lua b/xmake/templates/c++/qt.quickapp_static/project/xmake.lua deleted file mode 100644 index 0d752b270..000000000 --- a/xmake/templates/c++/qt.quickapp_static/project/xmake.lua +++ /dev/null @@ -1,16 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGETNAME}") - 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.quickapp_static/src/main.cpp b/xmake/templates/c++/qt.quickapp_static/src/main.cpp new file mode 100644 index 000000000..7d9cb80df --- /dev/null +++ b/xmake/templates/c++/qt.quickapp_static/src/main.cpp @@ -0,0 +1,17 @@ +#include +#include + +int main(int argc, char *argv[]) { +#if QT_VERSION >= 0x50601 + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + + QGuiApplication app(argc, argv); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/xmake/templates/c++/qt.quickapp_static/src/main.qml b/xmake/templates/c++/qt.quickapp_static/src/main.qml new file mode 100644 index 000000000..120cdbddd --- /dev/null +++ b/xmake/templates/c++/qt.quickapp_static/src/main.qml @@ -0,0 +1,18 @@ +import QtQuick 2.6 +import QtQuick.Window 2.2 +import QtQuick.Controls 2.2 + +Window { + id: root + visible: true + width: 640 + height: 480 + title: qsTr("Hello World") + Button { + text: "Ok" + onClicked: { + root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); + } + } +} + diff --git a/xmake/templates/c++/qt.quickapp_static/src/qml.qrc b/xmake/templates/c++/qt.quickapp_static/src/qml.qrc new file mode 100644 index 000000000..5f6483ac3 --- /dev/null +++ b/xmake/templates/c++/qt.quickapp_static/src/qml.qrc @@ -0,0 +1,5 @@ + + + main.qml + + diff --git a/xmake/templates/c++/qt.quickapp_static/template.lua b/xmake/templates/c++/qt.quickapp_static/template.lua deleted file mode 100644 index ff528f69f..000000000 --- a/xmake/templates/c++/qt.quickapp_static/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.quickapp_static") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.quickapp_static/xmake.lua b/xmake/templates/c++/qt.quickapp_static/xmake.lua new file mode 100644 index 000000000..0d752b270 --- /dev/null +++ b/xmake/templates/c++/qt.quickapp_static/xmake.lua @@ -0,0 +1,16 @@ +add_rules("mode.debug", "mode.release") + +includes("@builtin/qt") + +target("${TARGETNAME}") + 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/project/src/demo.cpp b/xmake/templates/c++/qt.shared/project/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt.shared/project/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt.shared/project/src/demo.h b/xmake/templates/c++/qt.shared/project/src/demo.h deleted file mode 100644 index 89f29ec46..000000000 --- a/xmake/templates/c++/qt.shared/project/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/project/src/demo_global.h b/xmake/templates/c++/qt.shared/project/src/demo_global.h deleted file mode 100644 index d6b1ddf0b..000000000 --- a/xmake/templates/c++/qt.shared/project/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/project/xmake.lua b/xmake/templates/c++/qt.shared/project/xmake.lua deleted file mode 100644 index aa5cebf0a..000000000 --- a/xmake/templates/c++/qt.shared/project/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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.shared/src/demo.cpp b/xmake/templates/c++/qt.shared/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/templates/c++/qt.shared/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/templates/c++/qt.shared/src/demo.h b/xmake/templates/c++/qt.shared/src/demo.h new file mode 100644 index 000000000..89f29ec46 --- /dev/null +++ b/xmake/templates/c++/qt.shared/src/demo.h @@ -0,0 +1,11 @@ +#ifndef QT_DEMO_H +#define QT_DEMO_H + +#include "demo_global.h" + +class QT_DEMOSHARED_EXPORT QtDemo { + public: + QtDemo(); +}; + +#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt.shared/src/demo_global.h b/xmake/templates/c++/qt.shared/src/demo_global.h new file mode 100644 index 000000000..d6b1ddf0b --- /dev/null +++ b/xmake/templates/c++/qt.shared/src/demo_global.h @@ -0,0 +1,12 @@ +#ifndef QT_DEMO_GLOBAL_H +#define QT_DEMO_GLOBAL_H + +#include + +#if defined(QT_DEMO_LIBRARY) +#define QT_DEMOSHARED_EXPORT Q_DECL_EXPORT +#else +#define QT_DEMOSHARED_EXPORT Q_DECL_IMPORT +#endif + +#endif // QT_DEMO_GLOBAL_H diff --git a/xmake/templates/c++/qt.shared/template.lua b/xmake/templates/c++/qt.shared/template.lua deleted file mode 100644 index 24960332a..000000000 --- a/xmake/templates/c++/qt.shared/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.shared") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.shared/xmake.lua b/xmake/templates/c++/qt.shared/xmake.lua new file mode 100644 index 000000000..aa5cebf0a --- /dev/null +++ b/xmake/templates/c++/qt.shared/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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/project/src/demo.cpp b/xmake/templates/c++/qt.static/project/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt.static/project/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt.static/project/src/demo.h b/xmake/templates/c++/qt.static/project/src/demo.h deleted file mode 100644 index 24730c9d8..000000000 --- a/xmake/templates/c++/qt.static/project/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/project/xmake.lua b/xmake/templates/c++/qt.static/project/xmake.lua deleted file mode 100644 index 6ff2a8c58..000000000 --- a/xmake/templates/c++/qt.static/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("qt.static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_frameworks("QtGui") - -${FAQ} diff --git a/xmake/templates/c++/qt.static/src/demo.cpp b/xmake/templates/c++/qt.static/src/demo.cpp new file mode 100644 index 000000000..576c861f0 --- /dev/null +++ b/xmake/templates/c++/qt.static/src/demo.cpp @@ -0,0 +1,4 @@ +#include "demo.h" + +QtDemo::QtDemo() { +} diff --git a/xmake/templates/c++/qt.static/src/demo.h b/xmake/templates/c++/qt.static/src/demo.h new file mode 100644 index 000000000..24730c9d8 --- /dev/null +++ b/xmake/templates/c++/qt.static/src/demo.h @@ -0,0 +1,9 @@ +#ifndef QT_DEMO_H +#define QT_DEMO_H + +class QtDemo { + public: + QtDemo(); +}; + +#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt.static/template.lua b/xmake/templates/c++/qt.static/template.lua deleted file mode 100644 index 3a6f18019..000000000 --- a/xmake/templates/c++/qt.static/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.static") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.static/xmake.lua b/xmake/templates/c++/qt.static/xmake.lua new file mode 100644 index 000000000..6ff2a8c58 --- /dev/null +++ b/xmake/templates/c++/qt.static/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("qt.static") + add_headerfiles("src/*.h") + add_files("src/*.cpp") + add_frameworks("QtGui") + +${FAQ} diff --git a/xmake/templates/c++/qt.widgetapp/project/src/main.cpp b/xmake/templates/c++/qt.widgetapp/project/src/main.cpp deleted file mode 100644 index 191ae18d2..000000000 --- a/xmake/templates/c++/qt.widgetapp/project/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/project/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt.widgetapp/project/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/project/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt.widgetapp/project/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/project/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - - - - - - diff --git a/xmake/templates/c++/qt.widgetapp/project/xmake.lua b/xmake/templates/c++/qt.widgetapp/project/xmake.lua deleted file mode 100644 index 9fdf5206d..000000000 --- a/xmake/templates/c++/qt.widgetapp/project/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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/src/main.cpp b/xmake/templates/c++/qt.widgetapp/src/main.cpp new file mode 100644 index 000000000..191ae18d2 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp/src/main.cpp @@ -0,0 +1,9 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp/src/mainwindow.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); +} + +MainWindow::~MainWindow() { + delete ui; +} diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp/src/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/templates/c++/qt.widgetapp/template.lua b/xmake/templates/c++/qt.widgetapp/template.lua deleted file mode 100644 index 97a9fe3bb..000000000 --- a/xmake/templates/c++/qt.widgetapp/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.widgetapp") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.widgetapp/xmake.lua b/xmake/templates/c++/qt.widgetapp/xmake.lua new file mode 100644 index 000000000..9fdf5206d --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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/project/src/main.cpp b/xmake/templates/c++/qt.widgetapp_static/project/src/main.cpp deleted file mode 100644 index db5b0cce8..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/project/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/project/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/project/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/project/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/project/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/project/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - - - - - - diff --git a/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua b/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua deleted file mode 100644 index b2cc1ac86..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua +++ /dev/null @@ -1,18 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGETNAME}") - add_rules("qt.widgetapp_static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/mainwindow.ui") - - -- add files with Q_OBJECT meta (only for qt.moc) - add_files("src/mainwindow.h") - - -- add plugin: QSvgPlugin (optional) - add_frameworks("QtSvg") - qt_add_static_plugins("QSvgPlugin", {linkdirs = "plugins/imageformats", links = {"qsvg"}}) - -${FAQ} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/main.cpp b/xmake/templates/c++/qt.widgetapp_static/src/main.cpp new file mode 100644 index 000000000..db5b0cce8 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp_static/src/main.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include + +int main(int argc, char *argv[]) { + QApplication a(argc, argv); + MainWindow w; + w.show(); + + return a.exec(); +} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp new file mode 100644 index 000000000..c9c6a0d98 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.cpp @@ -0,0 +1,10 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { + ui->setupUi(this); +} + +MainWindow::~MainWindow() { + delete ui; +} diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h new file mode 100644 index 000000000..a4245aa42 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.h @@ -0,0 +1,21 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow { + Q_OBJECT + + public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + private: + Ui::MainWindow *ui; +}; + +#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui new file mode 100644 index 000000000..1c59b695e --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp_static/src/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + + diff --git a/xmake/templates/c++/qt.widgetapp_static/template.lua b/xmake/templates/c++/qt.widgetapp_static/template.lua deleted file mode 100644 index 6ccd9b178..000000000 --- a/xmake/templates/c++/qt.widgetapp_static/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("qt.widgetapp_static") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/qt.widgetapp_static/xmake.lua b/xmake/templates/c++/qt.widgetapp_static/xmake.lua new file mode 100644 index 000000000..b2cc1ac86 --- /dev/null +++ b/xmake/templates/c++/qt.widgetapp_static/xmake.lua @@ -0,0 +1,18 @@ +add_rules("mode.debug", "mode.release") + +includes("@builtin/qt") + +target("${TARGETNAME}") + 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/project/src/foo.cpp b/xmake/templates/c++/shared/project/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/shared/project/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/project/src/foo.h b/xmake/templates/c++/shared/project/src/foo.h deleted file mode 100644 index bd496c784..000000000 --- a/xmake/templates/c++/shared/project/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/project/src/main.cpp b/xmake/templates/c++/shared/project/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/shared/project/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/project/xmake.lua b/xmake/templates/c++/shared/project/xmake.lua deleted file mode 100644 index 43510f03e..000000000 --- a/xmake/templates/c++/shared/project/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("${TARGETNAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.cpp") - -${FAQ} diff --git a/xmake/templates/c++/shared/src/foo.cpp b/xmake/templates/c++/shared/src/foo.cpp new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/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/templates/c++/shared/src/foo.h b/xmake/templates/c++/shared/src/foo.h new file mode 100644 index 000000000..bd496c784 --- /dev/null +++ b/xmake/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/templates/c++/shared/src/main.cpp b/xmake/templates/c++/shared/src/main.cpp new file mode 100644 index 000000000..3834ee4d3 --- /dev/null +++ b/xmake/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/templates/c++/shared/template.lua b/xmake/templates/c++/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/c++/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/shared/xmake.lua b/xmake/templates/c++/shared/xmake.lua new file mode 100644 index 000000000..43510f03e --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.cpp") + +${FAQ} diff --git a/xmake/templates/c++/static/project/src/foo.cpp b/xmake/templates/c++/static/project/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/static/project/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/project/src/foo.h b/xmake/templates/c++/static/project/src/foo.h deleted file mode 100644 index d2506bca9..000000000 --- a/xmake/templates/c++/static/project/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/project/src/main.cpp b/xmake/templates/c++/static/project/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/static/project/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/project/xmake.lua b/xmake/templates/c++/static/project/xmake.lua deleted file mode 100644 index 45d81c393..000000000 --- a/xmake/templates/c++/static/project/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("${TARGETNAME}") - 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 new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/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/templates/c++/static/src/foo.h b/xmake/templates/c++/static/src/foo.h new file mode 100644 index 000000000..d2506bca9 --- /dev/null +++ b/xmake/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/templates/c++/static/src/main.cpp b/xmake/templates/c++/static/src/main.cpp new file mode 100644 index 000000000..3834ee4d3 --- /dev/null +++ b/xmake/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/templates/c++/static/template.lua b/xmake/templates/c++/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/c++/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/static/xmake.lua b/xmake/templates/c++/static/xmake.lua new file mode 100644 index 000000000..45d81c393 --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.cpp") + +${FAQ} diff --git a/xmake/templates/c++/tbox.console/project/src/main.cpp b/xmake/templates/c++/tbox.console/project/src/main.cpp deleted file mode 100644 index 2c7596b33..000000000 --- a/xmake/templates/c++/tbox.console/project/src/main.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c++/tbox.console/project/src/xmake.lua b/xmake/templates/c++/tbox.console/project/src/xmake.lua deleted file mode 100644 index fd618b9ee..000000000 --- a/xmake/templates/c++/tbox.console/project/src/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("binary") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.cpp") - diff --git a/xmake/templates/c++/tbox.console/project/xmake.lua b/xmake/templates/c++/tbox.console/project/xmake.lua deleted file mode 100644 index 8f8a824a1..000000000 --- a/xmake/templates/c++/tbox.console/project/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src") - -${FAQ} diff --git a/xmake/templates/c++/tbox.console/src/main.cpp b/xmake/templates/c++/tbox.console/src/main.cpp new file mode 100644 index 000000000..2c7596b33 --- /dev/null +++ b/xmake/templates/c++/tbox.console/src/main.cpp @@ -0,0 +1,15 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c++/tbox.console/src/xmake.lua b/xmake/templates/c++/tbox.console/src/xmake.lua new file mode 100644 index 000000000..fd618b9ee --- /dev/null +++ b/xmake/templates/c++/tbox.console/src/xmake.lua @@ -0,0 +1,15 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("binary") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.cpp") + diff --git a/xmake/templates/c++/tbox.console/template.lua b/xmake/templates/c++/tbox.console/template.lua deleted file mode 100644 index d1f2f892d..000000000 --- a/xmake/templates/c++/tbox.console/template.lua +++ /dev/null @@ -1,4 +0,0 @@ -template("tbox.console") - add_configfiles("xmake.lua") - add_configfiles("src/xmake.lua") - diff --git a/xmake/templates/c++/tbox.console/xmake.lua b/xmake/templates/c++/tbox.console/xmake.lua new file mode 100644 index 000000000..8f8a824a1 --- /dev/null +++ b/xmake/templates/c++/tbox.console/xmake.lua @@ -0,0 +1,21 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src") + +${FAQ} diff --git a/xmake/templates/c++/tbox.shared/project/src/_demo/main.cpp b/xmake/templates/c++/tbox.shared/project/src/_demo/main.cpp deleted file mode 100644 index b1e763989..000000000 --- a/xmake/templates/c++/tbox.shared/project/src/_demo/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "${TARGETNAME}/interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_trace_i("add(1 + 1) = %d", add(1, 1)); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c++/tbox.shared/project/src/_demo/xmake.lua b/xmake/templates/c++/tbox.shared/project/src/_demo/xmake.lua deleted file mode 100644 index fd2d629da..000000000 --- a/xmake/templates/c++/tbox.shared/project/src/_demo/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -target("demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_defines("__tb_prefix__=\"demo\"") - add_files("*.cpp") - add_packages("tbox") - diff --git a/xmake/templates/c++/tbox.shared/project/src/_library/interface.cpp b/xmake/templates/c++/tbox.shared/project/src/_library/interface.cpp deleted file mode 100644 index ab0a826a6..000000000 --- a/xmake/templates/c++/tbox.shared/project/src/_library/interface.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * implementation - */ -tb_int_t add(tb_int_t a, tb_int_t b) { - return a + b; -} diff --git a/xmake/templates/c++/tbox.shared/project/src/_library/interface.h b/xmake/templates/c++/tbox.shared/project/src/_library/interface.h deleted file mode 100644 index 843ef1c98..000000000 --- a/xmake/templates/c++/tbox.shared/project/src/_library/interface.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef INTERFACE_H -#define INTERFACE_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - - __tb_export__ tb_int_t - add(tb_int_t a, tb_int_t b); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua b/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua deleted file mode 100644 index 5c637ccda..000000000 --- a/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("shared") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add the header files for installing - add_headerfiles("../(${TARGETNAME}/**.h)") - - -- add includes directory - add_includedirs("..", {interface = true}) - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.cpp") - diff --git a/xmake/templates/c++/tbox.shared/project/xmake.lua b/xmake/templates/c++/tbox.shared/project/xmake.lua deleted file mode 100644 index 1cd6ebc79..000000000 --- a/xmake/templates/c++/tbox.shared/project/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") - -${FAQ} diff --git a/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.cpp b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.cpp new file mode 100644 index 000000000..ab0a826a6 --- /dev/null +++ b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.cpp @@ -0,0 +1,11 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * implementation + */ +tb_int_t add(tb_int_t a, tb_int_t b) { + return a + b; +} diff --git a/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.h b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.h new file mode 100644 index 000000000..843ef1c98 --- /dev/null +++ b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/interface.h @@ -0,0 +1,22 @@ +#ifndef INTERFACE_H +#define INTERFACE_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + + __tb_export__ tb_int_t + add(tb_int_t a, tb_int_t b); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/xmake.lua b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/xmake.lua new file mode 100644 index 000000000..5c637ccda --- /dev/null +++ b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}/xmake.lua @@ -0,0 +1,21 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("shared") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add the header files for installing + add_headerfiles("../(${TARGETNAME}/**.h)") + + -- add includes directory + add_includedirs("..", {interface = true}) + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.cpp") + diff --git a/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/main.cpp b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/main.cpp new file mode 100644 index 000000000..b1e763989 --- /dev/null +++ b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/main.cpp @@ -0,0 +1,16 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "${TARGETNAME}/interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_trace_i("add(1 + 1) = %d", add(1, 1)); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/xmake.lua b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/xmake.lua new file mode 100644 index 000000000..fd2d629da --- /dev/null +++ b/xmake/templates/c++/tbox.shared/src/${TARGETNAME}_demo/xmake.lua @@ -0,0 +1,7 @@ +target("demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_defines("__tb_prefix__=\"demo\"") + add_files("*.cpp") + add_packages("tbox") + diff --git a/xmake/templates/c++/tbox.shared/template.lua b/xmake/templates/c++/tbox.shared/template.lua deleted file mode 100644 index 14fa4dbda..000000000 --- a/xmake/templates/c++/tbox.shared/template.lua +++ /dev/null @@ -1,9 +0,0 @@ -template("tbox.shared") - add_configfiles("xmake.lua") - add_configfiles("src/_demo/main.cpp") - add_configfiles("src/_demo/xmake.lua") - add_configfiles("src/_library/xmake.lua") - after_create(function (template, opt) - os.mv("src/_library", path.join("src", opt.targetname)) - os.mv("src/_demo", path.join("src", opt.targetname .. "_demo")) - end) diff --git a/xmake/templates/c++/tbox.shared/xmake.lua b/xmake/templates/c++/tbox.shared/xmake.lua new file mode 100644 index 000000000..1cd6ebc79 --- /dev/null +++ b/xmake/templates/c++/tbox.shared/xmake.lua @@ -0,0 +1,21 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") + +${FAQ} diff --git a/xmake/templates/c++/tbox.static/project/src/_demo/main.cpp b/xmake/templates/c++/tbox.static/project/src/_demo/main.cpp deleted file mode 100644 index b1e763989..000000000 --- a/xmake/templates/c++/tbox.static/project/src/_demo/main.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "${TARGETNAME}/interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_trace_i("add(1 + 1) = %d", add(1, 1)); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c++/tbox.static/project/src/_demo/xmake.lua b/xmake/templates/c++/tbox.static/project/src/_demo/xmake.lua deleted file mode 100644 index fd2d629da..000000000 --- a/xmake/templates/c++/tbox.static/project/src/_demo/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -target("demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_defines("__tb_prefix__=\"demo\"") - add_files("*.cpp") - add_packages("tbox") - diff --git a/xmake/templates/c++/tbox.static/project/src/_library/interface.cpp b/xmake/templates/c++/tbox.static/project/src/_library/interface.cpp deleted file mode 100644 index ab0a826a6..000000000 --- a/xmake/templates/c++/tbox.static/project/src/_library/interface.cpp +++ /dev/null @@ -1,11 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * implementation - */ -tb_int_t add(tb_int_t a, tb_int_t b) { - return a + b; -} diff --git a/xmake/templates/c++/tbox.static/project/src/_library/interface.h b/xmake/templates/c++/tbox.static/project/src/_library/interface.h deleted file mode 100644 index caddb8394..000000000 --- a/xmake/templates/c++/tbox.static/project/src/_library/interface.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef INTERFACE_H -#define INTERFACE_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - - tb_int_t - add(tb_int_t a, tb_int_t b); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua b/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua deleted file mode 100644 index bdcf999f8..000000000 --- a/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("static") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add the header files for installing - add_headerfiles("../(${TARGETNAME}/**.h)") - - -- add includes directory - add_includedirs("..", {interface = true}) - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.cpp") - diff --git a/xmake/templates/c++/tbox.static/project/xmake.lua b/xmake/templates/c++/tbox.static/project/xmake.lua deleted file mode 100644 index 1cd6ebc79..000000000 --- a/xmake/templates/c++/tbox.static/project/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") - -${FAQ} diff --git a/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.cpp b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.cpp new file mode 100644 index 000000000..ab0a826a6 --- /dev/null +++ b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.cpp @@ -0,0 +1,11 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * implementation + */ +tb_int_t add(tb_int_t a, tb_int_t b) { + return a + b; +} diff --git a/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.h b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.h new file mode 100644 index 000000000..caddb8394 --- /dev/null +++ b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/interface.h @@ -0,0 +1,22 @@ +#ifndef INTERFACE_H +#define INTERFACE_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + + tb_int_t + add(tb_int_t a, tb_int_t b); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/xmake/templates/c++/tbox.static/src/${TARGETNAME}/xmake.lua b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/xmake.lua new file mode 100644 index 000000000..bdcf999f8 --- /dev/null +++ b/xmake/templates/c++/tbox.static/src/${TARGETNAME}/xmake.lua @@ -0,0 +1,21 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("static") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add the header files for installing + add_headerfiles("../(${TARGETNAME}/**.h)") + + -- add includes directory + add_includedirs("..", {interface = true}) + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.cpp") + diff --git a/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/main.cpp b/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/main.cpp new file mode 100644 index 000000000..b1e763989 --- /dev/null +++ b/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/main.cpp @@ -0,0 +1,16 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "${TARGETNAME}/interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_trace_i("add(1 + 1) = %d", add(1, 1)); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/xmake.lua b/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/xmake.lua new file mode 100644 index 000000000..fd2d629da --- /dev/null +++ b/xmake/templates/c++/tbox.static/src/${TARGETNAME}_demo/xmake.lua @@ -0,0 +1,7 @@ +target("demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_defines("__tb_prefix__=\"demo\"") + add_files("*.cpp") + add_packages("tbox") + diff --git a/xmake/templates/c++/tbox.static/template.lua b/xmake/templates/c++/tbox.static/template.lua deleted file mode 100644 index acc4e21bd..000000000 --- a/xmake/templates/c++/tbox.static/template.lua +++ /dev/null @@ -1,9 +0,0 @@ -template("tbox.static") - add_configfiles("xmake.lua") - add_configfiles("src/_demo/main.cpp") - add_configfiles("src/_demo/xmake.lua") - add_configfiles("src/_library/xmake.lua") - after_create(function (template, opt) - os.mv("src/_library", path.join("src", opt.targetname)) - os.mv("src/_demo", path.join("src", opt.targetname .. "_demo")) - end) diff --git a/xmake/templates/c++/tbox.static/xmake.lua b/xmake/templates/c++/tbox.static/xmake.lua new file mode 100644 index 000000000..1cd6ebc79 --- /dev/null +++ b/xmake/templates/c++/tbox.static/xmake.lua @@ -0,0 +1,21 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") + +${FAQ} diff --git a/xmake/templates/c++/wxwidgets/project/src/main.cpp b/xmake/templates/c++/wxwidgets/project/src/main.cpp deleted file mode 100644 index 4b43fe6e3..000000000 --- a/xmake/templates/c++/wxwidgets/project/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/project/xmake.lua b/xmake/templates/c++/wxwidgets/project/xmake.lua deleted file mode 100644 index 4b062189f..000000000 --- a/xmake/templates/c++/wxwidgets/project/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("wxwidgets") - -target("${TARGETNAME}") - 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++/wxwidgets/src/main.cpp b/xmake/templates/c++/wxwidgets/src/main.cpp new file mode 100644 index 000000000..4b43fe6e3 --- /dev/null +++ b/xmake/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/templates/c++/wxwidgets/template.lua b/xmake/templates/c++/wxwidgets/template.lua deleted file mode 100644 index ca0fc6319..000000000 --- a/xmake/templates/c++/wxwidgets/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("wxwidgets") - add_configfiles("xmake.lua") - diff --git a/xmake/templates/c++/wxwidgets/xmake.lua b/xmake/templates/c++/wxwidgets/xmake.lua new file mode 100644 index 000000000..4b062189f --- /dev/null +++ b/xmake/templates/c++/wxwidgets/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +add_requires("wxwidgets") + +target("${TARGETNAME}") + 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/project/src/lni/main.cpp b/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp deleted file mode 100644 index e8955e074..000000000 --- a/xmake/templates/c++/xmake.cli/project/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("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); -} diff --git a/xmake/templates/c++/xmake.cli/project/src/lua/main.lua b/xmake/templates/c++/xmake.cli/project/src/lua/main.lua deleted file mode 100644 index d87daf102..000000000 --- a/xmake/templates/c++/xmake.cli/project/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/project/xmake.lua b/xmake/templates/c++/xmake.cli/project/xmake.lua deleted file mode 100644 index 5fa81aa45..000000000 --- a/xmake/templates/c++/xmake.cli/project/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("libxmake") - -target("${TARGETNAME}") - add_rules("xmake.cli") - add_files("src/lni/*.cpp") - add_files("src/lua/*.lua", {rootdir = "src"}) - add_packages("libxmake") - -${FAQ} - diff --git a/xmake/templates/c++/xmake.cli/src/lni/main.cpp b/xmake/templates/c++/xmake.cli/src/lni/main.cpp new file mode 100644 index 000000000..e8955e074 --- /dev/null +++ b/xmake/templates/c++/xmake.cli/src/lni/main.cpp @@ -0,0 +1,23 @@ +extern "C" { +#include +} + +static tb_byte_t const g_luafiles_data[] = { +#include "luafiles.xmz.h" +}; + +static tb_int_t lni_test_hello(lua_State *lua) { + lua_pushliteral(lua, "hello xmake!"); + return 1; +} + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { + static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; + xm_engine_register(engine, "test", lni_test_funcs); + xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); +} + +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; + return xm_engine_run("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); +} diff --git a/xmake/templates/c++/xmake.cli/src/lua/main.lua b/xmake/templates/c++/xmake.cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/templates/c++/xmake.cli/src/lua/main.lua @@ -0,0 +1,10 @@ +import("core.base.option") +import("lib.lni.test") + +function main () + print(test.hello()) + local argv = option.get("arguments") + if argv then + print(argv) + end +end diff --git a/xmake/templates/c++/xmake.cli/template.lua b/xmake/templates/c++/xmake.cli/template.lua deleted file mode 100644 index 431e0af1f..000000000 --- a/xmake/templates/c++/xmake.cli/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("xmake.cli") - add_configfiles("src/lni/main.cpp") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c++/xmake.cli/xmake.lua b/xmake/templates/c++/xmake.cli/xmake.lua new file mode 100644 index 000000000..5fa81aa45 --- /dev/null +++ b/xmake/templates/c++/xmake.cli/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +add_requires("libxmake") + +target("${TARGETNAME}") + 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/project/src/main.c b/xmake/templates/c/console/project/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/console/project/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/project/xmake.lua b/xmake/templates/c/console/project/xmake.lua deleted file mode 100644 index 4fe46c6ff..000000000 --- a/xmake/templates/c/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.c") - -${FAQ} diff --git a/xmake/templates/c/console/src/main.c b/xmake/templates/c/console/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/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/templates/c/console/template.lua b/xmake/templates/c/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/c/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/console/xmake.lua b/xmake/templates/c/console/xmake.lua new file mode 100644 index 000000000..4fe46c6ff --- /dev/null +++ b/xmake/templates/c/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.c") + +${FAQ} diff --git a/xmake/templates/c/module.binary/modules/binary/bar/.gitignore b/xmake/templates/c/module.binary/modules/binary/bar/.gitignore new file mode 100644 index 000000000..152105761 --- /dev/null +++ b/xmake/templates/c/module.binary/modules/binary/bar/.gitignore @@ -0,0 +1,8 @@ +# Xmake cache +.xmake/ +build/ + +# MacOS Cache +.DS_Store + + diff --git a/xmake/templates/c/module.binary/modules/binary/bar/src/add.c b/xmake/templates/c/module.binary/modules/binary/bar/src/add.c new file mode 100644 index 000000000..93fdf0ad8 --- /dev/null +++ b/xmake/templates/c/module.binary/modules/binary/bar/src/add.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a + b); + return 0; +} diff --git a/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c b/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c new file mode 100644 index 000000000..ae7b6d1f2 --- /dev/null +++ b/xmake/templates/c/module.binary/modules/binary/bar/src/sub.c @@ -0,0 +1,9 @@ +#include +#include + +int main(int argc, char **argv) { + int a = atoi(argv[1]); + int b = atoi(argv[2]); + printf("%d", a - b); + return 0; +} diff --git a/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua b/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua new file mode 100644 index 000000000..d4983d741 --- /dev/null +++ b/xmake/templates/c/module.binary/modules/binary/bar/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +target("add") + add_rules("module.binary") + add_files("src/add.c") + +target("sub") + add_rules("module.binary") + add_files("src/sub.c") + diff --git a/xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore b/xmake/templates/c/module.binary/project/modules/binary/bar/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c/module.binary/project/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/project/modules/binary/bar/src/add.c b/xmake/templates/c/module.binary/project/modules/binary/bar/src/add.c deleted file mode 100644 index 93fdf0ad8..000000000 --- a/xmake/templates/c/module.binary/project/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/project/modules/binary/bar/src/sub.c b/xmake/templates/c/module.binary/project/modules/binary/bar/src/sub.c deleted file mode 100644 index ae7b6d1f2..000000000 --- a/xmake/templates/c/module.binary/project/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/project/modules/binary/bar/xmake.lua b/xmake/templates/c/module.binary/project/modules/binary/bar/xmake.lua deleted file mode 100644 index d4983d741..000000000 --- a/xmake/templates/c/module.binary/project/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/project/src/main.c b/xmake/templates/c/module.binary/project/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/module.binary/project/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/project/xmake.lua b/xmake/templates/c/module.binary/project/xmake.lua deleted file mode 100644 index fdd8bb1e5..000000000 --- a/xmake/templates/c/module.binary/project/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGETNAME}") - 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.binary/src/main.c b/xmake/templates/c/module.binary/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/templates/c/module.binary/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("hello world!\n"); + return 0; +} diff --git a/xmake/templates/c/module.binary/template.lua b/xmake/templates/c/module.binary/template.lua deleted file mode 100644 index 917f4eb23..000000000 --- a/xmake/templates/c/module.binary/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("module.binary") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/module.binary/xmake.lua b/xmake/templates/c/module.binary/xmake.lua new file mode 100644 index 000000000..fdd8bb1e5 --- /dev/null +++ b/xmake/templates/c/module.binary/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGETNAME}") + 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/modules/shared/foo/src/foo.c b/xmake/templates/c/module.shared/modules/shared/foo/src/foo.c new file mode 100644 index 000000000..adde214ca --- /dev/null +++ b/xmake/templates/c/module.shared/modules/shared/foo/src/foo.c @@ -0,0 +1,22 @@ +#include + +static int add(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a + b); + return 1; +} + +static int sub(lua_State *lua) { + int a = lua_tointeger(lua, 1); + int b = lua_tointeger(lua, 2); + lua_pushinteger(lua, a - b); + return 1; +} + +int luaopen(foo, lua_State *lua) { + static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; + lua_newtable(lua); + luaL_setfuncs(lua, funcs, 0); + return 1; +} diff --git a/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua b/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua new file mode 100644 index 000000000..035573d9f --- /dev/null +++ b/xmake/templates/c/module.shared/modules/shared/foo/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("foo") + add_rules("module.shared") + add_files("src/foo.c") + diff --git a/xmake/templates/c/module.shared/project/modules/shared/foo/src/foo.c b/xmake/templates/c/module.shared/project/modules/shared/foo/src/foo.c deleted file mode 100644 index adde214ca..000000000 --- a/xmake/templates/c/module.shared/project/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/project/modules/shared/foo/xmake.lua b/xmake/templates/c/module.shared/project/modules/shared/foo/xmake.lua deleted file mode 100644 index 035573d9f..000000000 --- a/xmake/templates/c/module.shared/project/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/project/src/main.c b/xmake/templates/c/module.shared/project/src/main.c deleted file mode 100644 index ccf4b2a77..000000000 --- a/xmake/templates/c/module.shared/project/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/project/xmake.lua b/xmake/templates/c/module.shared/project/xmake.lua deleted file mode 100644 index e39ac665d..000000000 --- a/xmake/templates/c/module.shared/project/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.c") - on_config(function (target) - import("shared.foo") - print("shared: 1 + 1 = %s", foo.add(1, 1)) - print("shared: 1 - 1 = %s", foo.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c/module.shared/src/main.c b/xmake/templates/c/module.shared/src/main.c new file mode 100644 index 000000000..ccf4b2a77 --- /dev/null +++ b/xmake/templates/c/module.shared/src/main.c @@ -0,0 +1,6 @@ +#include + +int main(int argc, char **argv) { + printf("hello world!\n"); + return 0; +} diff --git a/xmake/templates/c/module.shared/template.lua b/xmake/templates/c/module.shared/template.lua deleted file mode 100644 index 7869165b7..000000000 --- a/xmake/templates/c/module.shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("module.shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/module.shared/xmake.lua b/xmake/templates/c/module.shared/xmake.lua new file mode 100644 index 000000000..e39ac665d --- /dev/null +++ b/xmake/templates/c/module.shared/xmake.lua @@ -0,0 +1,15 @@ +add_rules("mode.debug", "mode.release") + +add_moduledirs("modules") + +target("${TARGETNAME}") + 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/project/src/foo.c b/xmake/templates/c/shared/project/src/foo.c deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c/shared/project/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/project/src/foo.h b/xmake/templates/c/shared/project/src/foo.h deleted file mode 100644 index e15925829..000000000 --- a/xmake/templates/c/shared/project/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/project/src/main.c b/xmake/templates/c/shared/project/src/main.c deleted file mode 100644 index f1c29d751..000000000 --- a/xmake/templates/c/shared/project/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/project/xmake.lua b/xmake/templates/c/shared/project/xmake.lua deleted file mode 100644 index 91dac7c63..000000000 --- a/xmake/templates/c/shared/project/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("${TARGETNAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.c") - -${FAQ} diff --git a/xmake/templates/c/shared/src/foo.c b/xmake/templates/c/shared/src/foo.c new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/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/templates/c/shared/src/foo.h b/xmake/templates/c/shared/src/foo.h new file mode 100644 index 000000000..e15925829 --- /dev/null +++ b/xmake/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/templates/c/shared/src/main.c b/xmake/templates/c/shared/src/main.c new file mode 100644 index 000000000..f1c29d751 --- /dev/null +++ b/xmake/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/templates/c/shared/template.lua b/xmake/templates/c/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/c/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/shared/xmake.lua b/xmake/templates/c/shared/xmake.lua new file mode 100644 index 000000000..91dac7c63 --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.c") + +${FAQ} diff --git a/xmake/templates/c/static/project/src/foo.c b/xmake/templates/c/static/project/src/foo.c deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c/static/project/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/project/src/foo.h b/xmake/templates/c/static/project/src/foo.h deleted file mode 100644 index 6295ab95c..000000000 --- a/xmake/templates/c/static/project/src/foo.h +++ /dev/null @@ -1 +0,0 @@ -int add(int a, int b); diff --git a/xmake/templates/c/static/project/src/main.c b/xmake/templates/c/static/project/src/main.c deleted file mode 100644 index f1c29d751..000000000 --- a/xmake/templates/c/static/project/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/project/xmake.lua b/xmake/templates/c/static/project/xmake.lua deleted file mode 100644 index fd0b0592a..000000000 --- a/xmake/templates/c/static/project/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("${TARGETNAME}") - 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 new file mode 100644 index 000000000..1a1fb3425 --- /dev/null +++ b/xmake/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/templates/c/static/src/foo.h b/xmake/templates/c/static/src/foo.h new file mode 100644 index 000000000..6295ab95c --- /dev/null +++ b/xmake/templates/c/static/src/foo.h @@ -0,0 +1 @@ +int add(int a, int b); diff --git a/xmake/templates/c/static/src/main.c b/xmake/templates/c/static/src/main.c new file mode 100644 index 000000000..f1c29d751 --- /dev/null +++ b/xmake/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/templates/c/static/template.lua b/xmake/templates/c/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/c/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/static/xmake.lua b/xmake/templates/c/static/xmake.lua new file mode 100644 index 000000000..fd0b0592a --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.c") + +${FAQ} diff --git a/xmake/templates/c/tbox.console/project/src/main.c b/xmake/templates/c/tbox.console/project/src/main.c deleted file mode 100644 index 2c7596b33..000000000 --- a/xmake/templates/c/tbox.console/project/src/main.c +++ /dev/null @@ -1,15 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c/tbox.console/project/src/xmake.lua b/xmake/templates/c/tbox.console/project/src/xmake.lua deleted file mode 100644 index 40847766c..000000000 --- a/xmake/templates/c/tbox.console/project/src/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("binary") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.c") - diff --git a/xmake/templates/c/tbox.console/project/xmake.lua b/xmake/templates/c/tbox.console/project/xmake.lua deleted file mode 100644 index 7c17dca1a..000000000 --- a/xmake/templates/c/tbox.console/project/xmake.lua +++ /dev/null @@ -1,19 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src") diff --git a/xmake/templates/c/tbox.console/src/main.c b/xmake/templates/c/tbox.console/src/main.c new file mode 100644 index 000000000..2c7596b33 --- /dev/null +++ b/xmake/templates/c/tbox.console/src/main.c @@ -0,0 +1,15 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c/tbox.console/src/xmake.lua b/xmake/templates/c/tbox.console/src/xmake.lua new file mode 100644 index 000000000..40847766c --- /dev/null +++ b/xmake/templates/c/tbox.console/src/xmake.lua @@ -0,0 +1,15 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("binary") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.c") + diff --git a/xmake/templates/c/tbox.console/template.lua b/xmake/templates/c/tbox.console/template.lua deleted file mode 100644 index d1f2f892d..000000000 --- a/xmake/templates/c/tbox.console/template.lua +++ /dev/null @@ -1,4 +0,0 @@ -template("tbox.console") - add_configfiles("xmake.lua") - add_configfiles("src/xmake.lua") - diff --git a/xmake/templates/c/tbox.console/xmake.lua b/xmake/templates/c/tbox.console/xmake.lua new file mode 100644 index 000000000..7c17dca1a --- /dev/null +++ b/xmake/templates/c/tbox.console/xmake.lua @@ -0,0 +1,19 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src") diff --git a/xmake/templates/c/tbox.shared/project/src/_demo/main.c b/xmake/templates/c/tbox.shared/project/src/_demo/main.c deleted file mode 100644 index b1e763989..000000000 --- a/xmake/templates/c/tbox.shared/project/src/_demo/main.c +++ /dev/null @@ -1,16 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "${TARGETNAME}/interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_trace_i("add(1 + 1) = %d", add(1, 1)); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c/tbox.shared/project/src/_demo/xmake.lua b/xmake/templates/c/tbox.shared/project/src/_demo/xmake.lua deleted file mode 100644 index 4b852d481..000000000 --- a/xmake/templates/c/tbox.shared/project/src/_demo/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -target("demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_defines("__tb_prefix__=\"demo\"") - add_files("*.c") - add_packages("tbox") - diff --git a/xmake/templates/c/tbox.shared/project/src/_library/interface.c b/xmake/templates/c/tbox.shared/project/src/_library/interface.c deleted file mode 100644 index ab0a826a6..000000000 --- a/xmake/templates/c/tbox.shared/project/src/_library/interface.c +++ /dev/null @@ -1,11 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * implementation - */ -tb_int_t add(tb_int_t a, tb_int_t b) { - return a + b; -} diff --git a/xmake/templates/c/tbox.shared/project/src/_library/interface.h b/xmake/templates/c/tbox.shared/project/src/_library/interface.h deleted file mode 100644 index 843ef1c98..000000000 --- a/xmake/templates/c/tbox.shared/project/src/_library/interface.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef INTERFACE_H -#define INTERFACE_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - - __tb_export__ tb_int_t - add(tb_int_t a, tb_int_t b); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua b/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua deleted file mode 100644 index 0c527e2b6..000000000 --- a/xmake/templates/c/tbox.shared/project/src/_library/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("shared") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add the header files for installing - add_headerfiles("../(${TARGETNAME}/**.h)") - - -- add includes directory - add_includedirs("..", {interface = true}) - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.c") - diff --git a/xmake/templates/c/tbox.shared/project/xmake.lua b/xmake/templates/c/tbox.shared/project/xmake.lua deleted file mode 100644 index 1cd6ebc79..000000000 --- a/xmake/templates/c/tbox.shared/project/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") - -${FAQ} diff --git a/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.c b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.c new file mode 100644 index 000000000..ab0a826a6 --- /dev/null +++ b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.c @@ -0,0 +1,11 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * implementation + */ +tb_int_t add(tb_int_t a, tb_int_t b) { + return a + b; +} diff --git a/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.h b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.h new file mode 100644 index 000000000..843ef1c98 --- /dev/null +++ b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/interface.h @@ -0,0 +1,22 @@ +#ifndef INTERFACE_H +#define INTERFACE_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + + __tb_export__ tb_int_t + add(tb_int_t a, tb_int_t b); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/xmake/templates/c/tbox.shared/src/${TARGETNAME}/xmake.lua b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/xmake.lua new file mode 100644 index 000000000..0c527e2b6 --- /dev/null +++ b/xmake/templates/c/tbox.shared/src/${TARGETNAME}/xmake.lua @@ -0,0 +1,21 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("shared") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add the header files for installing + add_headerfiles("../(${TARGETNAME}/**.h)") + + -- add includes directory + add_includedirs("..", {interface = true}) + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.c") + diff --git a/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/main.c b/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/main.c new file mode 100644 index 000000000..b1e763989 --- /dev/null +++ b/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/main.c @@ -0,0 +1,16 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "${TARGETNAME}/interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_trace_i("add(1 + 1) = %d", add(1, 1)); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/xmake.lua b/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/xmake.lua new file mode 100644 index 000000000..4b852d481 --- /dev/null +++ b/xmake/templates/c/tbox.shared/src/${TARGETNAME}_demo/xmake.lua @@ -0,0 +1,7 @@ +target("demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_defines("__tb_prefix__=\"demo\"") + add_files("*.c") + add_packages("tbox") + diff --git a/xmake/templates/c/tbox.shared/template.lua b/xmake/templates/c/tbox.shared/template.lua deleted file mode 100644 index cf21d02a7..000000000 --- a/xmake/templates/c/tbox.shared/template.lua +++ /dev/null @@ -1,9 +0,0 @@ -template("tbox.shared") - add_configfiles("xmake.lua") - add_configfiles("src/_demo/main.c") - add_configfiles("src/_demo/xmake.lua") - add_configfiles("src/_library/xmake.lua") - after_create(function (template, opt) - os.mv("src/_library", path.join("src", opt.targetname)) - os.mv("src/_demo", path.join("src", opt.targetname .. "_demo")) - end) diff --git a/xmake/templates/c/tbox.shared/xmake.lua b/xmake/templates/c/tbox.shared/xmake.lua new file mode 100644 index 000000000..1cd6ebc79 --- /dev/null +++ b/xmake/templates/c/tbox.shared/xmake.lua @@ -0,0 +1,21 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") + +${FAQ} diff --git a/xmake/templates/c/tbox.static/project/src/_demo/main.c b/xmake/templates/c/tbox.static/project/src/_demo/main.c deleted file mode 100644 index b1e763989..000000000 --- a/xmake/templates/c/tbox.static/project/src/_demo/main.c +++ /dev/null @@ -1,16 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "${TARGETNAME}/interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * main - */ -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - if (tb_init(tb_null, tb_null)) { - tb_trace_i("hello tbox!"); - tb_trace_i("add(1 + 1) = %d", add(1, 1)); - tb_exit(); - } - return 0; -} diff --git a/xmake/templates/c/tbox.static/project/src/_demo/xmake.lua b/xmake/templates/c/tbox.static/project/src/_demo/xmake.lua deleted file mode 100644 index 4b852d481..000000000 --- a/xmake/templates/c/tbox.static/project/src/_demo/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -target("demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_defines("__tb_prefix__=\"demo\"") - add_files("*.c") - add_packages("tbox") - diff --git a/xmake/templates/c/tbox.static/project/src/_library/interface.c b/xmake/templates/c/tbox.static/project/src/_library/interface.c deleted file mode 100644 index ab0a826a6..000000000 --- a/xmake/templates/c/tbox.static/project/src/_library/interface.c +++ /dev/null @@ -1,11 +0,0 @@ -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "interface.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * implementation - */ -tb_int_t add(tb_int_t a, tb_int_t b) { - return a + b; -} diff --git a/xmake/templates/c/tbox.static/project/src/_library/interface.h b/xmake/templates/c/tbox.static/project/src/_library/interface.h deleted file mode 100644 index caddb8394..000000000 --- a/xmake/templates/c/tbox.static/project/src/_library/interface.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef INTERFACE_H -#define INTERFACE_H - -/* ////////////////////////////////////////////////////////////////////////////////////// - * includes - */ -#include "tbox/tbox.h" - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_enter__ - - tb_int_t - add(tb_int_t a, tb_int_t b); - -/* ////////////////////////////////////////////////////////////////////////////////////// - * extern - */ -__tb_extern_c_leave__ - -#endif diff --git a/xmake/templates/c/tbox.static/project/src/_library/xmake.lua b/xmake/templates/c/tbox.static/project/src/_library/xmake.lua deleted file mode 100644 index 782c92616..000000000 --- a/xmake/templates/c/tbox.static/project/src/_library/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("static") - - -- add definitions - add_defines("__tb_prefix__=\"${TARGETNAME}\"") - - -- add the header files for installing - add_headerfiles("../(${TARGETNAME}/**.h)") - - -- add includes directory - add_includedirs("..", {interface = true}) - - -- add packages - add_packages("tbox") - - -- add files - add_files("*.c") - diff --git a/xmake/templates/c/tbox.static/project/xmake.lua b/xmake/templates/c/tbox.static/project/xmake.lua deleted file mode 100644 index 1cd6ebc79..000000000 --- a/xmake/templates/c/tbox.static/project/xmake.lua +++ /dev/null @@ -1,21 +0,0 @@ -set_xmakever("2.3.6") -set_warnings("all", "error") -set_languages("c99", "cxx11") -add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") -add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") - -add_rules("mode.release", "mode.debug") -add_requires("tbox", {debug = is_mode("debug")}) - -if is_plat("windows") then - if is_mode("release") then - add_cxflags("-MT") - elseif is_mode("debug") then - add_cxflags("-MTd") - end - add_ldflags("-nodefaultlib:msvcrt.lib") -end - -includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") - -${FAQ} diff --git a/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.c b/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.c new file mode 100644 index 000000000..ab0a826a6 --- /dev/null +++ b/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.c @@ -0,0 +1,11 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * implementation + */ +tb_int_t add(tb_int_t a, tb_int_t b) { + return a + b; +} diff --git a/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.h b/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.h new file mode 100644 index 000000000..caddb8394 --- /dev/null +++ b/xmake/templates/c/tbox.static/src/${TARGETNAME}/interface.h @@ -0,0 +1,22 @@ +#ifndef INTERFACE_H +#define INTERFACE_H + +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "tbox/tbox.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_enter__ + + tb_int_t + add(tb_int_t a, tb_int_t b); + +/* ////////////////////////////////////////////////////////////////////////////////////// + * extern + */ +__tb_extern_c_leave__ + +#endif diff --git a/xmake/templates/c/tbox.static/src/${TARGETNAME}/xmake.lua b/xmake/templates/c/tbox.static/src/${TARGETNAME}/xmake.lua new file mode 100644 index 000000000..782c92616 --- /dev/null +++ b/xmake/templates/c/tbox.static/src/${TARGETNAME}/xmake.lua @@ -0,0 +1,21 @@ +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("static") + + -- add definitions + add_defines("__tb_prefix__=\"${TARGETNAME}\"") + + -- add the header files for installing + add_headerfiles("../(${TARGETNAME}/**.h)") + + -- add includes directory + add_includedirs("..", {interface = true}) + + -- add packages + add_packages("tbox") + + -- add files + add_files("*.c") + diff --git a/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/main.c b/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/main.c new file mode 100644 index 000000000..b1e763989 --- /dev/null +++ b/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/main.c @@ -0,0 +1,16 @@ +/* ////////////////////////////////////////////////////////////////////////////////////// + * includes + */ +#include "${TARGETNAME}/interface.h" + +/* ////////////////////////////////////////////////////////////////////////////////////// + * main + */ +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + if (tb_init(tb_null, tb_null)) { + tb_trace_i("hello tbox!"); + tb_trace_i("add(1 + 1) = %d", add(1, 1)); + tb_exit(); + } + return 0; +} diff --git a/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/xmake.lua b/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/xmake.lua new file mode 100644 index 000000000..4b852d481 --- /dev/null +++ b/xmake/templates/c/tbox.static/src/${TARGETNAME}_demo/xmake.lua @@ -0,0 +1,7 @@ +target("demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_defines("__tb_prefix__=\"demo\"") + add_files("*.c") + add_packages("tbox") + diff --git a/xmake/templates/c/tbox.static/template.lua b/xmake/templates/c/tbox.static/template.lua deleted file mode 100644 index 21c09ec3c..000000000 --- a/xmake/templates/c/tbox.static/template.lua +++ /dev/null @@ -1,9 +0,0 @@ -template("tbox.static") - add_configfiles("xmake.lua") - add_configfiles("src/_demo/main.c") - add_configfiles("src/_demo/xmake.lua") - add_configfiles("src/_library/xmake.lua") - after_create(function (template, opt) - os.mv("src/_library", path.join("src", opt.targetname)) - os.mv("src/_demo", path.join("src", opt.targetname .. "_demo")) - end) diff --git a/xmake/templates/c/tbox.static/xmake.lua b/xmake/templates/c/tbox.static/xmake.lua new file mode 100644 index 000000000..1cd6ebc79 --- /dev/null +++ b/xmake/templates/c/tbox.static/xmake.lua @@ -0,0 +1,21 @@ +set_xmakever("2.3.6") +set_warnings("all", "error") +set_languages("c99", "cxx11") +add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") +add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing") + +add_rules("mode.release", "mode.debug") +add_requires("tbox", {debug = is_mode("debug")}) + +if is_plat("windows") then + if is_mode("release") then + add_cxflags("-MT") + elseif is_mode("debug") then + add_cxflags("-MTd") + end + add_ldflags("-nodefaultlib:msvcrt.lib") +end + +includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo") + +${FAQ} diff --git a/xmake/templates/c/xmake.cli/project/src/lni/main.c b/xmake/templates/c/xmake.cli/project/src/lni/main.c deleted file mode 100644 index a4c6499ee..000000000 --- a/xmake/templates/c/xmake.cli/project/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("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); -} diff --git a/xmake/templates/c/xmake.cli/project/src/lua/main.lua b/xmake/templates/c/xmake.cli/project/src/lua/main.lua deleted file mode 100644 index d87daf102..000000000 --- a/xmake/templates/c/xmake.cli/project/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/project/xmake.lua b/xmake/templates/c/xmake.cli/project/xmake.lua deleted file mode 100644 index 678c5ba3a..000000000 --- a/xmake/templates/c/xmake.cli/project/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("libxmake") - -target("${TARGETNAME}") - add_rules("xmake.cli") - add_files("src/lni/*.c") - add_files("src/lua/*.lua", {rootdir = "src"}) - add_packages("libxmake") - -${FAQ} diff --git a/xmake/templates/c/xmake.cli/src/lni/main.c b/xmake/templates/c/xmake.cli/src/lni/main.c new file mode 100644 index 000000000..a4c6499ee --- /dev/null +++ b/xmake/templates/c/xmake.cli/src/lni/main.c @@ -0,0 +1,21 @@ +#include + +static tb_byte_t const g_luafiles_data[] = { +#include "luafiles.xmz.h" +}; + +static tb_int_t lni_test_hello(lua_State *lua) { + lua_pushliteral(lua, "hello xmake!"); + return 1; +} + +static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { + static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; + xm_engine_register(engine, "test", lni_test_funcs); + xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); +} + +tb_int_t main(tb_int_t argc, tb_char_t **argv) { + tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; + return xm_engine_run("${TARGETNAME}", argc, argv, taskargv, lni_initalizer); +} diff --git a/xmake/templates/c/xmake.cli/src/lua/main.lua b/xmake/templates/c/xmake.cli/src/lua/main.lua new file mode 100644 index 000000000..d87daf102 --- /dev/null +++ b/xmake/templates/c/xmake.cli/src/lua/main.lua @@ -0,0 +1,10 @@ +import("core.base.option") +import("lib.lni.test") + +function main () + print(test.hello()) + local argv = option.get("arguments") + if argv then + print(argv) + end +end diff --git a/xmake/templates/c/xmake.cli/template.lua b/xmake/templates/c/xmake.cli/template.lua deleted file mode 100644 index 45f1135c6..000000000 --- a/xmake/templates/c/xmake.cli/template.lua +++ /dev/null @@ -1,3 +0,0 @@ -template("xmake.cli") - add_configfiles("src/lni/main.c") - add_configfiles("xmake.lua") diff --git a/xmake/templates/c/xmake.cli/xmake.lua b/xmake/templates/c/xmake.cli/xmake.lua new file mode 100644 index 000000000..678c5ba3a --- /dev/null +++ b/xmake/templates/c/xmake.cli/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +add_requires("libxmake") + +target("${TARGETNAME}") + 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/project/src/main.cu b/xmake/templates/cuda/console/project/src/main.cu deleted file mode 100644 index 2fe9ac797..000000000 --- a/xmake/templates/cuda/console/project/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/project/xmake.lua b/xmake/templates/cuda/console/project/xmake.lua deleted file mode 100644 index 5cfdad354..000000000 --- a/xmake/templates/cuda/console/project/xmake.lua +++ /dev/null @@ -1,19 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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/console/src/main.cu b/xmake/templates/cuda/console/src/main.cu new file mode 100644 index 000000000..2fe9ac797 --- /dev/null +++ b/xmake/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/templates/cuda/console/template.lua b/xmake/templates/cuda/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/cuda/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/cuda/console/xmake.lua b/xmake/templates/cuda/console/xmake.lua new file mode 100644 index 000000000..5cfdad354 --- /dev/null +++ b/xmake/templates/cuda/console/xmake.lua @@ -0,0 +1,19 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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 new file mode 100644 index 000000000..5565e3eb5 --- /dev/null +++ b/xmake/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/templates/cuda/shared/project/inc/lib.cuh b/xmake/templates/cuda/shared/project/inc/lib.cuh deleted file mode 100644 index 5565e3eb5..000000000 --- a/xmake/templates/cuda/shared/project/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/project/src/lib.cu b/xmake/templates/cuda/shared/project/src/lib.cu deleted file mode 100644 index d2cff9ac2..000000000 --- a/xmake/templates/cuda/shared/project/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/project/xmake.lua b/xmake/templates/cuda/shared/project/xmake.lua deleted file mode 100644 index 45c27363f..000000000 --- a/xmake/templates/cuda/shared/project/xmake.lua +++ /dev/null @@ -1,20 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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/shared/src/lib.cu b/xmake/templates/cuda/shared/src/lib.cu new file mode 100644 index 000000000..d2cff9ac2 --- /dev/null +++ b/xmake/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/templates/cuda/shared/template.lua b/xmake/templates/cuda/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/cuda/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/cuda/shared/xmake.lua b/xmake/templates/cuda/shared/xmake.lua new file mode 100644 index 000000000..45c27363f --- /dev/null +++ b/xmake/templates/cuda/shared/xmake.lua @@ -0,0 +1,20 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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 new file mode 100644 index 000000000..35255e31e --- /dev/null +++ b/xmake/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/templates/cuda/static/project/inc/lib.cuh b/xmake/templates/cuda/static/project/inc/lib.cuh deleted file mode 100644 index 35255e31e..000000000 --- a/xmake/templates/cuda/static/project/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/project/src/lib.cu b/xmake/templates/cuda/static/project/src/lib.cu deleted file mode 100644 index a5f054354..000000000 --- a/xmake/templates/cuda/static/project/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/project/xmake.lua b/xmake/templates/cuda/static/project/xmake.lua deleted file mode 100644 index 6d84c3b92..000000000 --- a/xmake/templates/cuda/static/project/xmake.lua +++ /dev/null @@ -1,20 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - 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/cuda/static/src/lib.cu b/xmake/templates/cuda/static/src/lib.cu new file mode 100644 index 000000000..a5f054354 --- /dev/null +++ b/xmake/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/templates/cuda/static/template.lua b/xmake/templates/cuda/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/cuda/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/cuda/static/xmake.lua b/xmake/templates/cuda/static/xmake.lua new file mode 100644 index 000000000..6d84c3b92 --- /dev/null +++ b/xmake/templates/cuda/static/xmake.lua @@ -0,0 +1,20 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + 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/project/src/main.d b/xmake/templates/dlang/console/project/src/main.d deleted file mode 100644 index 6bea6ec02..000000000 --- a/xmake/templates/dlang/console/project/src/main.d +++ /dev/null @@ -1,5 +0,0 @@ -import std.stdio; - -void main() { - writeln("hello world!"); -} diff --git a/xmake/templates/dlang/console/project/xmake.lua b/xmake/templates/dlang/console/project/xmake.lua deleted file mode 100644 index 86ace289d..000000000 --- a/xmake/templates/dlang/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.d") - -${FAQ} diff --git a/xmake/templates/dlang/console/src/main.d b/xmake/templates/dlang/console/src/main.d new file mode 100644 index 000000000..6bea6ec02 --- /dev/null +++ b/xmake/templates/dlang/console/src/main.d @@ -0,0 +1,5 @@ +import std.stdio; + +void main() { + writeln("hello world!"); +} diff --git a/xmake/templates/dlang/console/template.lua b/xmake/templates/dlang/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/dlang/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/dlang/console/xmake.lua b/xmake/templates/dlang/console/xmake.lua new file mode 100644 index 000000000..86ace289d --- /dev/null +++ b/xmake/templates/dlang/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.d") + +${FAQ} diff --git a/xmake/templates/dlang/shared/project/src/interfaces.d b/xmake/templates/dlang/shared/project/src/interfaces.d deleted file mode 100644 index b4f7ab6ba..000000000 --- a/xmake/templates/dlang/shared/project/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/project/src/main.d b/xmake/templates/dlang/shared/project/src/main.d deleted file mode 100644 index bfcf9cf56..000000000 --- a/xmake/templates/dlang/shared/project/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/project/xmake.lua b/xmake/templates/dlang/shared/project/xmake.lua deleted file mode 100644 index b9cc7cb8f..000000000 --- a/xmake/templates/dlang/shared/project/xmake.lua +++ /dev/null @@ -1,16 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("shared") - add_files("src/interfaces.d") - add_includedirs("src", {public = true}) - add_rules("utils.symbols.export_list", {symbols = { - "add", - "sub"}}) - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.d") - -${FAQ} diff --git a/xmake/templates/dlang/shared/src/interfaces.d b/xmake/templates/dlang/shared/src/interfaces.d new file mode 100644 index 000000000..b4f7ab6ba --- /dev/null +++ b/xmake/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/templates/dlang/shared/src/main.d b/xmake/templates/dlang/shared/src/main.d new file mode 100644 index 000000000..bfcf9cf56 --- /dev/null +++ b/xmake/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/templates/dlang/shared/template.lua b/xmake/templates/dlang/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/dlang/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/dlang/shared/xmake.lua b/xmake/templates/dlang/shared/xmake.lua new file mode 100644 index 000000000..b9cc7cb8f --- /dev/null +++ b/xmake/templates/dlang/shared/xmake.lua @@ -0,0 +1,16 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("shared") + add_files("src/interfaces.d") + add_includedirs("src", {public = true}) + add_rules("utils.symbols.export_list", {symbols = { + "add", + "sub"}}) + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.d") + +${FAQ} diff --git a/xmake/templates/dlang/static/project/src/interfaces.d b/xmake/templates/dlang/static/project/src/interfaces.d deleted file mode 100644 index 3386c9124..000000000 --- a/xmake/templates/dlang/static/project/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/project/src/main.d b/xmake/templates/dlang/static/project/src/main.d deleted file mode 100644 index bfcf9cf56..000000000 --- a/xmake/templates/dlang/static/project/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/project/xmake.lua b/xmake/templates/dlang/static/project/xmake.lua deleted file mode 100644 index ba4d99e77..000000000 --- a/xmake/templates/dlang/static/project/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("static") - add_files("src/interfaces.d") - add_includedirs("src", {public = true}) - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.d") - -${FAQ} diff --git a/xmake/templates/dlang/static/src/interfaces.d b/xmake/templates/dlang/static/src/interfaces.d new file mode 100644 index 000000000..3386c9124 --- /dev/null +++ b/xmake/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/templates/dlang/static/src/main.d b/xmake/templates/dlang/static/src/main.d new file mode 100644 index 000000000..bfcf9cf56 --- /dev/null +++ b/xmake/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/templates/dlang/static/template.lua b/xmake/templates/dlang/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/dlang/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/dlang/static/xmake.lua b/xmake/templates/dlang/static/xmake.lua new file mode 100644 index 000000000..ba4d99e77 --- /dev/null +++ b/xmake/templates/dlang/static/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("static") + add_files("src/interfaces.d") + add_includedirs("src", {public = true}) + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.d") + +${FAQ} diff --git a/xmake/templates/fortran/console/project/src/main.f90 b/xmake/templates/fortran/console/project/src/main.f90 deleted file mode 100644 index a332e8401..000000000 --- a/xmake/templates/fortran/console/project/src/main.f90 +++ /dev/null @@ -1,3 +0,0 @@ -program hello - print *, "Hello World!" -end program hello diff --git a/xmake/templates/fortran/console/project/xmake.lua b/xmake/templates/fortran/console/project/xmake.lua deleted file mode 100644 index b12d74cce..000000000 --- a/xmake/templates/fortran/console/project/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.f90") - diff --git a/xmake/templates/fortran/console/src/main.f90 b/xmake/templates/fortran/console/src/main.f90 new file mode 100644 index 000000000..a332e8401 --- /dev/null +++ b/xmake/templates/fortran/console/src/main.f90 @@ -0,0 +1,3 @@ +program hello + print *, "Hello World!" +end program hello diff --git a/xmake/templates/fortran/console/template.lua b/xmake/templates/fortran/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/fortran/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/fortran/console/xmake.lua b/xmake/templates/fortran/console/xmake.lua new file mode 100644 index 000000000..b12d74cce --- /dev/null +++ b/xmake/templates/fortran/console/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.f90") + diff --git a/xmake/templates/fortran/shared/project/src/main.f90 b/xmake/templates/fortran/shared/project/src/main.f90 deleted file mode 100644 index 9adea3e26..000000000 --- a/xmake/templates/fortran/shared/project/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/project/src/test.f90 b/xmake/templates/fortran/shared/project/src/test.f90 deleted file mode 100644 index 7b215fcdf..000000000 --- a/xmake/templates/fortran/shared/project/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/project/xmake.lua b/xmake/templates/fortran/shared/project/xmake.lua deleted file mode 100644 index 04bf17567..000000000 --- a/xmake/templates/fortran/shared/project/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}_lib") - set_kind("shared") - add_files("src/test.f90") - -target("${TARGETNAME}") - set_kind("binary") - add_deps("${TARGETNAME}_lib") - add_files("src/main.f90") - diff --git a/xmake/templates/fortran/shared/src/main.f90 b/xmake/templates/fortran/shared/src/main.f90 new file mode 100644 index 000000000..9adea3e26 --- /dev/null +++ b/xmake/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/templates/fortran/shared/src/test.f90 b/xmake/templates/fortran/shared/src/test.f90 new file mode 100644 index 000000000..7b215fcdf --- /dev/null +++ b/xmake/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/templates/fortran/shared/template.lua b/xmake/templates/fortran/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/fortran/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/fortran/shared/xmake.lua b/xmake/templates/fortran/shared/xmake.lua new file mode 100644 index 000000000..04bf17567 --- /dev/null +++ b/xmake/templates/fortran/shared/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}_lib") + set_kind("shared") + add_files("src/test.f90") + +target("${TARGETNAME}") + set_kind("binary") + add_deps("${TARGETNAME}_lib") + add_files("src/main.f90") + diff --git a/xmake/templates/fortran/static/project/src/main.f90 b/xmake/templates/fortran/static/project/src/main.f90 deleted file mode 100644 index 9adea3e26..000000000 --- a/xmake/templates/fortran/static/project/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/project/src/test.f90 b/xmake/templates/fortran/static/project/src/test.f90 deleted file mode 100644 index 7b215fcdf..000000000 --- a/xmake/templates/fortran/static/project/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/project/xmake.lua b/xmake/templates/fortran/static/project/xmake.lua deleted file mode 100644 index 694c1d390..000000000 --- a/xmake/templates/fortran/static/project/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}_lib") - set_kind("static") - add_files("src/test.f90") - -target("${TARGETNAME}") - set_kind("binary") - add_deps("${TARGETNAME}_lib") - add_files("src/main.f90") - diff --git a/xmake/templates/fortran/static/src/main.f90 b/xmake/templates/fortran/static/src/main.f90 new file mode 100644 index 000000000..9adea3e26 --- /dev/null +++ b/xmake/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/templates/fortran/static/src/test.f90 b/xmake/templates/fortran/static/src/test.f90 new file mode 100644 index 000000000..7b215fcdf --- /dev/null +++ b/xmake/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/templates/fortran/static/template.lua b/xmake/templates/fortran/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/fortran/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/fortran/static/xmake.lua b/xmake/templates/fortran/static/xmake.lua new file mode 100644 index 000000000..694c1d390 --- /dev/null +++ b/xmake/templates/fortran/static/xmake.lua @@ -0,0 +1,11 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}_lib") + set_kind("static") + add_files("src/test.f90") + +target("${TARGETNAME}") + set_kind("binary") + add_deps("${TARGETNAME}_lib") + add_files("src/main.f90") + diff --git a/xmake/templates/go/console/project/src/main.go b/xmake/templates/go/console/project/src/main.go deleted file mode 100644 index b689db480..000000000 --- a/xmake/templates/go/console/project/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/project/xmake.lua b/xmake/templates/go/console/project/xmake.lua deleted file mode 100644 index 09355a74b..000000000 --- a/xmake/templates/go/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.go") - -${FAQ} diff --git a/xmake/templates/go/console/src/main.go b/xmake/templates/go/console/src/main.go new file mode 100644 index 000000000..b689db480 --- /dev/null +++ b/xmake/templates/go/console/src/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("hello xmake!") +} diff --git a/xmake/templates/go/console/template.lua b/xmake/templates/go/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/go/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/go/console/xmake.lua b/xmake/templates/go/console/xmake.lua new file mode 100644 index 000000000..09355a74b --- /dev/null +++ b/xmake/templates/go/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.go") + +${FAQ} diff --git a/xmake/templates/go/static/project/src/main.go b/xmake/templates/go/static/project/src/main.go deleted file mode 100644 index f2b477453..000000000 --- a/xmake/templates/go/static/project/src/main.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -func main() { - - Run() -} - diff --git a/xmake/templates/go/static/project/src/module/add.go b/xmake/templates/go/static/project/src/module/add.go deleted file mode 100644 index 98ffef600..000000000 --- a/xmake/templates/go/static/project/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/project/src/module/sub.go b/xmake/templates/go/static/project/src/module/sub.go deleted file mode 100644 index a24a9abb7..000000000 --- a/xmake/templates/go/static/project/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/project/src/test.go b/xmake/templates/go/static/project/src/test.go deleted file mode 100644 index cf10523f9..000000000 --- a/xmake/templates/go/static/project/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/project/xmake.lua b/xmake/templates/go/static/project/xmake.lua deleted file mode 100644 index 076ac6460..000000000 --- a/xmake/templates/go/static/project/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("${TARGETNAME}_demo") - set_kind("binary") - add_deps("module") - add_files("src/*.go") - -${FAQ} diff --git a/xmake/templates/go/static/src/main.go b/xmake/templates/go/static/src/main.go new file mode 100644 index 000000000..f2b477453 --- /dev/null +++ b/xmake/templates/go/static/src/main.go @@ -0,0 +1,7 @@ +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 new file mode 100644 index 000000000..98ffef600 --- /dev/null +++ b/xmake/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/templates/go/static/src/module/sub.go b/xmake/templates/go/static/src/module/sub.go new file mode 100644 index 000000000..a24a9abb7 --- /dev/null +++ b/xmake/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/templates/go/static/src/test.go b/xmake/templates/go/static/src/test.go new file mode 100644 index 000000000..cf10523f9 --- /dev/null +++ b/xmake/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/templates/go/static/template.lua b/xmake/templates/go/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/go/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/go/static/xmake.lua b/xmake/templates/go/static/xmake.lua new file mode 100644 index 000000000..076ac6460 --- /dev/null +++ b/xmake/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("${TARGETNAME}_demo") + set_kind("binary") + add_deps("module") + add_files("src/*.go") + +${FAQ} diff --git a/xmake/templates/kotlin/console/project/src/main.kt b/xmake/templates/kotlin/console/project/src/main.kt deleted file mode 100644 index 543f5ac8f..000000000 --- a/xmake/templates/kotlin/console/project/src/main.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("hello xmake!") -} diff --git a/xmake/templates/kotlin/console/project/xmake.lua b/xmake/templates/kotlin/console/project/xmake.lua deleted file mode 100644 index 2689995b1..000000000 --- a/xmake/templates/kotlin/console/project/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("kotlin-native") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/main.kt") - set_toolchains("@kotlin-native") - -${FAQ} diff --git a/xmake/templates/kotlin/console/src/main.kt b/xmake/templates/kotlin/console/src/main.kt new file mode 100644 index 000000000..543f5ac8f --- /dev/null +++ b/xmake/templates/kotlin/console/src/main.kt @@ -0,0 +1,3 @@ +fun main() { + println("hello xmake!") +} diff --git a/xmake/templates/kotlin/console/template.lua b/xmake/templates/kotlin/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/kotlin/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/kotlin/console/xmake.lua b/xmake/templates/kotlin/console/xmake.lua new file mode 100644 index 000000000..2689995b1 --- /dev/null +++ b/xmake/templates/kotlin/console/xmake.lua @@ -0,0 +1,10 @@ +add_rules("mode.debug", "mode.release") + +add_requires("kotlin-native") + +target("${TARGETNAME}") + 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 new file mode 100644 index 000000000..cc5184bd7 --- /dev/null +++ b/xmake/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/templates/kotlin/shared/src/main.c b/xmake/templates/kotlin/shared/src/main.c new file mode 100644 index 000000000..abb3f2c12 --- /dev/null +++ b/xmake/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/templates/kotlin/shared/xmake.lua b/xmake/templates/kotlin/shared/xmake.lua new file mode 100644 index 000000000..491a8f835 --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_files("src/main.c") + add_deps("foo") + +${FAQ} diff --git a/xmake/templates/kotlin/shared_library/project/src/foo.kt b/xmake/templates/kotlin/shared_library/project/src/foo.kt deleted file mode 100644 index cc5184bd7..000000000 --- a/xmake/templates/kotlin/shared_library/project/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_library/project/src/main.c b/xmake/templates/kotlin/shared_library/project/src/main.c deleted file mode 100644 index abb3f2c12..000000000 --- a/xmake/templates/kotlin/shared_library/project/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_library/project/xmake.lua b/xmake/templates/kotlin/shared_library/project/xmake.lua deleted file mode 100644 index 491a8f835..000000000 --- a/xmake/templates/kotlin/shared_library/project/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("${TARGETNAME}") - set_kind("binary") - add_files("src/main.c") - add_deps("foo") - -${FAQ} diff --git a/xmake/templates/kotlin/shared_library/template.lua b/xmake/templates/kotlin/shared_library/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/kotlin/shared_library/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/kotlin/static/src/foo.kt b/xmake/templates/kotlin/static/src/foo.kt new file mode 100644 index 000000000..cc5184bd7 --- /dev/null +++ b/xmake/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/templates/kotlin/static/src/main.c b/xmake/templates/kotlin/static/src/main.c new file mode 100644 index 000000000..abb3f2c12 --- /dev/null +++ b/xmake/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/templates/kotlin/static/xmake.lua b/xmake/templates/kotlin/static/xmake.lua new file mode 100644 index 000000000..2667c26fd --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_files("src/main.c") + add_deps("foo") + +${FAQ} diff --git a/xmake/templates/kotlin/static_library/project/src/foo.kt b/xmake/templates/kotlin/static_library/project/src/foo.kt deleted file mode 100644 index cc5184bd7..000000000 --- a/xmake/templates/kotlin/static_library/project/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_library/project/src/main.c b/xmake/templates/kotlin/static_library/project/src/main.c deleted file mode 100644 index abb3f2c12..000000000 --- a/xmake/templates/kotlin/static_library/project/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_library/project/xmake.lua b/xmake/templates/kotlin/static_library/project/xmake.lua deleted file mode 100644 index 2667c26fd..000000000 --- a/xmake/templates/kotlin/static_library/project/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("${TARGETNAME}") - set_kind("binary") - add_files("src/main.c") - add_deps("foo") - -${FAQ} diff --git a/xmake/templates/kotlin/static_library/template.lua b/xmake/templates/kotlin/static_library/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/kotlin/static_library/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/nim/console/project/src/main.nim b/xmake/templates/nim/console/project/src/main.nim deleted file mode 100644 index 17179284f..000000000 --- a/xmake/templates/nim/console/project/src/main.nim +++ /dev/null @@ -1 +0,0 @@ -echo "hello xmake!" diff --git a/xmake/templates/nim/console/project/xmake.lua b/xmake/templates/nim/console/project/xmake.lua deleted file mode 100644 index f41148c2f..000000000 --- a/xmake/templates/nim/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/main.nim") - -${FAQ} diff --git a/xmake/templates/nim/console/src/main.nim b/xmake/templates/nim/console/src/main.nim new file mode 100644 index 000000000..17179284f --- /dev/null +++ b/xmake/templates/nim/console/src/main.nim @@ -0,0 +1 @@ +echo "hello xmake!" diff --git a/xmake/templates/nim/console/template.lua b/xmake/templates/nim/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/nim/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/nim/console/xmake.lua b/xmake/templates/nim/console/xmake.lua new file mode 100644 index 000000000..f41148c2f --- /dev/null +++ b/xmake/templates/nim/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/main.nim") + +${FAQ} diff --git a/xmake/templates/nim/shared/project/src/foo.nim b/xmake/templates/nim/shared/project/src/foo.nim deleted file mode 100644 index cde4de7ca..000000000 --- a/xmake/templates/nim/shared/project/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/project/src/main.nim b/xmake/templates/nim/shared/project/src/main.nim deleted file mode 100644 index 1be3abe69..000000000 --- a/xmake/templates/nim/shared/project/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/project/xmake.lua b/xmake/templates/nim/shared/project/xmake.lua deleted file mode 100644 index e2d380ac6..000000000 --- a/xmake/templates/nim/shared/project/xmake.lua +++ /dev/null @@ -1,14 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("shared") - add_files("src/foo.nim") - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.nim") - -${FAQ} - - diff --git a/xmake/templates/nim/shared/src/foo.nim b/xmake/templates/nim/shared/src/foo.nim new file mode 100644 index 000000000..cde4de7ca --- /dev/null +++ b/xmake/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/templates/nim/shared/src/main.nim b/xmake/templates/nim/shared/src/main.nim new file mode 100644 index 000000000..1be3abe69 --- /dev/null +++ b/xmake/templates/nim/shared/src/main.nim @@ -0,0 +1,3 @@ +proc foo(n: int): int {.cdecl, importc} + +echo foo(2) diff --git a/xmake/templates/nim/shared/template.lua b/xmake/templates/nim/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/nim/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/nim/shared/xmake.lua b/xmake/templates/nim/shared/xmake.lua new file mode 100644 index 000000000..e2d380ac6 --- /dev/null +++ b/xmake/templates/nim/shared/xmake.lua @@ -0,0 +1,14 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("shared") + add_files("src/foo.nim") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.nim") + +${FAQ} + + diff --git a/xmake/templates/nim/static/project/src/foo.nim b/xmake/templates/nim/static/project/src/foo.nim deleted file mode 100644 index be0904262..000000000 --- a/xmake/templates/nim/static/project/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/project/src/main.nim b/xmake/templates/nim/static/project/src/main.nim deleted file mode 100644 index 1be3abe69..000000000 --- a/xmake/templates/nim/static/project/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/project/xmake.lua b/xmake/templates/nim/static/project/xmake.lua deleted file mode 100644 index cf70acb9e..000000000 --- a/xmake/templates/nim/static/project/xmake.lua +++ /dev/null @@ -1,14 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("static") - add_files("src/foo.nim") - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.nim") - -${FAQ} - - diff --git a/xmake/templates/nim/static/src/foo.nim b/xmake/templates/nim/static/src/foo.nim new file mode 100644 index 000000000..be0904262 --- /dev/null +++ b/xmake/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/templates/nim/static/src/main.nim b/xmake/templates/nim/static/src/main.nim new file mode 100644 index 000000000..1be3abe69 --- /dev/null +++ b/xmake/templates/nim/static/src/main.nim @@ -0,0 +1,3 @@ +proc foo(n: int): int {.cdecl, importc} + +echo foo(2) diff --git a/xmake/templates/nim/static/template.lua b/xmake/templates/nim/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/nim/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/nim/static/xmake.lua b/xmake/templates/nim/static/xmake.lua new file mode 100644 index 000000000..cf70acb9e --- /dev/null +++ b/xmake/templates/nim/static/xmake.lua @@ -0,0 +1,14 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("static") + add_files("src/foo.nim") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.nim") + +${FAQ} + + diff --git a/xmake/templates/objc++/bundle/project/src/Info.plist b/xmake/templates/objc++/bundle/project/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc++/bundle/project/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++/bundle/project/src/test.h b/xmake/templates/objc++/bundle/project/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc++/bundle/project/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/bundle/project/src/test.mm b/xmake/templates/objc++/bundle/project/src/test.mm deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc++/bundle/project/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++/bundle/project/xmake.lua b/xmake/templates/objc++/bundle/project/xmake.lua deleted file mode 100644 index 364e27278..000000000 --- a/xmake/templates/objc++/bundle/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.bundle") - add_files("src/*.mm") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc++/bundle/template.lua b/xmake/templates/objc++/bundle/template.lua deleted file mode 100644 index 1f491c498..000000000 --- a/xmake/templates/objc++/bundle/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.bundle") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc++/console/project/src/main.mm b/xmake/templates/objc++/console/project/src/main.mm deleted file mode 100644 index cbd1e8906..000000000 --- a/xmake/templates/objc++/console/project/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/project/xmake.lua b/xmake/templates/objc++/console/project/xmake.lua deleted file mode 100644 index f99120596..000000000 --- a/xmake/templates/objc++/console/project/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.mm") - -${FAQ} diff --git a/xmake/templates/objc++/console/src/main.mm b/xmake/templates/objc++/console/src/main.mm new file mode 100644 index 000000000..cbd1e8906 --- /dev/null +++ b/xmake/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/templates/objc++/console/template.lua b/xmake/templates/objc++/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/objc++/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc++/console/xmake.lua b/xmake/templates/objc++/console/xmake.lua new file mode 100644 index 000000000..f99120596 --- /dev/null +++ b/xmake/templates/objc++/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.mm") + +${FAQ} diff --git a/xmake/templates/objc++/framework/project/src/Info.plist b/xmake/templates/objc++/framework/project/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc++/framework/project/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++/framework/project/src/test.h b/xmake/templates/objc++/framework/project/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc++/framework/project/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/framework/project/src/test.mm b/xmake/templates/objc++/framework/project/src/test.mm deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc++/framework/project/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++/framework/project/xmake.lua b/xmake/templates/objc++/framework/project/xmake.lua deleted file mode 100644 index db61439df..000000000 --- a/xmake/templates/objc++/framework/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.framework") - add_files("src/*.mm") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc++/framework/template.lua b/xmake/templates/objc++/framework/template.lua deleted file mode 100644 index ae446df55..000000000 --- a/xmake/templates/objc++/framework/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.framework") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc++/xcode.bundle/src/Info.plist b/xmake/templates/objc++/xcode.bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode.bundle/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/xcode.bundle/src/test.h b/xmake/templates/objc++/xcode.bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode.bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode.bundle/src/test.mm b/xmake/templates/objc++/xcode.bundle/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode.bundle/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode.bundle/xmake.lua b/xmake/templates/objc++/xcode.bundle/xmake.lua new file mode 100644 index 000000000..364e27278 --- /dev/null +++ b/xmake/templates/objc++/xcode.bundle/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.bundle") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc++/xcode.framework/src/Info.plist b/xmake/templates/objc++/xcode.framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc++/xcode.framework/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc++/xcode.framework/src/test.h b/xmake/templates/objc++/xcode.framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc++/xcode.framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc++/xcode.framework/src/test.mm b/xmake/templates/objc++/xcode.framework/src/test.mm new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc++/xcode.framework/src/test.mm @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc++/xcode.framework/xmake.lua b/xmake/templates/objc++/xcode.framework/xmake.lua new file mode 100644 index 000000000..db61439df --- /dev/null +++ b/xmake/templates/objc++/xcode.framework/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.framework") + add_files("src/*.mm") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/bundle/project/src/Info.plist b/xmake/templates/objc/bundle/project/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/bundle/project/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/bundle/project/src/test.h b/xmake/templates/objc/bundle/project/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/bundle/project/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/bundle/project/src/test.m b/xmake/templates/objc/bundle/project/src/test.m deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc/bundle/project/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/bundle/project/xmake.lua b/xmake/templates/objc/bundle/project/xmake.lua deleted file mode 100644 index 088994340..000000000 --- a/xmake/templates/objc/bundle/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.bundle") - add_files("src/*.m") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc/bundle/template.lua b/xmake/templates/objc/bundle/template.lua deleted file mode 100644 index 1f491c498..000000000 --- a/xmake/templates/objc/bundle/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.bundle") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/console/project/src/main.m b/xmake/templates/objc/console/project/src/main.m deleted file mode 100644 index cbd1e8906..000000000 --- a/xmake/templates/objc/console/project/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/project/xmake.lua b/xmake/templates/objc/console/project/xmake.lua deleted file mode 100644 index 75496210f..000000000 --- a/xmake/templates/objc/console/project/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.m") - -${FAQ} diff --git a/xmake/templates/objc/console/src/main.m b/xmake/templates/objc/console/src/main.m new file mode 100644 index 000000000..cbd1e8906 --- /dev/null +++ b/xmake/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/templates/objc/console/template.lua b/xmake/templates/objc/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/objc/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/console/xmake.lua b/xmake/templates/objc/console/xmake.lua new file mode 100644 index 000000000..75496210f --- /dev/null +++ b/xmake/templates/objc/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.m") + +${FAQ} diff --git a/xmake/templates/objc/framework/project/src/Info.plist b/xmake/templates/objc/framework/project/src/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/framework/project/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/framework/project/src/test.h b/xmake/templates/objc/framework/project/src/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/framework/project/src/test.h +++ /dev/null @@ -1,3 +0,0 @@ -#import - -FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/framework/project/src/test.m b/xmake/templates/objc/framework/project/src/test.m deleted file mode 100644 index 20e29bd0a..000000000 --- a/xmake/templates/objc/framework/project/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/framework/project/xmake.lua b/xmake/templates/objc/framework/project/xmake.lua deleted file mode 100644 index ad8e30290..000000000 --- a/xmake/templates/objc/framework/project/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.framework") - add_files("src/*.m") - add_files("src/Info.plist") - add_headerfiles("src/*.h") - -${FAQ} diff --git a/xmake/templates/objc/framework/template.lua b/xmake/templates/objc/framework/template.lua deleted file mode 100644 index ae446df55..000000000 --- a/xmake/templates/objc/framework/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.framework") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/iosapp/project/src/AppDelegate.h b/xmake/templates/objc/iosapp/project/src/AppDelegate.h deleted file mode 100644 index b01a8dc72..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/AppDelegate.m b/xmake/templates/objc/iosapp/project/src/AppDelegate.m deleted file mode 100644 index 0ad500bfe..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65f..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/Assets.xcassets/Contents.json b/xmake/templates/objc/iosapp/project/src/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329f..000000000 --- a/xmake/templates/objc/iosapp/project/src/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard b/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard deleted file mode 100644 index 808a21ce7..000000000 --- a/xmake/templates/objc/iosapp/project/src/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/iosapp/project/src/Info.plist b/xmake/templates/objc/iosapp/project/src/Info.plist deleted file mode 100644 index 686d21a3a..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/SceneDelegate.h b/xmake/templates/objc/iosapp/project/src/SceneDelegate.h deleted file mode 100644 index 5dbf88aa6..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/SceneDelegate.m b/xmake/templates/objc/iosapp/project/src/SceneDelegate.m deleted file mode 100644 index d6698dd7c..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/ViewController.h b/xmake/templates/objc/iosapp/project/src/ViewController.h deleted file mode 100644 index e74d2f236..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/ViewController.m b/xmake/templates/objc/iosapp/project/src/ViewController.m deleted file mode 100644 index c3441c87a..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/src/main.m b/xmake/templates/objc/iosapp/project/src/main.m deleted file mode 100644 index 11a58afc7..000000000 --- a/xmake/templates/objc/iosapp/project/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/iosapp/project/xmake.lua b/xmake/templates/objc/iosapp/project/xmake.lua deleted file mode 100644 index b5b00b81f..000000000 --- a/xmake/templates/objc/iosapp/project/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.application") - add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") - add_files("src/Info.plist") diff --git a/xmake/templates/objc/iosapp/template.lua b/xmake/templates/objc/iosapp/template.lua deleted file mode 100644 index 9355dc661..000000000 --- a/xmake/templates/objc/iosapp/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.iosapp") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/iosapp_with_framework/project/src/app/AppDelegate.h b/xmake/templates/objc/iosapp_with_framework/project/src/app/AppDelegate.h deleted file mode 100644 index b01a8dc72..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/AppDelegate.m b/xmake/templates/objc/iosapp_with_framework/project/src/app/AppDelegate.m deleted file mode 100644 index 1f3556c06..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/iosapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65f..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/iosapp_with_framework/project/src/app/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index 865e9329f..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/Main.storyboard deleted file mode 100644 index 808a21ce7..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/src/app/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xmake/templates/objc/iosapp_with_framework/project/src/app/Info.plist b/xmake/templates/objc/iosapp_with_framework/project/src/app/Info.plist deleted file mode 100644 index 686d21a3a..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/SceneDelegate.h b/xmake/templates/objc/iosapp_with_framework/project/src/app/SceneDelegate.h deleted file mode 100644 index 5dbf88aa6..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/SceneDelegate.m b/xmake/templates/objc/iosapp_with_framework/project/src/app/SceneDelegate.m deleted file mode 100644 index d6698dd7c..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/ViewController.h b/xmake/templates/objc/iosapp_with_framework/project/src/app/ViewController.h deleted file mode 100644 index e74d2f236..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/ViewController.m b/xmake/templates/objc/iosapp_with_framework/project/src/app/ViewController.m deleted file mode 100644 index c3441c87a..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/app/main.m b/xmake/templates/objc/iosapp_with_framework/project/src/app/main.m deleted file mode 100644 index 11a58afc7..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/framework/Info.plist b/xmake/templates/objc/iosapp_with_framework/project/src/framework/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/framework/test.h b/xmake/templates/objc/iosapp_with_framework/project/src/framework/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/src/framework/test.m b/xmake/templates/objc/iosapp_with_framework/project/src/framework/test.m deleted file mode 100644 index 71214544b..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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/iosapp_with_framework/project/xmake.lua b/xmake/templates/objc/iosapp_with_framework/project/xmake.lua deleted file mode 100644 index 89348a3b6..000000000 --- a/xmake/templates/objc/iosapp_with_framework/project/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("${TARGETNAME}") - 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/iosapp_with_framework/template.lua b/xmake/templates/objc/iosapp_with_framework/template.lua deleted file mode 100644 index b2ef37185..000000000 --- a/xmake/templates/objc/iosapp_with_framework/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.iosapp_with_framework") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/macapp/project/src/AppDelegate.h b/xmake/templates/objc/macapp/project/src/AppDelegate.h deleted file mode 100644 index 5f5ba059e..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/AppDelegate.m b/xmake/templates/objc/macapp/project/src/AppDelegate.m deleted file mode 100644 index da967d2ef..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/macapp/project/src/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 2db2b1c7c..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/Assets.xcassets/Contents.json b/xmake/templates/objc/macapp/project/src/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/Base.lproj/Main.storyboard b/xmake/templates/objc/macapp/project/src/Base.lproj/Main.storyboard deleted file mode 100644 index 7a6d659a5..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/Info.plist b/xmake/templates/objc/macapp/project/src/Info.plist deleted file mode 100644 index ce53d780c..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/ViewController.h b/xmake/templates/objc/macapp/project/src/ViewController.h deleted file mode 100644 index a974fc934..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/ViewController.m b/xmake/templates/objc/macapp/project/src/ViewController.m deleted file mode 100644 index bccdf6189..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/main.m b/xmake/templates/objc/macapp/project/src/main.m deleted file mode 100644 index ae3706f51..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/src/test.entitlements b/xmake/templates/objc/macapp/project/src/test.entitlements deleted file mode 100644 index f2ef3ae02..000000000 --- a/xmake/templates/objc/macapp/project/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/macapp/project/xmake.lua b/xmake/templates/objc/macapp/project/xmake.lua deleted file mode 100644 index b5b00b81f..000000000 --- a/xmake/templates/objc/macapp/project/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - add_rules("xcode.application") - add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") - add_files("src/Info.plist") diff --git a/xmake/templates/objc/macapp/template.lua b/xmake/templates/objc/macapp/template.lua deleted file mode 100644 index 1c9e67542..000000000 --- a/xmake/templates/objc/macapp/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.macapp") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/macapp_with_framework/project/src/app/AppDelegate.h b/xmake/templates/objc/macapp_with_framework/project/src/app/AppDelegate.h deleted file mode 100644 index 5f5ba059e..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/AppDelegate.m b/xmake/templates/objc/macapp_with_framework/project/src/app/AppDelegate.m deleted file mode 100644 index 667420c8c..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/macapp_with_framework/project/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 2db2b1c7c..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/macapp_with_framework/project/src/app/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c9..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/macapp_with_framework/project/src/app/Base.lproj/Main.storyboard deleted file mode 100644 index 7a6d659a5..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/Info.plist b/xmake/templates/objc/macapp_with_framework/project/src/app/Info.plist deleted file mode 100644 index ce53d780c..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/ViewController.h b/xmake/templates/objc/macapp_with_framework/project/src/app/ViewController.h deleted file mode 100644 index a974fc934..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/ViewController.m b/xmake/templates/objc/macapp_with_framework/project/src/app/ViewController.m deleted file mode 100644 index bccdf6189..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/main.m b/xmake/templates/objc/macapp_with_framework/project/src/app/main.m deleted file mode 100644 index ae3706f51..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/app/test.entitlements b/xmake/templates/objc/macapp_with_framework/project/src/app/test.entitlements deleted file mode 100644 index f2ef3ae02..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/framework/Info.plist b/xmake/templates/objc/macapp_with_framework/project/src/framework/Info.plist deleted file mode 100644 index 20608314e..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/framework/test.h b/xmake/templates/objc/macapp_with_framework/project/src/framework/test.h deleted file mode 100644 index d882546d1..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/src/framework/test.m b/xmake/templates/objc/macapp_with_framework/project/src/framework/test.m deleted file mode 100644 index 71214544b..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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/macapp_with_framework/project/xmake.lua b/xmake/templates/objc/macapp_with_framework/project/xmake.lua deleted file mode 100644 index 89348a3b6..000000000 --- a/xmake/templates/objc/macapp_with_framework/project/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("${TARGETNAME}") - 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/macapp_with_framework/template.lua b/xmake/templates/objc/macapp_with_framework/template.lua deleted file mode 100644 index f8438f565..000000000 --- a/xmake/templates/objc/macapp_with_framework/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("xcode.macapp_with_framework") - add_configfiles("xmake.lua") diff --git a/xmake/templates/objc/xcode.bundle/src/Info.plist b/xmake/templates/objc/xcode.bundle/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode.bundle/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode.bundle/src/test.h b/xmake/templates/objc/xcode.bundle/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode.bundle/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.bundle/src/test.m b/xmake/templates/objc/xcode.bundle/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc/xcode.bundle/src/test.m @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc/xcode.bundle/xmake.lua b/xmake/templates/objc/xcode.bundle/xmake.lua new file mode 100644 index 000000000..088994340 --- /dev/null +++ b/xmake/templates/objc/xcode.bundle/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.bundle") + add_files("src/*.m") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/xcode.framework/src/Info.plist b/xmake/templates/objc/xcode.framework/src/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode.framework/src/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode.framework/src/test.h b/xmake/templates/objc/xcode.framework/src/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode.framework/src/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.framework/src/test.m b/xmake/templates/objc/xcode.framework/src/test.m new file mode 100644 index 000000000..20e29bd0a --- /dev/null +++ b/xmake/templates/objc/xcode.framework/src/test.m @@ -0,0 +1,5 @@ +#include "test.h" + +int add(int a, int b) { + return a + b; +} diff --git a/xmake/templates/objc/xcode.framework/xmake.lua b/xmake/templates/objc/xcode.framework/xmake.lua new file mode 100644 index 000000000..ad8e30290 --- /dev/null +++ b/xmake/templates/objc/xcode.framework/xmake.lua @@ -0,0 +1,9 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.framework") + add_files("src/*.m") + add_files("src/Info.plist") + add_headerfiles("src/*.h") + +${FAQ} diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m new file mode 100644 index 000000000..0ad500bfe --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/AppDelegate.m @@ -0,0 +1,41 @@ +// +// AppDelegate.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.iosapp/src/Info.plist b/xmake/templates/objc/xcode.iosapp/src/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.h b/xmake/templates/objc/xcode.iosapp/src/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/xmake/templates/objc/xcode.iosapp/src/ViewController.m b/xmake/templates/objc/xcode.iosapp/src/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/xmake/templates/objc/xcode.iosapp/src/main.m b/xmake/templates/objc/xcode.iosapp/src/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/src/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/xmake/templates/objc/xcode.iosapp/xmake.lua b/xmake/templates/objc/xcode.iosapp/xmake.lua new file mode 100644 index 000000000..b5b00b81f --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h new file mode 100644 index 000000000..b01a8dc72 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m new file mode 100644 index 000000000..1f3556c06 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/AppDelegate.m @@ -0,0 +1,45 @@ +// +// AppDelegate.m +// test +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" +#import + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + int c = add(1, 2); + NSLog(@"result: %d", c); + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d8db8d65f --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..865e9329f --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard new file mode 100644 index 000000000..808a21ce7 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist new file mode 100644 index 000000000..686d21a3a --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/Info.plist @@ -0,0 +1,66 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h new file mode 100644 index 000000000..5dbf88aa6 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.h @@ -0,0 +1,16 @@ +// +// SceneDelegate.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m new file mode 100644 index 000000000..d6698dd7c --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/SceneDelegate.m @@ -0,0 +1,50 @@ +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h new file mode 100644 index 000000000..e74d2f236 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m new file mode 100644 index 000000000..c3441c87a --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/ViewController.m @@ -0,0 +1,23 @@ +// +// ViewController.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m new file mode 100644 index 000000000..11a58afc7 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/app/main.m @@ -0,0 +1,19 @@ +// +// main.m +// test5 +// +// Created by ruki on 2020/4/8. +// Copyright © 2020 tboox. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/src/framework/test.m @@ -0,0 +1,9 @@ +#import "test.h" +#import + +int add(int a, int b) +{ + NSLog(@"add(%d, %d)", a, b); + return a + b; +} + diff --git a/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua b/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua new file mode 100644 index 000000000..89348a3b6 --- /dev/null +++ b/xmake/templates/objc/xcode.iosapp_with_framework/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("test") + add_rules("xcode.framework") + add_files("src/framework/test.m") + add_files("src/framework/Info.plist") + add_headerfiles("src/framework/test.h") + +target("${TARGETNAME}") + add_rules("xcode.application") + add_deps("test") + add_files("src/app/*.m", "src/app/**.storyboard", "src/app/*.xcassets") + add_files("src/app/Info.plist") diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.h b/xmake/templates/objc/xcode.macapp/src/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/xmake/templates/objc/xcode.macapp/src/AppDelegate.m b/xmake/templates/objc/xcode.macapp/src/AppDelegate.m new file mode 100644 index 000000000..da967d2ef --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/AppDelegate.m @@ -0,0 +1,27 @@ +// +// AppDelegate.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end diff --git a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.macapp/src/Info.plist b/xmake/templates/objc/xcode.macapp/src/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.h b/xmake/templates/objc/xcode.macapp/src/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/xmake/templates/objc/xcode.macapp/src/ViewController.m b/xmake/templates/objc/xcode.macapp/src/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/xmake/templates/objc/xcode.macapp/src/main.m b/xmake/templates/objc/xcode.macapp/src/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/main.m @@ -0,0 +1,16 @@ +// +// main.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/xmake/templates/objc/xcode.macapp/src/test.entitlements b/xmake/templates/objc/xcode.macapp/src/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/src/test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/xmake/templates/objc/xcode.macapp/xmake.lua b/xmake/templates/objc/xcode.macapp/xmake.lua new file mode 100644 index 000000000..b5b00b81f --- /dev/null +++ b/xmake/templates/objc/xcode.macapp/xmake.lua @@ -0,0 +1,6 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + add_rules("xcode.application") + add_files("src/*.m", "src/**.storyboard", "src/*.xcassets") + add_files("src/Info.plist") diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h b/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h new file mode 100644 index 000000000..5f5ba059e --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m b/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m new file mode 100644 index 000000000..667420c8c --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/AppDelegate.m @@ -0,0 +1,30 @@ +// +// AppDelegate.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "AppDelegate.h" +#import + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application + int c = add(1, 2); + NSLog(@"result: %d", c); +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application +} + + +@end diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..2db2b1c7c --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json new file mode 100644 index 000000000..da4a164c9 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard new file mode 100644 index 000000000..7a6d659a5 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist new file mode 100644 index 000000000..ce53d780c --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/Info.plist @@ -0,0 +1,38 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundleDisplayName + $(PRODUCT_DISPLAY_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h b/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h new file mode 100644 index 000000000..a974fc934 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m b/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m new file mode 100644 index 000000000..bccdf6189 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m b/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m new file mode 100644 index 000000000..ae3706f51 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/main.m @@ -0,0 +1,16 @@ +// +// main.m +// test3 +// +// Created by ruki on 2020/4/4. +// Copyright © 2020 tboox. All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + } + return NSApplicationMain(argc, argv); +} diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements b/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/app/test.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist new file mode 100644 index 000000000..20608314e --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 2020 tboox. All rights reserved. + + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h new file mode 100644 index 000000000..d882546d1 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.h @@ -0,0 +1,3 @@ +#import + +FOUNDATION_EXPORT int add(int a, int b); diff --git a/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m new file mode 100644 index 000000000..71214544b --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/src/framework/test.m @@ -0,0 +1,9 @@ +#import "test.h" +#import + +int add(int a, int b) +{ + NSLog(@"add(%d, %d)", a, b); + return a + b; +} + diff --git a/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua b/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua new file mode 100644 index 000000000..89348a3b6 --- /dev/null +++ b/xmake/templates/objc/xcode.macapp_with_framework/xmake.lua @@ -0,0 +1,13 @@ +add_rules("mode.debug", "mode.release") + +target("test") + add_rules("xcode.framework") + add_files("src/framework/test.m") + add_files("src/framework/Info.plist") + add_headerfiles("src/framework/test.h") + +target("${TARGETNAME}") + 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/project/src/main.pas b/xmake/templates/pascal/console/project/src/main.pas deleted file mode 100644 index a908ffab7..000000000 --- a/xmake/templates/pascal/console/project/src/main.pas +++ /dev/null @@ -1,4 +0,0 @@ -program Hello; -begin - writeln ('Hello, world.'); -end. diff --git a/xmake/templates/pascal/console/project/xmake.lua b/xmake/templates/pascal/console/project/xmake.lua deleted file mode 100644 index 155005840..000000000 --- a/xmake/templates/pascal/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.pas") - -${FAQ} diff --git a/xmake/templates/pascal/console/src/main.pas b/xmake/templates/pascal/console/src/main.pas new file mode 100644 index 000000000..a908ffab7 --- /dev/null +++ b/xmake/templates/pascal/console/src/main.pas @@ -0,0 +1,4 @@ +program Hello; +begin + writeln ('Hello, world.'); +end. diff --git a/xmake/templates/pascal/console/template.lua b/xmake/templates/pascal/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/pascal/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/pascal/console/xmake.lua b/xmake/templates/pascal/console/xmake.lua new file mode 100644 index 000000000..155005840 --- /dev/null +++ b/xmake/templates/pascal/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.pas") + +${FAQ} diff --git a/xmake/templates/pascal/shared/project/src/foo.pas b/xmake/templates/pascal/shared/project/src/foo.pas deleted file mode 100644 index 788950f46..000000000 --- a/xmake/templates/pascal/shared/project/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/project/src/main.pas b/xmake/templates/pascal/shared/project/src/main.pas deleted file mode 100644 index 02d5e88d0..000000000 --- a/xmake/templates/pascal/shared/project/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/project/xmake.lua b/xmake/templates/pascal/shared/project/xmake.lua deleted file mode 100644 index dd29cf486..000000000 --- a/xmake/templates/pascal/shared/project/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("${TARGETNAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.pas") - - -${FAQ} diff --git a/xmake/templates/pascal/shared/src/foo.pas b/xmake/templates/pascal/shared/src/foo.pas new file mode 100644 index 000000000..788950f46 --- /dev/null +++ b/xmake/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/templates/pascal/shared/src/main.pas b/xmake/templates/pascal/shared/src/main.pas new file mode 100644 index 000000000..02d5e88d0 --- /dev/null +++ b/xmake/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/templates/pascal/shared/template.lua b/xmake/templates/pascal/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/pascal/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/pascal/shared/xmake.lua b/xmake/templates/pascal/shared/xmake.lua new file mode 100644 index 000000000..dd29cf486 --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("foo") + add_files("src/main.pas") + + +${FAQ} diff --git a/xmake/templates/rust/console/project/src/main.rs b/xmake/templates/rust/console/project/src/main.rs deleted file mode 100644 index 88d5e2749..000000000 --- a/xmake/templates/rust/console/project/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("hello xmake!"); -} diff --git a/xmake/templates/rust/console/project/xmake.lua b/xmake/templates/rust/console/project/xmake.lua deleted file mode 100644 index 2d0e19145..000000000 --- a/xmake/templates/rust/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/main.rs") - -${FAQ} diff --git a/xmake/templates/rust/console/src/main.rs b/xmake/templates/rust/console/src/main.rs new file mode 100644 index 000000000..88d5e2749 --- /dev/null +++ b/xmake/templates/rust/console/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("hello xmake!"); +} diff --git a/xmake/templates/rust/console/template.lua b/xmake/templates/rust/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/rust/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/rust/console/xmake.lua b/xmake/templates/rust/console/xmake.lua new file mode 100644 index 000000000..2d0e19145 --- /dev/null +++ b/xmake/templates/rust/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/templates/rust/shared/project/src/foo.rs b/xmake/templates/rust/shared/project/src/foo.rs deleted file mode 100644 index a3a3aa4a6..000000000 --- a/xmake/templates/rust/shared/project/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/project/src/main.rs b/xmake/templates/rust/shared/project/src/main.rs deleted file mode 100644 index 205d23da3..000000000 --- a/xmake/templates/rust/shared/project/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/project/xmake.lua b/xmake/templates/rust/shared/project/xmake.lua deleted file mode 100644 index d20b6f5d7..000000000 --- a/xmake/templates/rust/shared/project/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -target("foo") - set_kind("shared") - add_files("src/foo.rs") - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("foo") - add_files("src/main.rs") - -${FAQ} diff --git a/xmake/templates/rust/shared/src/foo.rs b/xmake/templates/rust/shared/src/foo.rs new file mode 100644 index 000000000..a3a3aa4a6 --- /dev/null +++ b/xmake/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/templates/rust/shared/src/main.rs b/xmake/templates/rust/shared/src/main.rs new file mode 100644 index 000000000..205d23da3 --- /dev/null +++ b/xmake/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/templates/rust/shared/template.lua b/xmake/templates/rust/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/rust/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/rust/shared/xmake.lua b/xmake/templates/rust/shared/xmake.lua new file mode 100644 index 000000000..d20b6f5d7 --- /dev/null +++ b/xmake/templates/rust/shared/xmake.lua @@ -0,0 +1,10 @@ +target("foo") + set_kind("shared") + add_files("src/foo.rs") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("foo") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/templates/rust/static/project/src/foo.rs b/xmake/templates/rust/static/project/src/foo.rs deleted file mode 100644 index a3a3aa4a6..000000000 --- a/xmake/templates/rust/static/project/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/project/src/main.rs b/xmake/templates/rust/static/project/src/main.rs deleted file mode 100644 index 205d23da3..000000000 --- a/xmake/templates/rust/static/project/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/project/xmake.lua b/xmake/templates/rust/static/project/xmake.lua deleted file mode 100644 index 79a9ac569..000000000 --- a/xmake/templates/rust/static/project/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -target("foo") - set_kind("static") - add_files("src/foo.rs") - -target("${TARGETNAME}_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 new file mode 100644 index 000000000..a3a3aa4a6 --- /dev/null +++ b/xmake/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/templates/rust/static/src/main.rs b/xmake/templates/rust/static/src/main.rs new file mode 100644 index 000000000..205d23da3 --- /dev/null +++ b/xmake/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/templates/rust/static/template.lua b/xmake/templates/rust/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/rust/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/rust/static/xmake.lua b/xmake/templates/rust/static/xmake.lua new file mode 100644 index 000000000..79a9ac569 --- /dev/null +++ b/xmake/templates/rust/static/xmake.lua @@ -0,0 +1,10 @@ +target("foo") + set_kind("static") + add_files("src/foo.rs") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("foo") + add_files("src/main.rs") + +${FAQ} diff --git a/xmake/templates/swift/console/project/src/main.swift b/xmake/templates/swift/console/project/src/main.swift deleted file mode 100644 index ee21045f4..000000000 --- a/xmake/templates/swift/console/project/src/main.swift +++ /dev/null @@ -1,3 +0,0 @@ -import Foundation - -print("hello world!") diff --git a/xmake/templates/swift/console/project/xmake.lua b/xmake/templates/swift/console/project/xmake.lua deleted file mode 100644 index f607b1127..000000000 --- a/xmake/templates/swift/console/project/xmake.lua +++ /dev/null @@ -1,13 +0,0 @@ --- add modes: debug and release -add_rules("mode.debug", "mode.release") - --- add target -target("${TARGETNAME}") - - -- set kind - set_kind("binary") - - -- add files - add_files("src/*.swift") - -${FAQ} diff --git a/xmake/templates/swift/console/src/main.swift b/xmake/templates/swift/console/src/main.swift new file mode 100644 index 000000000..ee21045f4 --- /dev/null +++ b/xmake/templates/swift/console/src/main.swift @@ -0,0 +1,3 @@ +import Foundation + +print("hello world!") diff --git a/xmake/templates/swift/console/template.lua b/xmake/templates/swift/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/swift/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/swift/console/xmake.lua b/xmake/templates/swift/console/xmake.lua new file mode 100644 index 000000000..f607b1127 --- /dev/null +++ b/xmake/templates/swift/console/xmake.lua @@ -0,0 +1,13 @@ +-- add modes: debug and release +add_rules("mode.debug", "mode.release") + +-- add target +target("${TARGETNAME}") + + -- set kind + set_kind("binary") + + -- add files + add_files("src/*.swift") + +${FAQ} diff --git a/xmake/templates/vala/console/project/src/main.vala b/xmake/templates/vala/console/project/src/main.vala deleted file mode 100644 index 8e8a32da0..000000000 --- a/xmake/templates/vala/console/project/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/project/xmake.lua b/xmake/templates/vala/console/project/xmake.lua deleted file mode 100644 index 474572597..000000000 --- a/xmake/templates/vala/console/project/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("lua", "glib") - -target("${TARGETNAME}") - 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/console/src/main.vala b/xmake/templates/vala/console/src/main.vala new file mode 100644 index 000000000..8e8a32da0 --- /dev/null +++ b/xmake/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/templates/vala/console/template.lua b/xmake/templates/vala/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/vala/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/vala/console/xmake.lua b/xmake/templates/vala/console/xmake.lua new file mode 100644 index 000000000..474572597 --- /dev/null +++ b/xmake/templates/vala/console/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +add_requires("lua", "glib") + +target("${TARGETNAME}") + 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/project/src/main.vala b/xmake/templates/vala/shared/project/src/main.vala deleted file mode 100644 index da9fd895e..000000000 --- a/xmake/templates/vala/shared/project/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/project/src/mymath.vala b/xmake/templates/vala/shared/project/src/mymath.vala deleted file mode 100644 index 4f4e761c5..000000000 --- a/xmake/templates/vala/shared/project/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/project/xmake.lua b/xmake/templates/vala/shared/project/xmake.lua deleted file mode 100644 index e9148106c..000000000 --- a/xmake/templates/vala/shared/project/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("${TARGETNAME}") - set_kind("binary") - add_deps("mymath") - add_rules("vala") - add_files("src/main.vala") - add_packages("glib") diff --git a/xmake/templates/vala/shared/src/main.vala b/xmake/templates/vala/shared/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/xmake/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/templates/vala/shared/src/mymath.vala b/xmake/templates/vala/shared/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/xmake/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/templates/vala/shared/template.lua b/xmake/templates/vala/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/vala/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/vala/shared/xmake.lua b/xmake/templates/vala/shared/xmake.lua new file mode 100644 index 000000000..e9148106c --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") diff --git a/xmake/templates/vala/static/project/src/main.vala b/xmake/templates/vala/static/project/src/main.vala deleted file mode 100644 index da9fd895e..000000000 --- a/xmake/templates/vala/static/project/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/project/src/mymath.vala b/xmake/templates/vala/static/project/src/mymath.vala deleted file mode 100644 index 4f4e761c5..000000000 --- a/xmake/templates/vala/static/project/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/project/xmake.lua b/xmake/templates/vala/static/project/xmake.lua deleted file mode 100644 index 143566fcb..000000000 --- a/xmake/templates/vala/static/project/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("${TARGETNAME}") - 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 new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/xmake/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/templates/vala/static/src/mymath.vala b/xmake/templates/vala/static/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/xmake/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/templates/vala/static/template.lua b/xmake/templates/vala/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/vala/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/vala/static/xmake.lua b/xmake/templates/vala/static/xmake.lua new file mode 100644 index 000000000..143566fcb --- /dev/null +++ b/xmake/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("${TARGETNAME}") + set_kind("binary") + add_deps("mymath") + add_rules("vala") + add_files("src/main.vala") + add_packages("glib") diff --git a/xmake/templates/zig/console/project/src/main.zig b/xmake/templates/zig/console/project/src/main.zig deleted file mode 100644 index db34441e1..000000000 --- a/xmake/templates/zig/console/project/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/project/xmake.lua b/xmake/templates/zig/console/project/xmake.lua deleted file mode 100644 index 69a4b4477..000000000 --- a/xmake/templates/zig/console/project/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("binary") - add_files("src/*.zig") - -${FAQ} diff --git a/xmake/templates/zig/console/src/main.zig b/xmake/templates/zig/console/src/main.zig new file mode 100644 index 000000000..db34441e1 --- /dev/null +++ b/xmake/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/templates/zig/console/template.lua b/xmake/templates/zig/console/template.lua deleted file mode 100644 index ed2e13b57..000000000 --- a/xmake/templates/zig/console/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("console") - add_configfiles("xmake.lua") diff --git a/xmake/templates/zig/console/xmake.lua b/xmake/templates/zig/console/xmake.lua new file mode 100644 index 000000000..69a4b4477 --- /dev/null +++ b/xmake/templates/zig/console/xmake.lua @@ -0,0 +1,7 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("binary") + add_files("src/*.zig") + +${FAQ} diff --git a/xmake/templates/zig/shared/project/src/main.zig b/xmake/templates/zig/shared/project/src/main.zig deleted file mode 100644 index 7dc7b2bc4..000000000 --- a/xmake/templates/zig/shared/project/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/project/src/test.zig b/xmake/templates/zig/shared/project/src/test.zig deleted file mode 100644 index a04ec1544..000000000 --- a/xmake/templates/zig/shared/project/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/project/xmake.lua b/xmake/templates/zig/shared/project/xmake.lua deleted file mode 100644 index a21b056bc..000000000 --- a/xmake/templates/zig/shared/project/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("shared") - add_files("src/test.zig") - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.zig") - -${FAQ} diff --git a/xmake/templates/zig/shared/src/main.zig b/xmake/templates/zig/shared/src/main.zig new file mode 100644 index 000000000..7dc7b2bc4 --- /dev/null +++ b/xmake/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/templates/zig/shared/src/test.zig b/xmake/templates/zig/shared/src/test.zig new file mode 100644 index 000000000..a04ec1544 --- /dev/null +++ b/xmake/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/templates/zig/shared/template.lua b/xmake/templates/zig/shared/template.lua deleted file mode 100644 index d7ec5bae4..000000000 --- a/xmake/templates/zig/shared/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("shared") - add_configfiles("xmake.lua") diff --git a/xmake/templates/zig/shared/xmake.lua b/xmake/templates/zig/shared/xmake.lua new file mode 100644 index 000000000..a21b056bc --- /dev/null +++ b/xmake/templates/zig/shared/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("shared") + add_files("src/test.zig") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.zig") + +${FAQ} diff --git a/xmake/templates/zig/static/project/src/main.zig b/xmake/templates/zig/static/project/src/main.zig deleted file mode 100644 index 7dc7b2bc4..000000000 --- a/xmake/templates/zig/static/project/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/project/src/test.zig b/xmake/templates/zig/static/project/src/test.zig deleted file mode 100644 index a04ec1544..000000000 --- a/xmake/templates/zig/static/project/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/project/xmake.lua b/xmake/templates/zig/static/project/xmake.lua deleted file mode 100644 index f1321ee0f..000000000 --- a/xmake/templates/zig/static/project/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGETNAME}") - set_kind("static") - add_files("src/test.zig") - -target("${TARGETNAME}_demo") - set_kind("binary") - add_deps("${TARGETNAME}") - add_files("src/main.zig") - -${FAQ} diff --git a/xmake/templates/zig/static/src/main.zig b/xmake/templates/zig/static/src/main.zig new file mode 100644 index 000000000..7dc7b2bc4 --- /dev/null +++ b/xmake/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/templates/zig/static/src/test.zig b/xmake/templates/zig/static/src/test.zig new file mode 100644 index 000000000..a04ec1544 --- /dev/null +++ b/xmake/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/templates/zig/static/template.lua b/xmake/templates/zig/static/template.lua deleted file mode 100644 index abfe91a4b..000000000 --- a/xmake/templates/zig/static/template.lua +++ /dev/null @@ -1,2 +0,0 @@ -template("static") - add_configfiles("xmake.lua") diff --git a/xmake/templates/zig/static/xmake.lua b/xmake/templates/zig/static/xmake.lua new file mode 100644 index 000000000..f1321ee0f --- /dev/null +++ b/xmake/templates/zig/static/xmake.lua @@ -0,0 +1,12 @@ +add_rules("mode.debug", "mode.release") + +target("${TARGETNAME}") + set_kind("static") + add_files("src/test.zig") + +target("${TARGETNAME}_demo") + set_kind("binary") + add_deps("${TARGETNAME}") + add_files("src/main.zig") + +${FAQ} -- cgit v1.3.1