Add scripts to generate hscope db and tags

This commit is contained in:
Harendra Kumar 2020-11-19 15:02:44 +00:00 committed by Harendra Kumar
parent d09f1ad9b9
commit 0c570febdd
3 changed files with 73 additions and 0 deletions

46
bin/mk-hscope.sh Executable file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
GHC_VERSION=8.8.3
STREAMLY_VERSION=0.7.2
case `uname` in
Darwin) SYSTEM=x86_64-osx;;
Linux) SYSTEM=x86_64-linux;;
*) echo "Unsupported system"; exit 1 ;;
esac
pushd $(git rev-parse --show-toplevel)
git ls-files \
| grep '\.l\?hs$' \
| xargs hscope -b \
-I src/ \
-I test \
-I dist-newstyle/build/$SYSTEM/ghc-$GHC_VERSION/streamly-$STREAMLY_VERSION/build/src/ \
-X BangPatterns \
-X CApiFFI \
-X CPP \
-X ConstraintKinds \
-X DeriveDataTypeable \
-X DeriveGeneric \
-X DeriveTraversable \
-X ExistentialQuantification \
-X FlexibleContexts \
-X FlexibleInstances \
-X GeneralizedNewtypeDeriving \
-X InstanceSigs \
-X KindSignatures \
-X LambdaCase \
-X MagicHash \
-X MultiParamTypeClasses \
-X PatternSynonyms \
-X RankNTypes \
-X RecordWildCards \
-X ScopedTypeVariables \
-X TupleSections \
-X TypeFamilies \
-X ViewPatterns \
-X NoMonoLocalBinds \
-X TemplateHaskell \
-X UnboxedTuples \
-X UndecidableInstances
popd

25
bin/mk-tags.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
HSCOPE_DIR=$HOME/.hscope
CODEX_CONFIG=$HOME/.codex
if test -e $CODEX_CONFIG
then
echo "Please move or remove $CODEX_CONFIG and then run again"
exit 1
fi
# XXX it does not seem to include the current project anyway
cat << EOF > $CODEX_CONFIG
currentProjectIncluded: true
hackagePath: $HSCOPE_DIR/packages/hackage.haskell.org/
tagsFileHeader: true
tagsFileName: tags
tagsFileSorted: true
tagsCmd: hasktags --ctags --follow-symlinks --output="\$TAGS" "\$SOURCES"
EOF
# XXX depends on cabal configure, does not seem to be supporting new cabal
# XXX it depends in the hackage index tar file in ~/.cabal
codex update --force
rm -f $CODEX_CONFIG

View File

@ -118,6 +118,8 @@ extra-source-files:
benchmark/lib/Streamly/Benchmark/*.hs
benchmark/streamly-benchmarks.cabal
bin/bench-exec-one.sh
bin/mk-hscope.sh
bin/mk-tags.sh
cabal.project.ci
charts-0/streamly-vs-list-time.svg
configure