Removing unneded cruft
This commit is contained in:
parent
a7063178d1
commit
78efcff4b2
1
.gitignore
vendored
1
.gitignore
vendored
@ -89,6 +89,7 @@ m4/lt~obsolete.m4
|
||||
Makefile
|
||||
*.deps
|
||||
.dirstamp
|
||||
vim-debug
|
||||
*-build/*
|
||||
bin/*
|
||||
build/*
|
||||
|
@ -1,53 +1,130 @@
|
||||
" quartz-warriors/local.vimrc
|
||||
" License: The Unlicense {
|
||||
" This is free and unencumbered software released into the public domain.
|
||||
|
||||
" editorconfig/local.vimrc
|
||||
" Copyright © 2023 Saul D. Beniquez @{
|
||||
"
|
||||
" Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
" distribute this software, either in source code form or as a compiled
|
||||
" binary, for any purpose, commercial or non-commercial, and by any
|
||||
" means.
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
" modification, are permitted provided that the following conditions are met:
|
||||
"
|
||||
" In jurisdictions that recognize copyright laws, the author or authors
|
||||
" of this software dedicate any and all copyright interest in the
|
||||
" software to the public domain. We make this dedication for the benefit
|
||||
" of the public at large and to the detriment of our heirs and
|
||||
" successors. We intend this dedication to be an overt act of
|
||||
" relinquishment in perpetuity of all present and future rights to this
|
||||
" software under copyright law.
|
||||
" 1. Redistributions of source code must retain the above copyright notice,
|
||||
" this list of conditions and the following disclaimer.
|
||||
"
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
" IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
" OTHER DEALINGS IN THE SOFTWARE.
|
||||
" 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
" this list of conditions and the following disclaimer in the documentation
|
||||
" and/or other materials provided with the distribution.
|
||||
"
|
||||
" For more information, please refer to <http://unlicense.org/>
|
||||
" }
|
||||
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
|
||||
" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
" POSSIBILITY OF SUCH DAMAGE. @}
|
||||
|
||||
let s:build_dir = 'vim-debug'
|
||||
let s:build_cores = 2
|
||||
let s:make_args = '-C '. s:build_dir . ' -j ' . s:build_cores
|
||||
|
||||
let s:cmake_path = system('which ' . 'cmake')
|
||||
let s:ninja_path = system('which ' . 'ninja')
|
||||
|
||||
let s:cmake_generator = 'Unix Makefiles'
|
||||
if (s:ninja_path != '')
|
||||
let s:cmake_generator = 'Ninja'
|
||||
endif
|
||||
|
||||
if (s:cmake_path != '')
|
||||
let s:cmake_call = s:cmake_path .
|
||||
\' -B ' . s:build_dir .
|
||||
\' -D ' . 'CMAKE_BUILD_TYPE=Debug' .
|
||||
\' -G ' . s:cmake_generator
|
||||
endif
|
||||
|
||||
let s:make_call = 'make ' . s:make_args
|
||||
let s:ninja_call = 'ninja ' . s:make_args
|
||||
|
||||
if ! get(s:, 'defined', 0) " -- prevents the function from being redefined after compiling
|
||||
function! BuildDebug()
|
||||
let s:defined = 1
|
||||
function! BuildDebug()
|
||||
let s:defined = 1
|
||||
|
||||
wall
|
||||
cd ./debug
|
||||
wall
|
||||
|
||||
if (s:ninja_path != '')
|
||||
if (
|
||||
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
||||
\ (!filereadable(s:build_dir . '/build.ninja'))
|
||||
\ )
|
||||
|
||||
|
||||
exec ':Dispatch ' . s:cmake_call
|
||||
endif
|
||||
|
||||
set makeprg='ninja'
|
||||
exec ':Make ' . s:make_args
|
||||
else
|
||||
if (
|
||||
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
||||
\ (!filereadable(s:build_dir . '/Makefile'))
|
||||
\ )
|
||||
exec ':Dispatch ' . s:cmake_call
|
||||
endif
|
||||
|
||||
if exists(':Make')
|
||||
:Make -j 2 all check
|
||||
exec ':Make ' . s:make_args
|
||||
cd ..
|
||||
else
|
||||
make -j 2 all check
|
||||
exec 'make ' . s:make_args
|
||||
vert botright copen
|
||||
vert resize +100
|
||||
endif
|
||||
endif
|
||||
|
||||
endfunction
|
||||
endfunction
|
||||
|
||||
function RunTests()
|
||||
let s:defined = 1
|
||||
if (s:ninja_path != '')
|
||||
if (
|
||||
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
||||
\ (!filereadable(s:build_dir . '/build.ninja'))
|
||||
\ )
|
||||
|
||||
|
||||
exec ':Dispatch ' . s:cmake_call
|
||||
endif
|
||||
|
||||
set makeprg='ninja'
|
||||
exec ':Make ' . s:make_args. ' ctest'
|
||||
else
|
||||
if (
|
||||
\ (!filereadable(s:build_dir . '/CMakeCache.txt')) ||
|
||||
\ (!filereadable(s:build_dir . '/Makefile'))
|
||||
\ )
|
||||
exec ':Dispatch ' . s:cmake_call
|
||||
endif
|
||||
|
||||
if exists(':Make')
|
||||
exec ':Make ' . s:make_args . ' ctest'
|
||||
cd ..
|
||||
else
|
||||
exec 'make ' . s:make_args . ' ctest'
|
||||
vert botright copen
|
||||
vert resize +100
|
||||
endif
|
||||
endif
|
||||
|
||||
endfunction
|
||||
endif
|
||||
|
||||
nnoremap <leader>bd :call BuildDebug()<CR>
|
||||
nnoremap <leader>rt :call RunTests()<CR>
|
||||
|
||||
set path+=src
|
||||
set path+=include
|
||||
set path+=app
|
||||
|
||||
|
||||
" vim: set ts=4 sts=4 noet sw=4 foldmethod=marker foldmarker={,} :
|
||||
" vim: set ts=4 sts=4 noet sw=4 foldmethod=marker foldmarker=@{,@} :
|
||||
|
@ -1,37 +0,0 @@
|
||||
|
||||
VIM_COMPLETION_OBJECTS=src/framework/core/libframework_core_la-Observable.lo\
|
||||
src/framework/core/input/libframework_core_test_la-EventDispatcher.lo\
|
||||
src/framework/core/input/libframework_core_la-EventDispatcher.lo\
|
||||
src/framework/core/libframework_core_test_la-Observable.lo\
|
||||
src/framework/core/components/libframework_core_test_la-EntityManager.lo\
|
||||
src/framework/core/components/libframework_core_la-PositionAttribute.lo\
|
||||
src/framework/core/components/libframework_core_test_la-Entity.lo\
|
||||
src/framework/core/components/libframework_core_la-EntityManager.lo\
|
||||
src/framework/core/components/libframework_core_la-PlayerBehavior.lo\
|
||||
src/framework/core/components/libframework_core_test_la-PositionAttribute.lo\
|
||||
src/framework/core/components/libframework_core_test_la-PlayerBehavior.lo\
|
||||
src/framework/core/components/libframework_core_la-Entity.lo\
|
||||
src/framework/system/libframework_system_la-sdl.lo\
|
||||
src/tests/game_tests-runtime.tests.o\
|
||||
src/tests/framework/types/adapters/game_tests-Sequential.test.o
|
||||
|
||||
if HAVE_COMPILEDB
|
||||
clean-vim-complete:
|
||||
rm -rf ${VIM_COMPLETION_OBJECTS} 1> /dev/null
|
||||
|
||||
@abs_top_srcdir@/compile_commands.json:
|
||||
nice -20 /bin/sh -c "compiledb `basename ${MAKE}` -j 8 ${VIM_COMPLETION_OBJECTS}"
|
||||
rm -vf @abs_top_srcdir@/compile_commands.json
|
||||
ln -sv @abs_top_builddir@/compile_commands.json @abs_top_srcdir@
|
||||
|
||||
phony_targets+= clean_vim_complete @abs_top_srcdir@/compile_commands.json
|
||||
vim-completion: clean-vim-complete @abs_top_srcdir@/compile_commands.json
|
||||
|
||||
else
|
||||
vim-completion:
|
||||
echo "compiledb not found; vim-completion disabled"
|
||||
endif
|
||||
|
||||
# vim: sts=4 ts=4 noet ft=automake :
|
||||
|
||||
|
169
hooks/pre-commit
169
hooks/pre-commit
@ -1,169 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# An example hook script to verify what is about to be committed.
|
||||
# Called by "git commit" with no arguments. The hook should
|
||||
# exit with non-zero status after issuing an appropriate message if
|
||||
# it wants to stop the commit.
|
||||
#
|
||||
# To enable this hook, rename this file to "pre-commit".
|
||||
# Redirect output to stderr.
|
||||
|
||||
trap restore_stashed_files 1 2 3 6 15
|
||||
|
||||
# The number of historical CI builds to keep
|
||||
build_count_max=5
|
||||
|
||||
proj_root="${PWD}"
|
||||
workdir_root="${PWD}/.workdir"
|
||||
my_builddir="${workdir_root}/$(date +"%Y.%m.%d").$(whoami)"
|
||||
stash_name="pre-commit-$(date +%s)"
|
||||
diff_against=HEAD # default value
|
||||
|
||||
# Detect diff reference {
|
||||
if git rev-parse --verify ${diff_against} >/dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
# Initial commit: diff against an empty tree object
|
||||
diff_against=$(git hash-object -t tree /dev/null)
|
||||
fi
|
||||
# }
|
||||
|
||||
# function definitions
|
||||
debugecho() {
|
||||
if [ -n "$GITDEBUG" ]; then
|
||||
echo "${@}"
|
||||
fi
|
||||
}
|
||||
hook_env() {
|
||||
debugecho "\$PWD: ${PWD}"
|
||||
}
|
||||
show_diff() {
|
||||
# If there are whitespace errors, print the offending file names and fail.
|
||||
exec git diff-index --check --cached $against --
|
||||
}
|
||||
stash_unstaged() {
|
||||
git stash save -q --keep-index ${stash_name}
|
||||
}
|
||||
restore_stashed_files() {
|
||||
if [ -n "$(git stash list | grep "${stash_name}")" ]; then
|
||||
git stash pop -q
|
||||
fi
|
||||
}
|
||||
validate_filename() {
|
||||
# If you want to allow non-ASCII filenames set this variable to true.
|
||||
# - I do. It's 2021, unicode is a thing.
|
||||
allownonascii=$(git config --type=bool hooks.allownonascii)
|
||||
|
||||
# Cross platform projects tend to avoid non-ASCII filenames; prevent
|
||||
# them from being added to the repository. We exploit the fact that the
|
||||
# printable range starts at the space character and ends with tilde.
|
||||
if [ "$allownonascii" != "true" ]; then
|
||||
# Note that the use of brackets around a tr range is ok here, (it's
|
||||
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
||||
# the square bracket bytes happen to fall in the designated range.
|
||||
if [ $(git diff --cached --name-only --diff-filter=A -z $against |
|
||||
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 ]
|
||||
then
|
||||
|
||||
exec 1>&2
|
||||
cat <<-EOF
|
||||
Error: Attempt to add a non-ASCII file name.
|
||||
|
||||
This can cause problems if you want to work with people on other platforms.
|
||||
|
||||
To be portable it is advisable to rename the file.
|
||||
|
||||
If you know what you are doing you can disable this check using:
|
||||
|
||||
git config hooks.allownonascii true
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
recycle_dirs() {
|
||||
if [ ! -d "${workdir_root}" ]; then
|
||||
mkdir "${workdir_root}"
|
||||
fi
|
||||
|
||||
existing_builds=`ls -tr ${workdir_root}`
|
||||
oldest_build=""
|
||||
num_builds=0;
|
||||
|
||||
debugecho "builds:"
|
||||
|
||||
for file in ${existing_builds}; do
|
||||
if [ -z "$oldest_build" ]; then oldest_build=${workdir_root}/$file; fi
|
||||
|
||||
((num_builds++))
|
||||
debugecho "- ${file}"
|
||||
done
|
||||
debugecho "\nnum: ${num_builds}"
|
||||
|
||||
if [ ${num_builds} -ge ${build_count_max} ] ; then
|
||||
debugecho "$oldest_build"
|
||||
|
||||
rm -r "${oldest_build}"
|
||||
fi
|
||||
}
|
||||
create_symlinks() {
|
||||
symlink_path="${workdir_root}/latest"
|
||||
symlink_target="$(basename ${my_builddir})"
|
||||
|
||||
if [ -L "${symlink_path}" ] &&
|
||||
[ "$(readlink ${symlink_path})" != "${symlink_target}" ]
|
||||
then
|
||||
unlink "${symlink_path}"
|
||||
fi
|
||||
|
||||
[ ! -L "${symlink_path}" ] &&
|
||||
ln -s "${symlink_target}" "${symlink_path}"
|
||||
|
||||
[ ! -L "${workdir_root}/configure" ] &&
|
||||
ln -s "${proj_root}/configure" "${workdir_root}"
|
||||
[ ! -L "${workdir_root}/debug.env" ] &&
|
||||
ln -s "${proj_root}/debug.env" "${workdir_root}"
|
||||
|
||||
}
|
||||
setup_builddir() {
|
||||
recycle_dirs "${workdir_root}"
|
||||
|
||||
[ ! -d "${my_builddir}" ] && mkdir "${my_builddir}"
|
||||
|
||||
create_symlinks
|
||||
|
||||
}
|
||||
build() {
|
||||
setup_builddir
|
||||
|
||||
cd "${my_builddir}"
|
||||
|
||||
if [ ! -f config.status ]
|
||||
then
|
||||
source ../debug.env
|
||||
sh ${proj_root}/configure
|
||||
fi
|
||||
make -j 2 qw-test
|
||||
}
|
||||
run_test() {
|
||||
build
|
||||
|
||||
if ./qw-test; then
|
||||
:
|
||||
else
|
||||
>&2
|
||||
echo "Tests failed. Commit aborted"
|
||||
fi
|
||||
}
|
||||
|
||||
## Begin script
|
||||
|
||||
hook_env
|
||||
validate_filename
|
||||
stash_unstaged
|
||||
|
||||
run_test
|
||||
|
||||
restore_stashed_files
|
||||
|
||||
# vim: set foldmethod=marker foldmarker={,} ts=4 sw=4 sts=0 noet:
|
0
third_party/.keep
vendored
0
third_party/.keep
vendored
Loading…
Reference in New Issue
Block a user