diff options
| author | ruki <[email protected]> | 2015-05-14 16:10:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-05-14 16:10:38 +0800 |
| commit | a2c560f7c2f1f4501516d39225d5afdd06dc9c55 (patch) | |
| tree | df065551823a4903e04e5a246734618d89b68405 | |
| parent | b303b16817e3773c729f2cd1096d685b491db75b (diff) | |
rename _ROOT to _CONFIGS
| -rwxr-xr-x | .gitignore | 2 | ||||
| -rwxr-xr-x | core/src/xmake/preprocessor/load_xproj.c | 4 | ||||
| -rw-r--r-- | tests/console/xmake.xconf | 13 | ||||
| -rw-r--r-- | xmake/scripts/base/main.lua | 15 | ||||
| -rw-r--r-- | xmake/scripts/base/project.lua | 8 |
5 files changed, 15 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore index c599864e5..68f9ebc14 100755 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ .demo .svn .DS_Store -xmake.conf +xmake.xconf cscope.* gmon.out other diff --git a/core/src/xmake/preprocessor/load_xproj.c b/core/src/xmake/preprocessor/load_xproj.c index 4930f4313..a13fb0dc6 100755 --- a/core/src/xmake/preprocessor/load_xproj.c +++ b/core/src/xmake/preprocessor/load_xproj.c @@ -221,10 +221,10 @@ tb_int_t xm_preprocessor_load_xproj(lua_State* lua) tb_char_t const* xproj = xm_preprocessor_load_xproj_to_string(stream, &string); tb_assert_and_check_break(xproj); - tb_printf("%s", xproj); + // trace + tb_trace_d("%s", xproj); // load xmake.xproj string to script - //if (luaL_loadstring(lua, "project(\"console\")\nscopend()")) if (luaL_loadstring(lua, xproj)) { // error diff --git a/tests/console/xmake.xconf b/tests/console/xmake.xconf deleted file mode 100644 index 78eb158ee..000000000 --- a/tests/console/xmake.xconf +++ /dev/null @@ -1,13 +0,0 @@ -return -{ - all = - { - plat = "macosx" - , arch = "x64" - , host = "macosx" - , output = "build" - , mode = "release" - , packages = "pkg" - } - -} diff --git a/xmake/scripts/base/main.lua b/xmake/scripts/base/main.lua index 7754f1d6b..04d3d9e52 100644 --- a/xmake/scripts/base/main.lua +++ b/xmake/scripts/base/main.lua @@ -60,7 +60,7 @@ local menu = , {'r', "rebuild", "k", nil, "Rebuild the project." } , {} - , {'f', "file", "kv", "xmake.xproj", "Read a given xmake.xproj file." } + , {'f', "file", "kv", "xmake.xproj","Read a given xmake.xproj file." } , {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" , " 1. the given command argument" @@ -94,7 +94,7 @@ local menu = , options = { {'n', "name", "kv", nil, "The project name." } - , {'f', "file", "kv", "xmake.xproj", "Create a given xmake.xproj file." } + , {'f', "file", "kv", "xmake.xproj","Create a given xmake.xproj file." } , {'P', "project", "kv", nil, "Create from the given project directory." , "Search priority:" , " 1. the given command argument" @@ -173,7 +173,7 @@ local menu = , {nil, "arflags", "kv", nil, "The library creator flags" } , {} - , {'f', "file", "kv", "xmake.xproj", "Read a given xmake.xproj file." } + , {'f', "file", "kv", "xmake.xproj","Read a given xmake.xproj file." } , {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" , " 1. the given command argument" @@ -206,7 +206,7 @@ local menu = -- options , options = { - {'f', "file", "kv", "xmake.xproj", "Read a given xmake.xproj file." } + {'f', "file", "kv", "xmake.xproj","Read a given xmake.xproj file." } , {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" , " 1. the given command argument" @@ -239,7 +239,7 @@ local menu = -- options , options = { - {'f', "file", "kv", "xmake.xproj", "Read a given xmake.xproj file." } + {'f', "file", "kv", "xmake.xproj","Read a given xmake.xproj file." } , {'P', "project", "kv", nil, "Change to the given project directory." , "Search priority:" , " 1. the given command argument" @@ -295,8 +295,6 @@ function main._done_option() errors = string.format("load %s failed!", options.file) end - utils.dump(project._ROOT, "", "_PARENT") - -- done help if options.help then @@ -330,6 +328,9 @@ function main._done_option() -- save project xmake._PROJECT = project + -- dump project configs +-- utils.dump(xmake._PROJECT._CONFIGS, "", "_PARENT") + -- done action return action.done(options._ACTION or "build") end diff --git a/xmake/scripts/base/project.lua b/xmake/scripts/base/project.lua index e208ea726..5ed4229f0 100644 --- a/xmake/scripts/base/project.lua +++ b/xmake/scripts/base/project.lua @@ -101,8 +101,8 @@ function project(name) assert(name) -- init the root scope, must be only one project - if not _ROOT then - _ROOT = {} + if not _CONFIGS then + _CONFIGS = {} else -- error utils.error("the project: %s is redundant!", name) @@ -110,10 +110,10 @@ function project(name) end -- init the project name - _ROOT.name = name + _CONFIGS.name = name -- init the current scope - current = _ROOT + current = _CONFIGS current._PARENT = nil end |
