summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-01-21 17:02:13 +0800
committerruki <[email protected]>2017-01-21 17:02:13 +0800
commit50bc191501037fee117bee79191d21d326a0ed82 (patch)
treec8f5dd93a4e2de8d369bafdb770f5148fd05f8d1
parentb028a68c3f65f827ae2b7ff0ad644a86bb4597fa (diff)
add set_table api for interpreter
-rwxr-xr-xxmake/actions/build/xmake.lua34
-rwxr-xr-xxmake/actions/clean/xmake.lua32
-rwxr-xr-xxmake/actions/config/xmake.lua184
-rwxr-xr-xxmake/actions/create/xmake.lua84
-rwxr-xr-xxmake/actions/global/xmake.lua54
-rwxr-xr-xxmake/actions/install/xmake.lua30
-rwxr-xr-xxmake/actions/package/xmake.lua32
-rwxr-xr-xxmake/actions/run/xmake.lua34
-rwxr-xr-xxmake/actions/uninstall/xmake.lua30
-rw-r--r--xmake/core/language/language.lua6
-rw-r--r--xmake/core/project/template.lua10
-rwxr-xr-xxmake/languages/asm/xmake.lua6
-rwxr-xr-xxmake/languages/c++/xmake.lua6
-rwxr-xr-xxmake/languages/golang/xmake.lua6
-rwxr-xr-xxmake/languages/objc++/xmake.lua6
-rwxr-xr-xxmake/languages/swift/xmake.lua6
-rwxr-xr-xxmake/platforms/android/xmake.lua4
-rwxr-xr-xxmake/platforms/iphoneos/xmake.lua4
-rwxr-xr-xxmake/platforms/macosx/xmake.lua4
-rwxr-xr-xxmake/platforms/watchos/xmake.lua4
-rwxr-xr-xxmake/platforms/windows/xmake.lua4
-rwxr-xr-xxmake/plugins/app2ipa/xmake.lua28
-rwxr-xr-xxmake/plugins/doxygen/xmake.lua26
-rwxr-xr-xxmake/plugins/hello/xmake.lua16
-rwxr-xr-xxmake/plugins/lua/xmake.lua30
-rwxr-xr-xxmake/plugins/macro/xmake.lua84
-rwxr-xr-xxmake/plugins/project/xmake.lua28
27 files changed, 398 insertions, 394 deletions
diff --git a/xmake/actions/build/xmake.lua b/xmake/actions/build/xmake.lua
index 5f29f060d..79e6cee4f 100755
--- a/xmake/actions/build/xmake.lua
+++ b/xmake/actions/build/xmake.lua
@@ -32,26 +32,26 @@ task("build")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake [task] [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake [task] [options] [target]"
- -- description
- , description = "Build the project if no given tasks."
+ -- description
+ , description = "Build the project if no given tasks."
- -- options
- , options =
- {
- {'b', "build", "k", nil, "Build project. This is default building mode and optional." }
- , {'r', "rebuild", "k", nil, "Rebuild the project." }
+ -- options
+ , options =
+ {
+ {'b', "build", "k", nil, "Build project. This is default building mode and optional." }
+ , {'r', "rebuild", "k", nil, "Rebuild the project." }
- , {}
- , {'j', "jobs", "kv", "4", "Specifies the number of jobs to build simultaneously" }
-
- , {}
- , {nil, "target", "v", "all", "Build the given target." }
- }
- })
+ , {}
+ , {'j', "jobs", "kv", "4", "Specifies the number of jobs to build simultaneously" }
+
+ , {}
+ , {nil, "target", "v", "all", "Build the given target." }
+ }
+ }
diff --git a/xmake/actions/clean/xmake.lua b/xmake/actions/clean/xmake.lua
index 2f4291c02..e716a676f 100755
--- a/xmake/actions/clean/xmake.lua
+++ b/xmake/actions/clean/xmake.lua
@@ -32,25 +32,25 @@ task("clean")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake clean|c [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake clean|c [options] [target]"
- -- description
- , description = "Remove all binary and temporary files."
+ -- description
+ , description = "Remove all binary and temporary files."
- -- xmake c
- , shortname = 'c'
+ -- xmake c
+ , shortname = 'c'
- -- options
- , options =
- {
- {'a', "all", "k", nil, "Clean all auto-generated files by xmake." }
-
- , {}
- , {nil, "target", "v", "all", "Clean for the given target." }
- }
- })
+ -- options
+ , options =
+ {
+ {'a', "all", "k", nil, "Clean all auto-generated files by xmake." }
+
+ , {}
+ , {nil, "target", "v", "all", "Clean for the given target." }
+ }
+ }
diff --git a/xmake/actions/config/xmake.lua b/xmake/actions/config/xmake.lua
index 8d9cdefee..cc9bf0e28 100755
--- a/xmake/actions/config/xmake.lua
+++ b/xmake/actions/config/xmake.lua
@@ -32,125 +32,125 @@ task("config")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake config|f [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake config|f [options] [target]"
- -- description
- , description = "Configure the project."
+ -- description
+ , description = "Configure the project."
- -- xmake f
- , shortname = 'f'
+ -- xmake f
+ , shortname = 'f'
- -- options
- , options =
- {
- {'c', "clean", "k", nil, "Clean the cached configure and configure all again." }
+ -- options
+ , options =
+ {
+ {'c', "clean", "k", nil, "Clean the cached configure and configure all again." }
- , {}
- , {'p', "plat", "kv", "$(host)", "Compile for the given platform."
+ , {}
+ , {'p', "plat", "kv", "$(host)", "Compile for the given platform."
- -- show the description of all platforms
- , function ()
+ -- show the description of all platforms
+ , function ()
- -- import platform
- import("core.platform.platform")
+ -- import platform
+ import("core.platform.platform")
- -- make description
- local description = {}
- for i, plat in ipairs(platform.plats()) do
- description[i] = " - " .. plat
- end
+ -- make description
+ local description = {}
+ for i, plat in ipairs(platform.plats()) do
+ description[i] = " - " .. plat
+ end
- -- get it
- return description
- end }
- , {'a', "arch", "kv", "auto", "Compile for the given architecture."
+ -- get it
+ return description
+ end }
+ , {'a', "arch", "kv", "auto", "Compile for the given architecture."
- -- show the description of all architectures
- , function ()
+ -- show the description of all architectures
+ , function ()
- -- import platform
- import("core.platform.platform")
+ -- import platform
+ import("core.platform.platform")
- -- make description
- local description = {}
- for i, plat in ipairs(platform.plats()) do
- description[i] = " - " .. plat .. ":"
- for _, arch in ipairs(platform.archs(plat)) do
- description[i] = description[i] .. " " .. arch
- end
+ -- make description
+ local description = {}
+ for i, plat in ipairs(platform.plats()) do
+ description[i] = " - " .. plat .. ":"
+ for _, arch in ipairs(platform.archs(plat)) do
+ description[i] = description[i] .. " " .. arch
end
+ end
- -- get it
- return description
- end }
- , {'m', "mode", "kv", "release", "Compile for the given mode."
- , " - debug"
- , " - release"
- , " - ... (custom)" }
- , {'k', "kind", "kv", "static", "Compile for the given target kind."
- , " - static"
- , " - shared"
- , " - binary" }
- , {nil, "host", "kv", "$(host)", "The current host environment." }
+ -- get it
+ return description
+ end }
+ , {'m', "mode", "kv", "release", "Compile for the given mode."
+ , " - debug"
+ , " - release"
+ , " - ... (custom)" }
+ , {'k', "kind", "kv", "static", "Compile for the given target kind."
+ , " - static"
+ , " - shared"
+ , " - binary" }
+ , {nil, "host", "kv", "$(host)", "The current host environment." }
- -- show project menu options
- , function ()
+ -- show project menu options
+ , function ()
- -- import project menu
- import("core.project.menu")
+ -- import project menu
+ import("core.project.menu")
- -- get project menu options
- return menu.options()
- end
+ -- get project menu options
+ return menu.options()
+ end
- , {}
- , {nil, "ccache", "kv", "auto", "Enable or disable the c/c++ compiler cache." }
+ , {}
+ , {nil, "ccache", "kv", "auto", "Enable or disable the c/c++ compiler cache." }
- , {}
- , {nil, "cross", "kv", nil, "The cross toolchains prefix"
- , ".e.g"
- , " - i386-mingw32-"
- , " - arm-linux-androideabi-" }
- , {nil, "toolchains", "kv", nil, "The cross toolchains directory"
- , ".e.g"
- , " - sdk/bin (/arm-linux-gcc ..)" }
- , {nil, "sdk", "kv", nil, "The cross sdk directory"
- , ".e.g"
- , " - sdk/bin (toolchains)"
- , " - sdk/lib"
- , " - sdk/include" }
+ , {}
+ , {nil, "cross", "kv", nil, "The cross toolchains prefix"
+ , ".e.g"
+ , " - i386-mingw32-"
+ , " - arm-linux-androideabi-" }
+ , {nil, "toolchains", "kv", nil, "The cross toolchains directory"
+ , ".e.g"
+ , " - sdk/bin (/arm-linux-gcc ..)" }
+ , {nil, "sdk", "kv", nil, "The cross sdk directory"
+ , ".e.g"
+ , " - sdk/bin (toolchains)"
+ , " - sdk/lib"
+ , " - sdk/include" }
- , {}
- , {nil, "dd", "kv", "auto", "The Debugger" }
+ , {}
+ , {nil, "dd", "kv", "auto", "The Debugger" }
- -- show language menu options
- , function ()
+ -- show language menu options
+ , function ()
- -- import language menu
- import("core.language.menu")
+ -- import language menu
+ import("core.language.menu")
- -- get config menu options
- return menu.options("config")
- end
+ -- get config menu options
+ return menu.options("config")
+ end
- -- show platform menu options
- , function ()
+ -- show platform menu options
+ , function ()
- -- import platform menu
- import("core.platform.menu")
+ -- import platform menu
+ import("core.platform.menu")
- -- get config menu options
- return menu.options("config")
- end
+ -- get config menu options
+ return menu.options("config")
+ end
- , {'o', "buildir", "kv", "build", "Set the build directory." }
+ , {'o', "buildir", "kv", "build", "Set the build directory." }
- , {}
- , {nil, "target", "v", "all", "Configure for the given target." }
- }
- })
+ , {}
+ , {nil, "target", "v", "all", "Configure for the given target." }
+ }
+ }
diff --git a/xmake/actions/create/xmake.lua b/xmake/actions/create/xmake.lua
index 494b74672..f7aa5fdd6 100755
--- a/xmake/actions/create/xmake.lua
+++ b/xmake/actions/create/xmake.lua
@@ -32,60 +32,60 @@ task("create")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake create [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake create [options] [target]"
- -- description
- , description = "Create a new project."
+ -- description
+ , description = "Create a new project."
- -- options
- , options =
- {
- {'n', "name", "kv", nil, "The project name." }
- , {'l', "language", "kv", "c", "The project language"
+ -- options
+ , options =
+ {
+ {'n', "name", "kv", nil, "The project name." }
+ , {'l', "language", "kv", "c", "The project language"
- -- show the description of all languages
- , function ()
+ -- show the description of all languages
+ , function ()
- -- import template
- import("core.project.template")
+ -- import template
+ import("core.project.template")
- -- make description
- local description = {}
- for _, language in ipairs(template.languages()) do
- table.insert(description, " - " .. language)
- end
+ -- make description
+ local description = {}
+ for _, language in ipairs(template.languages()) do
+ table.insert(description, " - " .. language)
+ end
- -- get it
- return description
- end }
- , {'t', "template", "kv", "1", "Select the project template id of the given language."
+ -- get it
+ return description
+ end }
+ , {'t', "template", "kv", "1", "Select the project template id of the given language."
- -- show the description of all templates
- , function ()
+ -- show the description of all templates
+ , function ()
- -- import template
- import("core.project.template")
+ -- import template
+ import("core.project.template")
- -- make description
- local description = {}
- for _, language in ipairs(template.languages()) do
- table.insert(description, format(" - language: %s", language))
- for i, t in ipairs(template.templates(language)) do
- table.insert(description, format(" %d. %s", i, ifelse(t.description, t.description, "The Unknown Project")))
- end
+ -- make description
+ local description = {}
+ for _, language in ipairs(template.languages()) do
+ table.insert(description, format(" - language: %s", language))
+ for i, t in ipairs(template.templates(language)) do
+ table.insert(description, format(" %d. %s", i, ifelse(t.description, t.description, "The Unknown Project")))
end
+ end
- -- get it
- return description
- end }
+ -- get it
+ return description
+ end }
- , {}
- , {nil, "target", "v", nil, "Create the given target."
- , "Uses the project name as target if not exists." }
- }
- })
+ , {}
+ , {nil, "target", "v", nil, "Create the given target."
+ , "Uses the project name as target if not exists." }
+ }
+ }
diff --git a/xmake/actions/global/xmake.lua b/xmake/actions/global/xmake.lua
index 37d0f1ab9..0cf4e605e 100755
--- a/xmake/actions/global/xmake.lua
+++ b/xmake/actions/global/xmake.lua
@@ -32,43 +32,43 @@ task("global")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake global|g [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake global|g [options] [target]"
- -- description
- , description = "Configure the global options for xmake."
+ -- description
+ , description = "Configure the global options for xmake."
- -- xmake g
- , shortname = 'g'
+ -- xmake g
+ , shortname = 'g'
- -- options
- , options =
- {
- {'c', "clean", "k", nil, "Clean the cached configure and configure all again." }
+ -- options
+ , options =
+ {
+ {'c', "clean", "k", nil, "Clean the cached configure and configure all again." }
- , {}
+ , {}
- , {nil, "make", "kv", "auto", "Set the make path." }
- , {nil, "ccache", "kv", "auto", "Enable or disable the c/c++ compiler cache."
- , " --ccache=[y|n]" }
+ , {nil, "make", "kv", "auto", "Set the make path." }
+ , {nil, "ccache", "kv", "auto", "Enable or disable the c/c++ compiler cache."
+ , " --ccache=[y|n]" }
- , {}
- , {nil, "dd", "kv", "auto", "The Debugger" }
- , {}
+ , {}
+ , {nil, "dd", "kv", "auto", "The Debugger" }
+ , {}
- -- show platform menu options
- , function ()
+ -- show platform menu options
+ , function ()
- -- import platform menu
- import("core.platform.menu")
+ -- import platform menu
+ import("core.platform.menu")
- -- get global menu options
- return menu.options("global")
- end
+ -- get global menu options
+ return menu.options("global")
+ end
- }
- })
+ }
+ }
diff --git a/xmake/actions/install/xmake.lua b/xmake/actions/install/xmake.lua
index 131babb37..9f386a26f 100755
--- a/xmake/actions/install/xmake.lua
+++ b/xmake/actions/install/xmake.lua
@@ -32,25 +32,25 @@ task("install")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake install|i [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake install|i [options] [target]"
- -- description
- , description = "Package and install the project binary files."
+ -- description
+ , description = "Package and install the project binary files."
- -- xmake i
- , shortname = 'i'
+ -- xmake i
+ , shortname = 'i'
- -- options
- , options =
- {
- {'o', "installdir", "kv", nil, "Set the install directory." }
+ -- options
+ , options =
+ {
+ {'o', "installdir", "kv", nil, "Set the install directory." }
- , {}
- , {nil, "target", "v", "all", "Install the given target." }
- }
- })
+ , {}
+ , {nil, "target", "v", "all", "Install the given target." }
+ }
+ }
diff --git a/xmake/actions/package/xmake.lua b/xmake/actions/package/xmake.lua
index 0fff6c8b4..2a45dffda 100755
--- a/xmake/actions/package/xmake.lua
+++ b/xmake/actions/package/xmake.lua
@@ -32,25 +32,25 @@ task("package")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake package|p [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake package|p [options] [target]"
- -- description
- , description = "Package target."
+ -- description
+ , description = "Package target."
- -- xmake p
- , shortname = 'p'
+ -- xmake p
+ , shortname = 'p'
- -- options
- , options =
- {
- {'o', "outputdir", "kv", nil, "Set the output directory." }
- , {'a', "archs", "kv", nil, "Compile for the given architecture. (deprecated)" }
- , {}
- , {nil, "target", "v", "all", "Package a given target" }
- }
- })
+ -- options
+ , options =
+ {
+ {'o', "outputdir", "kv", nil, "Set the output directory." }
+ , {'a', "archs", "kv", nil, "Compile for the given architecture. (deprecated)" }
+ , {}
+ , {nil, "target", "v", "all", "Package a given target" }
+ }
+ }
diff --git a/xmake/actions/run/xmake.lua b/xmake/actions/run/xmake.lua
index 911468473..ee6c1aa0b 100755
--- a/xmake/actions/run/xmake.lua
+++ b/xmake/actions/run/xmake.lua
@@ -32,26 +32,26 @@ task("run")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake run|r [options] [target] [arguments]"
+ set_menu {
+ -- usage
+ usage = "xmake run|r [options] [target] [arguments]"
- -- description
- , description = "Run the project target."
+ -- description
+ , description = "Run the project target."
- -- xmake r
- , shortname = 'r'
-
- -- options
- , options =
- {
- {'d', "debug", "k", nil, "Run and debug the given target." }
+ -- xmake r
+ , shortname = 'r'
- , {}
- , {nil, "target", "v", nil, "Run the given target." }
- , {nil, "arguments", "vs", nil, "The target arguments" }
- }
- })
+ -- options
+ , options =
+ {
+ {'d', "debug", "k", nil, "Run and debug the given target." }
+
+ , {}
+ , {nil, "target", "v", nil, "Run the given target." }
+ , {nil, "arguments", "vs", nil, "The target arguments" }
+ }
+ }
diff --git a/xmake/actions/uninstall/xmake.lua b/xmake/actions/uninstall/xmake.lua
index 30bc50e2b..f4e5e4bd7 100755
--- a/xmake/actions/uninstall/xmake.lua
+++ b/xmake/actions/uninstall/xmake.lua
@@ -32,25 +32,25 @@ task("uninstall")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake uninstall|u [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake uninstall|u [options] [target]"
- -- description
- , description = "Uninstall the project binary files."
+ -- description
+ , description = "Uninstall the project binary files."
- -- xmake u
- , shortname = 'u'
+ -- xmake u
+ , shortname = 'u'
- -- options
- , options =
- {
- {nil, "installdir", "kv", nil, "Set the install directory." }
+ -- options
+ , options =
+ {
+ {nil, "installdir", "kv", nil, "Set the install directory." }
- , {}
- , {nil, "target", "v", "all", "Uninstall the given target." }
- }
- })
+ , {}
+ , {nil, "target", "v", "all", "Uninstall the given target." }
+ }
+ }
diff --git a/xmake/core/language/language.lua b/xmake/core/language/language.lua
index 5168b29ae..6cd22e20e 100644
--- a/xmake/core/language/language.lua
+++ b/xmake/core/language/language.lua
@@ -127,7 +127,6 @@ function language._interpreter()
{
-- language.set_xxx
"language.set_menu"
- , "language.set_sourcekinds"
, "language.set_targetkinds"
}
, script =
@@ -136,6 +135,11 @@ function language._interpreter()
"language.on_load"
, "language.on_check_main"
}
+ , dictionary =
+ {
+ -- language.set_xxx
+ "language.set_sourcekinds"
+ }
}
-- save interpreter
diff --git a/xmake/core/project/template.lua b/xmake/core/project/template.lua
index cdcefd414..3a068a6c8 100644
--- a/xmake/core/project/template.lua
+++ b/xmake/core/project/template.lua
@@ -60,6 +60,11 @@ function template._interpreter()
-- add_xxx
, "add_macrofiles"
}
+ , script =
+ {
+ -- on_xxx
+ "on_create"
+ }
, dictionary =
{
-- set_xxx
@@ -67,11 +72,6 @@ function template._interpreter()
-- add_xxx
, "add_macros"
}
- , script =
- {
- -- on_xxx
- "on_create"
- }
}
-- save interpreter
diff --git a/xmake/languages/asm/xmake.lua b/xmake/languages/asm/xmake.lua
index 7eee220a4..e89eadbed 100755
--- a/xmake/languages/asm/xmake.lua
+++ b/xmake/languages/asm/xmake.lua
@@ -26,7 +26,7 @@
language("asm")
-- set source file kinds
- set_sourcekinds(".s", ".asm")
+ set_sourcekinds {as = {".s", ".asm"}}
-- set target kinds
set_targetkinds("binary", "static", "shared")
@@ -35,7 +35,7 @@ language("asm")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -55,7 +55,7 @@ language("asm")
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
}
- })
+ }
diff --git a/xmake/languages/c++/xmake.lua b/xmake/languages/c++/xmake.lua
index 1a19aa3be..8a94e9b6e 100755
--- a/xmake/languages/c++/xmake.lua
+++ b/xmake/languages/c++/xmake.lua
@@ -26,7 +26,7 @@
language("c++")
-- set source file kinds
- set_sourcekinds(".c", ".cc", ".cpp", ".cxx")
+ set_sourcekinds {cc = ".c", cxx = {".cc", ".cpp", ".cxx"}}
-- set target kinds
set_targetkinds("binary", "static", "shared")
@@ -38,7 +38,7 @@ language("c++")
on_check_main("check_main")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -61,7 +61,7 @@ language("c++")
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
}
- })
+ }
diff --git a/xmake/languages/golang/xmake.lua b/xmake/languages/golang/xmake.lua
index 0e2ffe570..bac49e680 100755
--- a/xmake/languages/golang/xmake.lua
+++ b/xmake/languages/golang/xmake.lua
@@ -26,7 +26,7 @@
language("golang")
-- set source file kinds
- set_sourcekinds(".go")
+ set_sourcekinds {go = ".go"}
-- set target kinds
set_targetkinds("binary", "static", "shared")
@@ -38,7 +38,7 @@ language("golang")
on_check_main("check_main")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -54,5 +54,5 @@ language("golang")
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
}
- })
+ }
diff --git a/xmake/languages/objc++/xmake.lua b/xmake/languages/objc++/xmake.lua
index c8a166bb5..9ff269372 100755
--- a/xmake/languages/objc++/xmake.lua
+++ b/xmake/languages/objc++/xmake.lua
@@ -26,7 +26,7 @@
language("objc++")
-- set source file kinds
- set_sourcekinds(".m", ".mm")
+ set_sourcekinds {mm = ".m", mxx = ".mm"}
-- set target kinds
set_targetkinds("binary", "static", "shared")
@@ -38,7 +38,7 @@ language("objc++")
on_check_main("check_main")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -62,7 +62,7 @@ language("objc++")
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
}
- })
+ }
diff --git a/xmake/languages/swift/xmake.lua b/xmake/languages/swift/xmake.lua
index cf47a5113..644d2d6d8 100755
--- a/xmake/languages/swift/xmake.lua
+++ b/xmake/languages/swift/xmake.lua
@@ -26,7 +26,7 @@
language("swift")
-- set source file kinds
- set_sourcekinds(".swift")
+ set_sourcekinds {sc = ".swift"}
-- set target kinds
set_targetkinds("binary")
@@ -35,7 +35,7 @@ language("swift")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -59,7 +59,7 @@ language("swift")
, {nil, "linkdirs", "kv", nil, "The Link Search Directories" }
, {nil, "includedirs","kv", nil, "The Include Search Directories" }
}
- })
+ }
diff --git a/xmake/platforms/android/xmake.lua b/xmake/platforms/android/xmake.lua
index cd6e18f09..35f503fc2 100755
--- a/xmake/platforms/android/xmake.lua
+++ b/xmake/platforms/android/xmake.lua
@@ -44,7 +44,7 @@ platform("android")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -58,7 +58,7 @@ platform("android")
, {nil, "ndk", "kv", nil, "The NDK Directory" }
, {nil, "ndk_sdkver", "kv", "auto", "The SDK Version for NDK" }
}
- })
+ }
diff --git a/xmake/platforms/iphoneos/xmake.lua b/xmake/platforms/iphoneos/xmake.lua
index 3016cdfc8..7acd75368 100755
--- a/xmake/platforms/iphoneos/xmake.lua
+++ b/xmake/platforms/iphoneos/xmake.lua
@@ -44,7 +44,7 @@ platform("iphoneos")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -66,7 +66,7 @@ platform("iphoneos")
, {nil, "codesign", "kv", "auto", "The Code Signing Indentity" }
, {nil, "entitlements", "kv", "auto", "The Code Signing Entitlements" }
}
- })
+ }
diff --git a/xmake/platforms/macosx/xmake.lua b/xmake/platforms/macosx/xmake.lua
index 3fafb372b..fba2b2334 100755
--- a/xmake/platforms/macosx/xmake.lua
+++ b/xmake/platforms/macosx/xmake.lua
@@ -50,7 +50,7 @@ platform("macosx")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -64,7 +64,7 @@ platform("macosx")
{}
, {nil, "xcode_dir", "kv", "auto", "the xcode application directory" }
}
- })
+ }
diff --git a/xmake/platforms/watchos/xmake.lua b/xmake/platforms/watchos/xmake.lua
index b612d81db..9758cab38 100755
--- a/xmake/platforms/watchos/xmake.lua
+++ b/xmake/platforms/watchos/xmake.lua
@@ -44,7 +44,7 @@ platform("watchos")
on_load("load")
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -66,7 +66,7 @@ platform("watchos")
, {nil, "codesign", "kv", "auto", "The Code Signing Indentity" }
, {nil, "entitlements", "kv", "auto", "The Code Signing Entitlements" }
}
- })
+ }
diff --git a/xmake/platforms/windows/xmake.lua b/xmake/platforms/windows/xmake.lua
index 81a4762dd..764f44412 100755
--- a/xmake/platforms/windows/xmake.lua
+++ b/xmake/platforms/windows/xmake.lua
@@ -56,7 +56,7 @@ platform("windows")
end)
-- set menu
- set_menu({
+ set_menu {
config =
{
{}
@@ -68,6 +68,6 @@ platform("windows")
{}
, {nil, "vs", "kv", "auto", "The Microsoft Visual Studio" }
}
- })
+ }
diff --git a/xmake/plugins/app2ipa/xmake.lua b/xmake/plugins/app2ipa/xmake.lua
index 6ab417b4a..f2ee42be1 100755
--- a/xmake/plugins/app2ipa/xmake.lua
+++ b/xmake/plugins/app2ipa/xmake.lua
@@ -32,19 +32,19 @@ task("app2ipa")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake app2ipa [options] xxx.app"
+ set_menu {
+ -- usage
+ usage = "xmake app2ipa [options] xxx.app"
- -- description
- , description = "Generate .ipa file from the given .app"
+ -- description
+ , description = "Generate .ipa file from the given .app"
- -- options
- , options =
- {
- {'o', "ipa", "kv", nil, "Set the .ipa file path." }
- , {nil, "icon", "kv", nil, "Set the icon file path." }
- , {}
- , {nil, "app", "v", nil, "Set the .app directory." }
- }
- })
+ -- options
+ , options =
+ {
+ {'o', "ipa", "kv", nil, "Set the .ipa file path." }
+ , {nil, "icon", "kv", nil, "Set the icon file path." }
+ , {}
+ , {nil, "app", "v", nil, "Set the .app directory." }
+ }
+ }
diff --git a/xmake/plugins/doxygen/xmake.lua b/xmake/plugins/doxygen/xmake.lua
index 6ea2cf21b..785815080 100755
--- a/xmake/plugins/doxygen/xmake.lua
+++ b/xmake/plugins/doxygen/xmake.lua
@@ -32,21 +32,21 @@ task("doxygen")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake doxygen [options] [arguments]"
+ set_menu {
+ -- usage
+ usage = "xmake doxygen [options] [arguments]"
- -- description
- , description = "Generate the doxygen document."
+ -- description
+ , description = "Generate the doxygen document."
- -- options
- , options =
- {
- {'o', "outputdir", "kv", nil, "Set the output directory." }
- , {}
- , {nil, "srcdir", "v", "src", "Set the source code directory." }
- }
- })
+ -- options
+ , options =
+ {
+ {'o', "outputdir", "kv", nil, "Set the output directory." }
+ , {}
+ , {nil, "srcdir", "v", "src", "Set the source code directory." }
+ }
+ }
diff --git a/xmake/plugins/hello/xmake.lua b/xmake/plugins/hello/xmake.lua
index b832d98ff..c878719f0 100755
--- a/xmake/plugins/hello/xmake.lua
+++ b/xmake/plugins/hello/xmake.lua
@@ -37,13 +37,13 @@ task("hello")
end)
-- set menu
- set_menu({
- -- usage
- usage = "xmake hello [options]"
+ set_menu {
+ -- usage
+ usage = "xmake hello [options]"
- -- description
- , description = "Hello xmake!"
+ -- description
+ , description = "Hello xmake!"
- -- options
- , options = {}
- })
+ -- options
+ , options = {}
+ }
diff --git a/xmake/plugins/lua/xmake.lua b/xmake/plugins/lua/xmake.lua
index 2ed7f22a7..8de34a0a2 100755
--- a/xmake/plugins/lua/xmake.lua
+++ b/xmake/plugins/lua/xmake.lua
@@ -59,24 +59,24 @@ task("lua")
end)
-- set menu
- set_menu({
- -- usage
- usage = "xmake lua|l [options] [script] [arguments]"
+ set_menu {
+ -- usage
+ usage = "xmake lua|l [options] [script] [arguments]"
- -- description
- , description = "Run the lua script."
+ -- description
+ , description = "Run the lua script."
- -- xmake l
- , shortname = 'l'
+ -- xmake l
+ , shortname = 'l'
- -- options
- , options =
- {
- {'l', "list", "k", nil, "List all scripts." }
- , {nil, "script", "v", nil, "Run the given lua script." }
- , {nil, "arguments", "vs", nil, "The script arguments." }
- }
- })
+ -- options
+ , options =
+ {
+ {'l', "list", "k", nil, "List all scripts." }
+ , {nil, "script", "v", nil, "Run the given lua script." }
+ , {nil, "arguments", "vs", nil, "The script arguments." }
+ }
+ }
diff --git a/xmake/plugins/macro/xmake.lua b/xmake/plugins/macro/xmake.lua
index cb52134f6..92dd4b32e 100755
--- a/xmake/plugins/macro/xmake.lua
+++ b/xmake/plugins/macro/xmake.lua
@@ -32,48 +32,48 @@ task("macro")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake macro|m [options] [name] [arguments]"
+ set_menu {
+ -- usage
+ usage = "xmake macro|m [options] [name] [arguments]"
- -- description
- , description = "Run the given macro."
+ -- description
+ , description = "Run the given macro."
- -- xmake m
- , shortname = 'm'
+ -- xmake m
+ , shortname = 'm'
- -- options
- , options =
- {
- {'b', "begin", "k", nil, "Start to record macro."
- , ".e.g"
- , "Record macro with name: test"
- , " xmake macro --begin"
- , " xmake config --plat=macosx"
- , " xmake clean"
- , " xmake -r"
- , " xmake package"
- , " xmake macro --end test" }
- , {'e', "end", "k", nil, "Stop to record macro." }
- , {}
- , {nil, "show", "k", nil, "Show the content of the given macro." }
- , {'l', "list", "k", nil, "List all macros." }
- , {'d', "delete", "k", nil, "Delete the given macro." }
- , {'c', "clear", "k", nil, "Clear the all macros." }
- , {}
- , {nil, "import", "kv", nil, "Import the given macro file or directory."
- , ".e.g"
- , " xmake macro --import=/xxx/macro.lua test"
- , " xmake macro --import=/xxx/macrodir" }
- , {nil, "export", "kv", nil, "Export the given macro to file or directory."
- , ".e.g"
- , " xmake macro --export=/xxx/macro.lua test"
- , " xmake macro --export=/xxx/macrodir" }
- , {}
- , {nil, "name", "v", ".", "Set the macro name."
- , ".e.g"
- , " Run the given macro: xmake macro test"
- , " Run the anonymous macro: xmake macro ." }
- , {nil, "arguments", "vs", nil, "Set the macro arguments." }
- }
- })
+ -- options
+ , options =
+ {
+ {'b', "begin", "k", nil, "Start to record macro."
+ , ".e.g"
+ , "Record macro with name: test"
+ , " xmake macro --begin"
+ , " xmake config --plat=macosx"
+ , " xmake clean"
+ , " xmake -r"
+ , " xmake package"
+ , " xmake macro --end test" }
+ , {'e', "end", "k", nil, "Stop to record macro." }
+ , {}
+ , {nil, "show", "k", nil, "Show the content of the given macro." }
+ , {'l', "list", "k", nil, "List all macros." }
+ , {'d', "delete", "k", nil, "Delete the given macro." }
+ , {'c', "clear", "k", nil, "Clear the all macros." }
+ , {}
+ , {nil, "import", "kv", nil, "Import the given macro file or directory."
+ , ".e.g"
+ , " xmake macro --import=/xxx/macro.lua test"
+ , " xmake macro --import=/xxx/macrodir" }
+ , {nil, "export", "kv", nil, "Export the given macro to file or directory."
+ , ".e.g"
+ , " xmake macro --export=/xxx/macro.lua test"
+ , " xmake macro --export=/xxx/macrodir" }
+ , {}
+ , {nil, "name", "v", ".", "Set the macro name."
+ , ".e.g"
+ , " Run the given macro: xmake macro test"
+ , " Run the anonymous macro: xmake macro ." }
+ , {nil, "arguments", "vs", nil, "Set the macro arguments." }
+ }
+ }
diff --git a/xmake/plugins/project/xmake.lua b/xmake/plugins/project/xmake.lua
index 5842486f2..2e04ddd8f 100755
--- a/xmake/plugins/project/xmake.lua
+++ b/xmake/plugins/project/xmake.lua
@@ -32,22 +32,22 @@ task("project")
on_run("main")
-- set menu
- set_menu({
- -- usage
- usage = "xmake project [options] [target]"
+ set_menu {
+ -- usage
+ usage = "xmake project [options] [target]"
- -- description
- , description = "Generate the project file."
+ -- description
+ , description = "Generate the project file."
- -- options
- , options =
- {
- {'k', "kind", "kv", "makefile", "Set the project kind."
- , " - makefile"
- , " - vs2002, vs2003, vs2005, vs2008, vs2010, vs2012, vs2013, vs2015, vs2017" }
- , {nil, "outputdir", "v", ".", "Set the output directory." }
- }
- })
+ -- options
+ , options =
+ {
+ {'k', "kind", "kv", "makefile", "Set the project kind."
+ , " - makefile"
+ , " - vs2002, vs2003, vs2005, vs2008, vs2010, vs2012, vs2013, vs2015, vs2017" }
+ , {nil, "outputdir", "v", ".", "Set the output directory." }
+ }
+ }