diff options
| author | ruki <[email protected]> | 2019-08-24 10:42:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-24 10:42:04 +0800 |
| commit | 847d92387d6e1fabf485ff6a862f90512f540adf (patch) | |
| tree | 8f3e439e9f2aa4aa98d28f81df07e5349169cc14 | |
| parent | 6422ae9da759b5046d19f86aa0e976c7d02f14d1 (diff) | |
fix scripts and ci
| -rw-r--r-- | .appveyor.yml | 4 | ||||
| -rw-r--r-- | .travis.yml | 4 | ||||
| -rwxr-xr-x | scripts/archive-all.sh | 2 | ||||
| -rwxr-xr-x | scripts/makeself/build-runfile.sh | 6 | ||||
| -rw-r--r-- | xmake/modules/private/utils/bcsave.lua | 13 |
5 files changed, 20 insertions, 9 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 0380e11f7..f5be1a39e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -50,7 +50,9 @@ build_script: - ps: Copy-Item -Force .\core\build\xmake.exe $(Get-Command xmake).Path - ps: (Get-Command xmake).FileVersionInfo.ProductVersion # use bitcodes - - ps: xmake l private.utils.bcsave -o bcxmake xmake + - ps: xmake l private.utils.bcsave -x 'scripts/**|templates/**' -o bcxmake xmake + - ps: Rename-item xmake/scripts bcxmake/scripts + - ps: Rename-item xmake/templates bcxmake/templates - ps: Remove-Item xmake -Recurse - ps: Rename-Item bcxmake xmake - ps: (Get-Command xmake).FileVersionInfo.ProductVersion diff --git a/.travis.yml b/.travis.yml index f6029ec48..22f5b363e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,9 @@ script: - export XMAKE_PROGRAM_DIR=~/.local/share/xmake - cp core/build/xmake "$XMAKE_PROGRAM_DIR" || sudo cp core/build/xmake "$XMAKE_PROGRAM_DIR" - xmake --version - - xmake l private.utils.bcsave -o bcxmake xmake + - xmake l private.utils.bcsave -x 'scripts/**|templates/**' -o bcxmake xmake + - mv xmake/scripts bcxmake/scripts + - mv xmake/templates bcxmake/templates - rm -rf xmake - mv bcxmake xmake - xmake --version diff --git a/scripts/archive-all.sh b/scripts/archive-all.sh index ff39e5257..bd663ca19 100755 --- a/scripts/archive-all.sh +++ b/scripts/archive-all.sh @@ -17,8 +17,8 @@ git submodule foreach git clean -dfX # copy files to tmpdir/xmake mkdir -p $tmpdir/xmake/scripts -xmake l -v private.utils.bcsave -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit cd $tmpdir/repo || exit +xmake l -v private.utils.bcsave -x 'scripts/**|templates/**' -o bcxmake xmake || exit cp -r ./core $tmpdir/xmake mv bcxmake $tmpdir/xmake/xmake cp ./scripts/get.sh $tmpdir/xmake/scripts diff --git a/scripts/makeself/build-runfile.sh b/scripts/makeself/build-runfile.sh index 5a204bcea..471f6700e 100755 --- a/scripts/makeself/build-runfile.sh +++ b/scripts/makeself/build-runfile.sh @@ -19,10 +19,12 @@ git submodule foreach git clean -dfX # copy files to tmpdir/xmake mkdir -p $tmpdir/xmake/scripts -xmake l -v private.utils.bcsave -o $tmpdir/repo/bcxmake $tmpdir/repo/xmake || exit cd $tmpdir/repo || exit -cp -r ./core $tmpdir/xmake +xmake l -v private.utils.bcsave -x 'scripts/**|templates/**' -o bcxmake xmake || exit +mv xmake/scripts bcxmake/scripts +mv xmake/templates bcxmake/templates mv bcxmake $tmpdir/xmake/xmake +cp -r ./core $tmpdir/xmake cp ./scripts/get.sh $tmpdir/xmake/scripts cp ./*.md $tmpdir/xmake cp makefile $tmpdir/xmake diff --git a/xmake/modules/private/utils/bcsave.lua b/xmake/modules/private/utils/bcsave.lua index 7aeeb4bef..528b3ec91 100644 --- a/xmake/modules/private/utils/bcsave.lua +++ b/xmake/modules/private/utils/bcsave.lua @@ -25,9 +25,10 @@ import("lib.luajit.bcsave") -- the options local options = { - {'s', "strip", "k", false, "Strip the debug info." } -, {'o', "outputdir", "kv", nil, "Set the output directory of bitcode files." } -, {nil, "sourcedir", "v", os.programdir(), "Set the directory of lua source files." } + {'s', "strip", "k", false, "Strip the debug info." } +, {'o', "outputdir", "kv", nil, "Set the output directory of bitcode files." } +, {'x', "excludedirs", "kv", nil, "Set the excluded directories." } +, {nil, "sourcedir", "v", os.programdir(), "Set the directory of lua source files." } } -- save lua files to bitcode files in the given directory @@ -49,7 +50,11 @@ function save(sourcedir, outputdir, opt) local oldir = os.cd(sourcedir) local total_lua = 0 local total_bc = 0 - for _, luafile in ipairs(os.files(path.join(sourcedir, "**.lua"))) do + local pattern = path.join(sourcedir, "**.lua") + if opt.excludedirs then + pattern = pattern .. "|" .. opt.excludedirs + end + for _, luafile in ipairs(os.files(pattern)) do -- get relative lua file path to decrease bitcode file size (without strip) luafile = path.relative(luafile, sourcedir) |
