diff options
| author | ruki <[email protected]> | 2015-06-04 09:01:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-04 09:01:53 +0800 |
| commit | 282c12b8f7b9b01a85844326c28f6bc3529aa088 (patch) | |
| tree | 2f7557c695789276022f8f8094ac17f3e90c2357 | |
| parent | a73db10e9b42c8b18bf5b95d78855481beb67f20 (diff) | |
adjust global and config directory
| -rwxr-xr-x | .gitignore | 2 | ||||
| -rw-r--r-- | tests/console/.xmake.xconf | 23 | ||||
| -rw-r--r-- | xmake/scripts/base/config.lua | 23 | ||||
| -rw-r--r-- | xmake/scripts/base/global.lua | 30 |
4 files changed, 57 insertions, 21 deletions
diff --git a/.gitignore b/.gitignore index fe82d6803..e2ed6d817 100755 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ .demo .svn .DS_Store -.xmake.xconf +.xmake cscope.* gmon.out other diff --git a/tests/console/.xmake.xconf b/tests/console/.xmake.xconf new file mode 100644 index 000000000..0a855eee1 --- /dev/null +++ b/tests/console/.xmake.xconf @@ -0,0 +1,23 @@ +config:
+{
+ __vsenv_devenvdir: "C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE"
+ __vsenv_vsinstalldir: "C:\\Program Files\\Microsoft Visual Studio 9.0"
+ plat: "windows"
+ entitlements: "auto"
+ buildir: "build"
+ codesign: "auto"
+ arch: "x86"
+ __vsenv_libpath: "C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\ATLMFC\\LIB;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\LIB;"
+ __vsenv_include: "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\ATLMFC\\INCLUDE;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\INCLUDE;C:\\Program Files\\\\Microsoft SDKs\\Windows\\v6.0A\\include;"
+ __vsenv_vcinstalldir: "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC"
+ __vsenv_path: "C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\BIN;C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\Tools;C:\\WINDOWS\\Microsoft.NET\\Framework\\v3.5;C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\VCPackages;C:\\Program Files\\\\Microsoft SDKs\\Windows\\v6.0A\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\Program Files\\Bitvise SSH Client;C:\\Program Files\\Kingsoft\\WPSOffice\\9.1.0.4993\\office6;C:\\Program Files\\xmake"
+ __vsenv_lib: "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\ATLMFC\\LIB;C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\LIB;C:\\Program Files\\\\Microsoft SDKs\\Windows\\v6.0A\\lib;"
+ host: "windows"
+ ndk_sdkver: "auto"
+ xcode_sdkver: "auto"
+ xcode_dir: "auto"
+ packages: "pkg"
+ vs: "2008"
+ mode: "release"
+ mobileprovision: "auto"
+}
diff --git a/xmake/scripts/base/config.lua b/xmake/scripts/base/config.lua index 7b6ef01b9..05edfc555 100644 --- a/xmake/scripts/base/config.lua +++ b/xmake/scripts/base/config.lua @@ -177,12 +177,8 @@ end -- get the configure file function config._file() - -- the options - local options = xmake._OPTIONS - assert(options and options.project) - - -- get the configure file - return options.project .. "/.xmake.xconf" + -- get it + return config.directory() .. "/xmake.xconf" end -- get the current target scope @@ -243,6 +239,21 @@ function config.set(name, value) config._CURRENT[name] = value end +-- get the configure directory +function config.directory() + + -- the directory + local dir = xmake._PROJECT_DIR .. "/.xmake" + + -- create it directly first if not exists + if not os.isdir(dir) then + assert(os.mkdir(dir)) + end + + -- get it + return dir +end + -- save xmake.xconf function config.savexconf() diff --git a/xmake/scripts/base/global.lua b/xmake/scripts/base/global.lua index d1faff4b9..9e43213ee 100644 --- a/xmake/scripts/base/global.lua +++ b/xmake/scripts/base/global.lua @@ -130,7 +130,7 @@ end function global._file() -- get it - return path.translate("~/.xmake/xmake.xconf") + return global.directory() .. "/xmake.xconf" end -- get the given configure from the current @@ -164,6 +164,21 @@ function global.set(name, value) end +-- get the global configure directory +function global.directory() + + -- the directory + local dir = path.translate("~/.xmake") + + -- create it directly first if not exists + if not os.isdir(dir) then + assert(os.mkdir(dir)) + end + + -- get it + return dir +end + -- save xmake.xconf function global.savexconf() @@ -171,11 +186,6 @@ function global.savexconf() local configs = global._CONFIGS assert(configs) - -- create directly first if not exists - if not os.isdir("~/.xmake") then - assert(os.mkdir("~/.xmake")) - end - -- open the configure file local path = global._file() local file = io.open(path, "w") @@ -285,13 +295,5 @@ function global.dump() end --- clean the current configure -function global.clean() - - -- remove the configure file - os.rm(global._file()) - -end - -- return module: global return global |
