diff options
| author | ruki <[email protected]> | 2019-11-26 00:48:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-11-25 23:40:49 +0800 |
| commit | eaa013ce4cd12a18c8cc73b948f81dc64cd2d976 (patch) | |
| tree | 95d2b90555ae6867597c08af41131f52e0e11e38 | |
| parent | 2101b278bb3f1d15395110b25b63a8536ecffb94 (diff) | |
uses hash.uuid4
| -rw-r--r-- | core/src/xmake/makefile | 2 | ||||
| -rw-r--r-- | xmake/actions/config/configfiles.lua | 2 | ||||
| -rw-r--r-- | xmake/actions/config/configheader.lua | 4 | ||||
| -rw-r--r-- | xmake/core/base/os.lua | 2 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 2 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/hash.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/package/tools/meson.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs200x_solution.lua | 8 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_solution.lua | 8 | ||||
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua | 2 | ||||
| -rwxr-xr-x | xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 6 |
14 files changed, 23 insertions, 23 deletions
diff --git a/core/src/xmake/makefile b/core/src/xmake/makefile index 61574c552..9c2a5d15b 100644 --- a/core/src/xmake/makefile +++ b/core/src/xmake/makefile @@ -82,7 +82,7 @@ xmake_C_FILES += \ path/absolute \ path/translate \ path/is_absolute \ - hash/uuid \ + hash/uuid4 \ hash/sha256 \ string/trim \ string/convert \ diff --git a/xmake/actions/config/configfiles.lua b/xmake/actions/config/configfiles.lua index 08ef5401e..1b3544a00 100644 --- a/xmake/actions/config/configfiles.lua +++ b/xmake/actions/config/configfiles.lua @@ -124,7 +124,7 @@ function _generate_configfile(srcfile, dstfile, fileinfo, targets) end else -- generate to the temporary file first - local dstfile_tmp = path.join(os.tmpdir(), hash.uuid(srcfile)) + local dstfile_tmp = path.join(os.tmpdir(), hash.uuid4(srcfile)) os.tryrm(dstfile_tmp) os.cp(srcfile, dstfile_tmp) diff --git a/xmake/actions/config/configheader.lua b/xmake/actions/config/configheader.lua index 6acf7efd6..1d28cb3f5 100644 --- a/xmake/actions/config/configheader.lua +++ b/xmake/actions/config/configheader.lua @@ -34,7 +34,7 @@ function _make_for_target(target) local configprefix = target:configprefix() -- open the file - local file = _g.configfiles[configheader] or io.open(path.join(os.tmpdir(), hash.uuid(configheader)), "w") + local file = _g.configfiles[configheader] or io.open(path.join(os.tmpdir(), hash.uuid4(configheader)), "w") -- make the head if _g.configfiles[configheader] then file:print("") end @@ -161,7 +161,7 @@ function main() configfile_tmp:close() -- update file if the content is changed - local configpath_tmp = path.join(os.tmpdir(), hash.uuid(configpath)) + local configpath_tmp = path.join(os.tmpdir(), hash.uuid4(configpath)) if os.isfile(configpath_tmp) then if os.isfile(configpath) then if io.readfile(configpath_tmp) ~= io.readfile(configpath) then diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua index fa8576825..daee20eea 100644 --- a/xmake/core/base/os.lua +++ b/xmake/core/base/os.lua @@ -537,7 +537,7 @@ end -- generate the temporary file path function os.tmpfile(key) - return path.join(os.tmpdir(), "_" .. (hash.uuid(key):gsub("-", ""))) + return path.join(os.tmpdir(), "_" .. (hash.uuid4(key):gsub("-", ""))) end -- run command diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index e396147fa..3349239a9 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -666,7 +666,7 @@ function _instance:buildhash() if configs then str = str .. string.serialize(configs, true) end - self._BUILDHASH = hash.uuid(str):gsub('-', ''):lower() + self._BUILDHASH = hash.uuid4(str):gsub('-', ''):lower() end return self._BUILDHASH end diff --git a/xmake/core/sandbox/modules/hash.lua b/xmake/core/sandbox/modules/hash.lua index 4db755c96..a63b30998 100644 --- a/xmake/core/sandbox/modules/hash.lua +++ b/xmake/core/sandbox/modules/hash.lua @@ -25,7 +25,7 @@ local raise = require("sandbox/modules/raise") local sandbox_hash = sandbox_hash or {} -- make a new uuid -function sandbox_hash.uuid(name) +function sandbox_hash.uuid4(name) return sandbox_hash.uuid4(name) end diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 04b7faa37..8e062c56f 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -84,7 +84,7 @@ function install(package, configs, opt) opt = opt or {} -- enter build directory - local buildir = "build_" .. hash.uuid():split('%-')[1] + local buildir = "build_" .. hash.uuid4():split('%-')[1] os.mkdir(path.join(buildir, "install")) local oldir = os.cd(buildir) diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua index dac331ac9..fad23bf28 100644 --- a/xmake/modules/package/tools/meson.lua +++ b/xmake/modules/package/tools/meson.lua @@ -24,7 +24,7 @@ import("core.project.config") -- get build directory function _get_buildir() - _g.buildir = _g.buildir or ("build_" .. hash.uuid():split('%-')[1]) + _g.buildir = _g.buildir or ("build_" .. hash.uuid4():split('%-')[1]) return _g.buildir end diff --git a/xmake/plugins/project/vstudio/impl/vs200x_solution.lua b/xmake/plugins/project/vstudio/impl/vs200x_solution.lua index 1333da648..70920ba80 100644 --- a/xmake/plugins/project/vstudio/impl/vs200x_solution.lua +++ b/xmake/plugins/project/vstudio/impl/vs200x_solution.lua @@ -39,12 +39,12 @@ function _make_projects(slnfile, vsinfo) if not target:isphony() then -- enter project - slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcproj\", \"{%s}\"", vctool, targetname, targetname, targetname, hash.uuid(targetname)) + slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcproj\", \"{%s}\"", vctool, targetname, targetname, targetname, hash.uuid4(targetname)) -- add dependences for _, dep in ipairs(target:get("deps")) do slnfile:enter("ProjectSection(ProjectDependencies) = postProject") - slnfile:print("{%s} = {%s}", hash.uuid(dep), hash.uuid(dep)) + slnfile:print("{%s} = {%s}", hash.uuid4(dep), hash.uuid4(dep)) slnfile:leave("EndProjectSection") end @@ -69,8 +69,8 @@ function _make_global(slnfile, vsinfo) slnfile:enter("GlobalSection(ProjectConfigurationPlatforms) = postSolution") for targetname, target in pairs(project.targets()) do if not target:isphony() then - slnfile:print("{%s}.$(mode)|Win32.ActiveCfg = $(mode)|Win32", hash.uuid(targetname)) - slnfile:print("{%s}.$(mode)|Win32.Build.0 = $(mode)|Win32", hash.uuid(targetname)) + slnfile:print("{%s}.$(mode)|Win32.ActiveCfg = $(mode)|Win32", hash.uuid4(targetname)) + slnfile:print("{%s}.$(mode)|Win32.Build.0 = $(mode)|Win32", hash.uuid4(targetname)) end end slnfile:leave("EndGlobalSection") diff --git a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua index 24310bf7d..cd27a9655 100644 --- a/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs200x_vcproj.lua @@ -120,7 +120,7 @@ function _make_header(vcprojfile, vsinfo, target) vcprojfile:print("ProjectType=\"Visual C++\"") vcprojfile:print("Version=\"%s0\"", assert(vsinfo.project_version)) vcprojfile:print("Name=\"%s\"", targetname) - vcprojfile:print("ProjectGUID=\"{%s}\"", hash.uuid(targetname)) + vcprojfile:print("ProjectGUID=\"{%s}\"", hash.uuid4(targetname)) vcprojfile:print("RootNamespace=\"%s\"", targetname) vcprojfile:print("TargetFrameworkVersion=\"196613\"") vcprojfile:print(">") diff --git a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua index cfcc20509..23072b8b5 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_solution.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_solution.lua @@ -39,12 +39,12 @@ function _make_projects(slnfile, vsinfo) if not target:isphony() then -- enter project - slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcxproj\", \"{%s}\"", vctool, targetname, targetname, targetname, hash.uuid(targetname)) + slnfile:enter("Project(\"{%s}\") = \"%s\", \"%s\\%s.vcxproj\", \"{%s}\"", vctool, targetname, targetname, targetname, hash.uuid4(targetname)) -- add dependences for _, dep in ipairs(target:get("deps")) do slnfile:enter("ProjectSection(ProjectDependencies) = postProject") - slnfile:print("{%s} = {%s}", hash.uuid(dep), hash.uuid(dep)) + slnfile:print("{%s} = {%s}", hash.uuid4(dep), hash.uuid4(dep)) slnfile:leave("EndProjectSection") end @@ -75,8 +75,8 @@ function _make_global(slnfile, vsinfo) if not target:isphony() then for _, mode in ipairs(vsinfo.modes) do for _, arch in ipairs(vsinfo.archs) do - slnfile:print("{%s}.%s|%s.ActiveCfg = %s|%s", hash.uuid(targetname), mode, arch, mode, arch) - slnfile:print("{%s}.%s|%s.Build.0 = %s|%s", hash.uuid(targetname), mode, arch, mode, arch) + slnfile:print("{%s}.%s|%s.ActiveCfg = %s|%s", hash.uuid4(targetname), mode, arch, mode, arch) + slnfile:print("{%s}.%s|%s.Build.0 = %s|%s", hash.uuid4(targetname), mode, arch, mode, arch) end end end diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua index 65a6bad0a..db9d91618 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj.lua @@ -187,7 +187,7 @@ function _make_configurations(vcxprojfile, vsinfo, target, vcxprojdir) -- make Globals vcxprojfile:enter("<PropertyGroup Label=\"Globals\">") - vcxprojfile:print("<ProjectGuid>{%s}</ProjectGuid>", hash.uuid(targetname)) + vcxprojfile:print("<ProjectGuid>{%s}</ProjectGuid>", hash.uuid4(targetname)) vcxprojfile:print("<RootNamespace>%s</RootNamespace>", targetname) if vsinfo.vstudio_version >= "2015" then vcxprojfile:print("<WindowsTargetPlatformVersion>%s</WindowsTargetPlatformVersion>", _get_platform_sdkver(target, vsinfo)) diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua index d241dd909..880835f52 100755 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua @@ -76,7 +76,7 @@ function _make_filters(filtersfile, vsinfo, target, vcxprojdir) while filter and filter ~= '.' do
if not exists[filter] then
filtersfile:enter("<Filter Include=\"%s\">", filter)
- filtersfile:print("<UniqueIdentifier>{%s}</UniqueIdentifier>", hash.uuid(filter))
+ filtersfile:print("<UniqueIdentifier>{%s}</UniqueIdentifier>", hash.uuid4(filter))
filtersfile:leave("</Filter>")
exists[filter] = true
end
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index 4f9c4e5d6..60f91447b 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -280,7 +280,7 @@ function main(outputdir, vsinfo) end vsinfo.xmake_info = format("xmake version %s", xmake.version()) - vsinfo.solution_id = hash.uuid(project.directory() .. vsinfo.solution_dir) + vsinfo.solution_id = hash.uuid4(project.directory() .. vsinfo.solution_dir) vsinfo.vs_version = vsinfo.project_version .. ".0" -- init modes @@ -337,7 +337,7 @@ function main(outputdir, vsinfo) -- init target info _target.target = targetname _target.vcxprojdir = path.join(vsinfo.solution_dir, targetname) - _target.target_id = hash.uuid(targetname) + _target.target_id = hash.uuid4(targetname) _target.kind = target:targetkind() _target.scriptdir = path.relative(target:scriptdir(), _target.vcxprojdir) _target.projectdir = path.relative(project.directory(), _target.vcxprojdir) @@ -382,7 +382,7 @@ function main(outputdir, vsinfo) dirs[dir] = { dir = _escape(dir), - dir_id = hash.uuid(dir) + dir_id = hash.uuid4(dir) } end dir = path.directory(dir) |
