aboutsummaryrefslogtreecommitdiff
path: root/scripts/bump_deps.lua
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-05-03 00:31:07 +0200
committerGitHub <noreply@github.com>2023-05-03 00:31:07 +0200
commit9909668111f521c7fc829ec8d8aa89beafff8777 (patch)
treeeeffe92474e7d4b88ced322ee82df62fd1360df3 /scripts/bump_deps.lua
parent540941ef8320e2005fe65e6776fc1068f18543c6 (diff)
downloadrneovim-9909668111f521c7fc829ec8d8aa89beafff8777.tar.gz
rneovim-9909668111f521c7fc829ec8d8aa89beafff8777.tar.bz2
rneovim-9909668111f521c7fc829ec8d8aa89beafff8777.zip
build: create a text file for specifying dependency information
The cmake.deps build will read this file and set the left part of the text as the variable name and the right part as the variable value. The benefit of doing this is that it becomes much easier to parse which dependencies are required, as well as to bump dependencies with scripts/bump_deps.lua. Adjust bump_deps.lua script to work with this new format.
Diffstat (limited to 'scripts/bump_deps.lua')
-rwxr-xr-xscripts/bump_deps.lua20
1 files changed, 8 insertions, 12 deletions
diff --git a/scripts/bump_deps.lua b/scripts/bump_deps.lua
index f980e800cf..6a049d136a 100755
--- a/scripts/bump_deps.lua
+++ b/scripts/bump_deps.lua
@@ -63,6 +63,7 @@ local function rm_file_if_present(path_to_file)
end
local nvim_src_dir = vim.fn.getcwd()
+local deps_file = nvim_src_dir .. '/' .. 'cmake.deps/deps.txt'
local temp_dir = nvim_src_dir .. '/tmp'
run({ 'mkdir', '-p', temp_dir })
@@ -127,26 +128,24 @@ end
local function write_cmakelists_line(symbol, kind, value)
require_executable('sed')
- local cmakelists_path = nvim_src_dir .. '/' .. 'cmake.deps/CMakeLists.txt'
run_die({
'sed',
'-i',
'-e',
- 's/set('
+ 's/'
.. symbol
.. '_'
.. kind
.. '.*$'
- .. '/set('
+ .. '/'
.. symbol
.. '_'
.. kind
.. ' '
.. value
- .. ')'
.. '/',
- cmakelists_path,
- }, 'Failed to write ' .. cmakelists_path)
+ deps_file,
+ }, 'Failed to write ' .. deps_file)
end
local function explicit_create_branch(dep)
@@ -181,8 +180,6 @@ local function update_cmakelists(dependency, archive, comment)
verify_branch(dependency.name)
- local changed_file = nvim_src_dir .. '/' .. 'cmake.deps/CMakeLists.txt'
-
p('Updating ' .. dependency.name .. ' to ' .. archive.url .. '\n')
write_cmakelists_line(dependency.symbol, 'URL', archive.url:gsub('/', '\\/'))
write_cmakelists_line(dependency.symbol, 'SHA256', archive.sha)
@@ -190,7 +187,7 @@ local function update_cmakelists(dependency, archive, comment)
{
'git',
'commit',
- changed_file,
+ deps_file,
'-m',
commit_prefix .. 'bump ' .. dependency.name .. ' to ' .. comment,
},
@@ -201,10 +198,9 @@ end
local function verify_cmakelists_committed()
require_executable('git')
- local cmakelists_path = nvim_src_dir .. '/' .. 'cmake.deps/CMakeLists.txt'
run_die(
- { 'git', 'diff', '--quiet', 'HEAD', '--', cmakelists_path },
- cmakelists_path .. ' has uncommitted changes'
+ { 'git', 'diff', '--quiet', 'HEAD', '--', deps_file },
+ deps_file .. ' has uncommitted changes'
)
end