added doxygen-webtester.sed do generate doxygen from webtester files
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2015-05-06 07:56 marc
|
||||||
|
|
||||||
|
* ChangeLog, debian/.dirs, debian/.install, debian/webtester.dirs,
|
||||||
|
debian/webtester.install: no need for install and dirs in debian
|
||||||
|
|
||||||
2015-05-05 20:31 marc
|
2015-05-05 20:31 marc
|
||||||
|
|
||||||
* ax_init_standard_project.m4, bootstrap.sh, configure.ac, debian,
|
* ax_init_standard_project.m4, bootstrap.sh, configure.ac, debian,
|
||||||
|
@@ -283,6 +283,11 @@ rpm: dist
|
|||||||
EOF
|
EOF
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# use this in configure.ac to support scripts, e.g. bash scripts
|
||||||
|
AC_DEFUN([AX_USE_SCRIPTS], [
|
||||||
|
AC_CONFIG_FILES([scripts/makefile])
|
||||||
|
])
|
||||||
|
|
||||||
# use this in configure.ac to support Doxygen documentation generation
|
# use this in configure.ac to support Doxygen documentation generation
|
||||||
AC_DEFUN([AX_USE_DOXYGEN], [
|
AC_DEFUN([AX_USE_DOXYGEN], [
|
||||||
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
|
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
|
||||||
|
77
bootstrap.sh
77
bootstrap.sh
@@ -19,10 +19,18 @@ PROJECT_PATH=$(pwd)
|
|||||||
DEFAULT_PROJECT_NAME=${PROJECT_PATH##*/}
|
DEFAULT_PROJECT_NAME=${PROJECT_PATH##*/}
|
||||||
|
|
||||||
configure=0
|
configure=0
|
||||||
|
build=0
|
||||||
|
overwrite=0
|
||||||
|
rebuild=0
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(--configure|-c) configure=1;;
|
(--configure|-c) configure=1;;
|
||||||
(--version|-v) echo "$Id$"; exit;;
|
(--build|-b) configure=1; build=1;;
|
||||||
|
(--overwrite|-o) overwrite=1;;
|
||||||
|
(--rebuild|-r) rebuild=1;;
|
||||||
|
(--version|-v)
|
||||||
|
echo "$Id$";
|
||||||
|
exit;;
|
||||||
(--help|-h) less <<EOF
|
(--help|-h) less <<EOF
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
|
|
||||||
@@ -31,6 +39,9 @@ SYNOPSIS
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
--configure, -c call ./configure after initialization
|
--configure, -c call ./configure after initialization
|
||||||
|
--build, -c build, call ./configure && make after initialization
|
||||||
|
--overwrite, -o overwrite all basic files (bootstrap.sh, m4-macros)
|
||||||
|
--rebuild -r force rebuild of generated files, even if modified
|
||||||
--help, -h show this help
|
--help, -h show this help
|
||||||
--version, -v show version and date of this file
|
--version, -v show version and date of this file
|
||||||
|
|
||||||
@@ -93,6 +104,7 @@ GENERATED FILES
|
|||||||
* src/makefile.am - if you enabled AX_USE_CXX
|
* src/makefile.am - if you enabled AX_USE_CXX
|
||||||
* src/version.hxx - if you enabled AX_USE_CXX
|
* src/version.hxx - if you enabled AX_USE_CXX
|
||||||
* src/version.cxx - if you enabled AX_USE_CXX
|
* src/version.cxx - if you enabled AX_USE_CXX
|
||||||
|
* scripts/makefile.in - if you enabled AX_USE_SCRIPTS
|
||||||
* doc/makefile.am - if you enabled AX_USE_DOXYGEN
|
* doc/makefile.am - if you enabled AX_USE_DOXYGEN
|
||||||
* doc/doxyfile.in - if you enabled AX_USE_DOXYGEN
|
* doc/doxyfile.in - if you enabled AX_USE_DOXYGEN
|
||||||
* test/makefile.am - if you enabled AX_USE_CPPUNIT
|
* test/makefile.am - if you enabled AX_USE_CPPUNIT
|
||||||
@@ -108,8 +120,11 @@ GENERATED FILES
|
|||||||
* debian/compat - if you enabled AX_USE_DEBIAN_PACKAGING
|
* debian/compat - if you enabled AX_USE_DEBIAN_PACKAGING
|
||||||
* src/${DEFAULT_PROJECT_NAME}.pc.in - if you enabled AX_USE_LIBTOOL
|
* src/${DEFAULT_PROJECT_NAME}.pc.in - if you enabled AX_USE_LIBTOOL
|
||||||
|
|
||||||
To rebuild any of these files, just remove it using "svn rm <filename>"
|
REBUILDING FILES
|
||||||
and run ${MY_NAME} again.
|
|
||||||
|
To rebuild all these files, just run "${MY_NAME} -o". You can also
|
||||||
|
remove and rebuild a single file by removing it from subversion,
|
||||||
|
just call "svn rm <file>" and "${MY_NAME}" to rebuild file "<file>".
|
||||||
|
|
||||||
FILES TO EDIT
|
FILES TO EDIT
|
||||||
|
|
||||||
@@ -128,8 +143,8 @@ FILES TO EDIT
|
|||||||
|
|
||||||
FILE DEPENDENCIES
|
FILE DEPENDENCIES
|
||||||
|
|
||||||
You should rebuild (remove and run (see above) the files, whenever
|
You should rebuild (see above) the files, whenever you change the
|
||||||
you change the configuration a dependent, i.e.:
|
configuration a dependent, i.e.:
|
||||||
|
|
||||||
* test/makefile.am depends on AX_USE_LIBTOOL
|
* test/makefile.am depends on AX_USE_LIBTOOL
|
||||||
* doc/doxyfile.in depends on AX_BUILD_EXAMPLES
|
* doc/doxyfile.in depends on AX_BUILD_EXAMPLES
|
||||||
@@ -162,8 +177,9 @@ FILES
|
|||||||
number. The following macros are supported:
|
number. The following macros are supported:
|
||||||
* Enable C++: AX_USE_CXX
|
* Enable C++: AX_USE_CXX
|
||||||
* Enable LibTool library creation: AX_USE_LIBTOOL
|
* Enable LibTool library creation: AX_USE_LIBTOOL
|
||||||
|
* Enable Scripts: AX_USE_SCRIPTS
|
||||||
* Enable Doxygen documentation generation: AX_USE_DOXYGEN
|
* Enable Doxygen documentation generation: AX_USE_DOXYGEN
|
||||||
* Enable debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING
|
* Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING
|
||||||
* Not yet implemented: AX_USE_RPM_PACKAGING
|
* Not yet implemented: AX_USE_RPM_PACKAGING
|
||||||
* Enable C++ testing using CppUnit: AX_USE_CPPUNIT
|
* Enable C++ testing using CppUnit: AX_USE_CPPUNIT
|
||||||
* Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES
|
* Enable C++ examples, i.e. for libraries: AX_BUILD_EXAMPLES
|
||||||
@@ -198,7 +214,7 @@ EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
HEADER='## @id $Id$
|
HEADER='## @id '"\$Id\$"'
|
||||||
#
|
#
|
||||||
# This file has been added by '${MY_NAME}' on '$(date -R)'
|
# This file has been added by '${MY_NAME}' on '$(date -R)'
|
||||||
# Feel free to change it or even remove and rebuild it, up to your needs
|
# Feel free to change it or even remove and rebuild it, up to your needs
|
||||||
@@ -247,6 +263,14 @@ checkdir() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkfile() {
|
||||||
|
exists=0
|
||||||
|
if test -f "$1"; then
|
||||||
|
exists=1
|
||||||
|
fi
|
||||||
|
test $exists -eq 1
|
||||||
|
}
|
||||||
|
|
||||||
to() {
|
to() {
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
mode="u=rw,g=rw,o=r"
|
mode="u=rw,g=rw,o=r"
|
||||||
@@ -261,7 +285,7 @@ to() {
|
|||||||
esac
|
esac
|
||||||
shift;
|
shift;
|
||||||
done
|
done
|
||||||
if test -f "$1"; then # file already exists
|
if checkfile "$1" && test $rebuild -eq 0; then # file already exists
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
checkdir "$(dirname ${1})"
|
checkdir "$(dirname ${1})"
|
||||||
@@ -279,13 +303,18 @@ to() {
|
|||||||
echo -e " \e[32msuccess\e[0m"
|
echo -e " \e[32msuccess\e[0m"
|
||||||
fi
|
fi
|
||||||
chmod $mode $1
|
chmod $mode $1
|
||||||
|
if test $exists -eq 0; then
|
||||||
run svn add "$1"
|
run svn add "$1"
|
||||||
run svn propset svn:keywords "Id" "$1"
|
run svn propset svn:keywords "Id" "$1"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
copy() {
|
copy() {
|
||||||
if ! test -f "$1"; then
|
if checkfile "$1" && test $overwrite -eq 0; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
run cp "${0%/*}/$1" "$1"
|
run cp "${0%/*}/$1" "$1"
|
||||||
|
if test $exists -eq 0; then
|
||||||
run svn add "$1"
|
run svn add "$1"
|
||||||
run svn propset svn:keywords "Id" "$1"
|
run svn propset svn:keywords "Id" "$1"
|
||||||
fi
|
fi
|
||||||
@@ -321,6 +350,7 @@ AX_INIT_STANDARD_PROJECT
|
|||||||
# requirements, uncomment, what you need:
|
# requirements, uncomment, what you need:
|
||||||
#AX_USE_CXX
|
#AX_USE_CXX
|
||||||
#AX_USE_LIBTOOL
|
#AX_USE_LIBTOOL
|
||||||
|
#AX_USE_SCRIPTS
|
||||||
#AX_USE_DOXYGEN
|
#AX_USE_DOXYGEN
|
||||||
#AX_USE_DEBIAN_PACKAGING
|
#AX_USE_DEBIAN_PACKAGING
|
||||||
#AX_USE_RPM_PACKAGING
|
#AX_USE_RPM_PACKAGING
|
||||||
@@ -342,7 +372,7 @@ echo "${HEADER}" | to --condition AX_USE_CXX src/makefile.am
|
|||||||
to --condition AX_USE_CXX src/version.hxx <<EOF
|
to --condition AX_USE_CXX src/version.hxx <<EOF
|
||||||
/*! @file
|
/*! @file
|
||||||
|
|
||||||
@id \$Id$
|
@id \$Id\$
|
||||||
*/
|
*/
|
||||||
// 1 2 3 4 5 6 7 8
|
// 1 2 3 4 5 6 7 8
|
||||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
@@ -377,7 +407,7 @@ EOF
|
|||||||
to --condition AX_USE_CXX src/version.cxx <<EOF
|
to --condition AX_USE_CXX src/version.cxx <<EOF
|
||||||
/*! @file
|
/*! @file
|
||||||
|
|
||||||
@id $Id$
|
@id $Id\$
|
||||||
*/
|
*/
|
||||||
// 1 2 3 4 5 6 7 8
|
// 1 2 3 4 5 6 7 8
|
||||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
@@ -416,6 +446,7 @@ namespace NAMESPACE {
|
|||||||
const std::string IDENT("\$Id: " PACKAGE_STRING);
|
const std::string IDENT("\$Id: " PACKAGE_STRING);
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
echo "${HEADER}" | to --condition AX_USE_SCRIPTS scripts/makefile.am
|
||||||
echo "${HEADER}" | to --condition AX_USE_DOXYGEN doc/makefile.am
|
echo "${HEADER}" | to --condition AX_USE_DOXYGEN doc/makefile.am
|
||||||
to --condition AX_USE_CPPUNIT test/makefile.am <<EOF
|
to --condition AX_USE_CPPUNIT test/makefile.am <<EOF
|
||||||
${HEADER}AM_CPPFLAGS = -I${top_srcdir}/src -I${top_builddir}/src
|
${HEADER}AM_CPPFLAGS = -I${top_srcdir}/src -I${top_builddir}/src
|
||||||
@@ -512,28 +543,17 @@ EOF
|
|||||||
NEWS
|
NEWS
|
||||||
README
|
README
|
||||||
EOF
|
EOF
|
||||||
to debian/${PACKAGE_NAME}.install <<EOF
|
to --condition AX_USE_LIBTOOL debian/${PACKAGE_NAME}.install <<EOF
|
||||||
usr/bin/*
|
|
||||||
usr/lib/lib*.so.*
|
usr/lib/lib*.so.*
|
||||||
$(if ! testtag AX_USE_LIBTOOL; then echo "usr/share/doc/${PACKAGE_NAME}/html"; fi)
|
|
||||||
EOF
|
EOF
|
||||||
to debian/${PACKAGE_NAME}.dirs <<EOF
|
to --condition AX_USE_LIBTOOL debian/${PACKAGE_NAME}-dev.install <<EOF
|
||||||
usr/lib
|
|
||||||
EOF
|
|
||||||
if testtag AX_USE_LIBTOOL; then
|
|
||||||
to debian/${PACKAGE_NAME}-dev.install <<EOF
|
|
||||||
usr/include/*
|
usr/include/*
|
||||||
usr/lib/lib*.a
|
usr/lib/lib*.a
|
||||||
usr/lib/lib*.so
|
usr/lib/lib*.so
|
||||||
usr/lib/pkgconfig/*
|
usr/lib/pkgconfig/*
|
||||||
usr/lib/*.la
|
usr/lib/*.la
|
||||||
$(if testtag AX_USE_LIBTOOL; then echo "usr/share/doc/${PACKAGE_NAME}/html"; fi)
|
usr/share/doc/${PACKAGE_NAME}/html
|
||||||
EOF
|
EOF
|
||||||
to debian/${PACKAGE_NAME}-dev.dirs <<EOF
|
|
||||||
usr/lib
|
|
||||||
usr/include
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
to --mode "u=rwx,g=rwx,o=rx" debian/rules <<EOF
|
to --mode "u=rwx,g=rwx,o=rx" debian/rules <<EOF
|
||||||
${HEADER}%:
|
${HEADER}%:
|
||||||
dh \$@
|
dh \$@
|
||||||
@@ -542,7 +562,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
if ! test -f makefile.am; then
|
if ! test -f makefile.am; then
|
||||||
SUBDIRS=""
|
SUBDIRS=""
|
||||||
for d in src test doc examples; do
|
for d in src test scripts doc examples; do
|
||||||
test -d $d && SUBDIRS="${SUBDIRS} $d"
|
test -d $d && SUBDIRS="${SUBDIRS} $d"
|
||||||
done
|
done
|
||||||
echo "${HEADER}SUBDIRS =${SUBDIRS}" | to makefile.am
|
echo "${HEADER}SUBDIRS =${SUBDIRS}" | to makefile.am
|
||||||
@@ -575,3 +595,8 @@ run autoconf
|
|||||||
if test "$configure" -eq 1; then
|
if test "$configure" -eq 1; then
|
||||||
./configure $*
|
./configure $*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#### Run Make If User Requires ####
|
||||||
|
if test "$build" -eq 1; then
|
||||||
|
make
|
||||||
|
fi
|
||||||
|
@@ -20,6 +20,7 @@ AX_INIT_STANDARD_PROJECT
|
|||||||
# requirements, uncomment, what you need:
|
# requirements, uncomment, what you need:
|
||||||
AX_USE_CXX
|
AX_USE_CXX
|
||||||
#AX_USE_LIBTOOL
|
#AX_USE_LIBTOOL
|
||||||
|
AX_USE_SCRIPTS
|
||||||
AX_USE_DOXYGEN
|
AX_USE_DOXYGEN
|
||||||
AX_USE_DEBIAN_PACKAGING
|
AX_USE_DEBIAN_PACKAGING
|
||||||
#AX_USE_RPM_PACKAGING
|
#AX_USE_RPM_PACKAGING
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
## @id $Id$
|
## @id $Id$
|
||||||
#
|
#
|
||||||
# This file has been added by bootstrap.sh on Mon, 04 May 2015 16:05:25 +0200
|
# This file has been added by bootstrap.sh on Wed, 06 May 2015 16:20:18 +0200
|
||||||
# Feel free to change it or even remove and rebuild it, up to your needs
|
# Feel free to change it or even remove and rebuild it, up to your needs
|
||||||
#
|
#
|
||||||
## 1 2 3 4 5 6 7 8
|
## 1 2 3 4 5 6 7 8
|
||||||
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
|
||||||
SUBDIRS = src doc
|
SUBDIRS = src scripts doc
|
||||||
|
44
scripts/doxygen-webtester.sed
Executable file
44
scripts/doxygen-webtester.sed
Executable file
@@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sed -nsf
|
||||||
|
|
||||||
|
# begin of file, declare file
|
||||||
|
1{
|
||||||
|
/@file/!{ # no file definition yet, add it
|
||||||
|
x
|
||||||
|
s,^, @file\n,
|
||||||
|
x
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# line with doxygen comment (defined as ## at begin of line)
|
||||||
|
/^##\( \|$\)/{
|
||||||
|
s/##\( \|$\)/ / # replace ## comments by 4 spaces indent
|
||||||
|
H; d # hold, evaluate later
|
||||||
|
}
|
||||||
|
|
||||||
|
# variable definition
|
||||||
|
/^set/{
|
||||||
|
s,^set \+\([^ =]\+\)\( *= *\(.*\)\)\?,/** @var \1, # prepend variable decl
|
||||||
|
G # append hold buffer
|
||||||
|
s,$, */\n, # append end of comment
|
||||||
|
p; z; x; d # clear buffer, next line
|
||||||
|
}
|
||||||
|
|
||||||
|
# function definition
|
||||||
|
/^function/{
|
||||||
|
s,^function \+\([^ ]\+\) *\(.*\)\?,/** @fn \1(\2), # prepend function decl
|
||||||
|
G # append hold buffer
|
||||||
|
s,$, */\n, # append end of comment
|
||||||
|
p; z; x; d # clear buffer, next line
|
||||||
|
}
|
||||||
|
|
||||||
|
# default for non matching lines - print buffer
|
||||||
|
{
|
||||||
|
z; x; # get and clear buffer
|
||||||
|
/^$/!{ # only if buffer is not empty
|
||||||
|
s,^\n,, # remove first newline
|
||||||
|
s,^\( \)\?,/** , # prepend doxygen comment start
|
||||||
|
s,$, */\n, # append end of comment
|
||||||
|
p; d
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
13
scripts/example.wt
Normal file
13
scripts/example.wt
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
## Commented Webtest Example File
|
||||||
|
##
|
||||||
|
## This is text that can be converted to doxygen using the tool
|
||||||
|
## @c doxygen-webtester.sed as filter.
|
||||||
|
|
||||||
|
## This is a variable declaration
|
||||||
|
set a=b
|
||||||
|
|
||||||
|
## This is a function
|
||||||
|
##
|
||||||
|
## Here we have an example of a function declaration
|
||||||
|
function function-name ARG1, ARG2
|
||||||
|
# do nothing
|
9
scripts/makefile.am
Normal file
9
scripts/makefile.am
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
## @id $Id$
|
||||||
|
#
|
||||||
|
# This file has been added by bootstrap.sh on Wed, 06 May 2015 16:04:49 +0200
|
||||||
|
# Feel free to change it or even remove and rebuild it, up to your needs
|
||||||
|
#
|
||||||
|
## 1 2 3 4 5 6 7 8
|
||||||
|
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||||
|
|
||||||
|
dist_bin_SCRIPTS = doxygen-webtester.sed
|
Reference in New Issue
Block a user