new build system

This commit is contained in:
Marc Wäckerlin
2015-05-05 08:30:58 +00:00
parent 2c12481418
commit 0d50554c47
23 changed files with 3662 additions and 163 deletions

View File

@@ -1,30 +1,31 @@
## @id $Id$
#
# This file has been added by bootstrap.sh on Mon, 04 May 2015 16:05:25 +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
bin_SCRIPTS = webrunner webtester
BUILT_SOURCES = ${bin_SCRIPTS:%=qmakefile.%}
EXTRA_DIST = commands.hxx networkaccessmanager.hxx testgui.ui \
webrunner.cxx web.ui exceptions.hxx testgui.hxx \
webpage.hxx webtester.cxx @PACKAGE_NAME@.pro
bin_PROGRAMS = webtester webrunner
clean-local: ${bin_SCRIPTS:%=clean.%}
webtester_MOCFILES = moc_testgui.cxx moc_commands.cxx moc_webpage.cxx \
moc_networkaccessmanager.cxx
webtester_UIFILES = ui_testgui.hxx
webtester_SOURCES = version.cxx webtester.cxx exceptions.hxx version.hxx \
${webtester_MOCFILES} ${webtester_UIFILES}
webrunner: make.webrunner
webtester: make.webtester
webrunner_MOCFILES = moc_commands.cxx moc_webpage.cxx \
moc_networkaccessmanager.cxx
webrunner_UIFILES =
webrunner_SOURCES = version.cxx webrunner.cxx exceptions.hxx version.hxx \
${webrunner_MOCFILES} ${webrunner_UIFILES}
qmakefile.%: ${srcdir}/webtester.pro
${QMAKE} -makefile -o $@ -config debug -config ${@:qmakefile.%=%} $<
BUILT_SOURCES = ${webtester_MOCFILES} ${webtester_UIFILES} \
${webrunner_MOCFILES} ${webrunner_UIFILES}
make.%: qmakefile.%
make -f ${<}
EXTRA_DIST = ${webtester_MOCFILES:moc_%.cxx=%.hxx} \
${webtester_UIFILES:ui_%.hxx=%.hxx} \
${webrunner_MOCFILES:moc_%.cxx=%.hxx} \
${webrunner_UIFILES:ui_%.hxx=%.hxx}
clean.%: qmakefile.%
make -f ${<} clean
CLEANFILES = ${bin_SCRIPTS}
DISTCLEANFILES = ${BUILT_SOURCES}
MAINTAINERCLEANFILES = makefile.in
.PHONY: make.* clean.*

View File

@@ -17,7 +17,7 @@
#include <QScrollBar>
#include <QFile>
#include <QMessageBox>
#include <ui_testgui.h>
#include <ui_testgui.hxx>
#include <stdexcept>
#include <QNetworkReply>
#include <QEvent>

37
src/version.cxx Normal file
View File

@@ -0,0 +1,37 @@
/*! @file
@id $
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#include <string>
namespace NAMESPACE {
std::string package_string() {
return PACKAGE_STRING;
}
std::string package_name() {
return PACKAGE_NAME;
}
std::string version() {
return PACKAGE_VERSION;
}
std::string build_date() {
return BUILD_DATE_STR;
}
std::string author() {
return AUTHOR_STR;
}
std::string description() {
return README_STR;
}
std::string logo() {
return PROJECT_LOGO_STR;
}
std::string icon() {
return PROJECT_ICON_STR;
}
const std::string WHAT("#(@) " PACKAGE_STRING);
const std::string IDENT("$Id: " PACKAGE_STRING);
}

21
src/version.hxx Normal file
View File

@@ -0,0 +1,21 @@
/*! @file
@id $
*/
// 1 2 3 4 5 6 7 8
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
#include <string>
namespace NAMESPACE {
std::string package_string();
std::string package_name();
std::string version();
std::string build_date();
std::string author();
std::string description();
std::string logo();
std::string icon();
extern const std::string WHAT;
extern const std::string IDENT;
}

View File

@@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Form</class>
<widget class="QWidget" name="Form">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QWebView" name="_web">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKitWidgets/QWebView</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -13,7 +13,8 @@
#include <xml-cxx/xml.hxx>
#include <mrw/string.hxx>
std::string VERSION("0.9.5");
#include <version.hxx>
using namespace NAMESPACE;
QString format(QString txt, int indent = 2, int cpl = 60) {
QStringList res;
@@ -30,6 +31,9 @@ QString format(QString txt, int indent = 2, int cpl = 60) {
}
return res.join('\n');
}
QString format(std::string txt, int indent = 2, int cpl = 60) {
return format(QString::fromStdString(txt), indent, cpl);
}
QString help(const Script& s) {
std::ostringstream ss;
@@ -37,11 +41,15 @@ QString help(const Script& s) {
<<std::endl
<<" webrunner [<OPTIONS>] [<file1> [<file2> [...]]]"<<std::endl
<<std::endl
<<"Script Syntax"<<std::endl
<<"DESCRIPTION"<<std::endl
<<std::endl
<<format(description()).toStdString()<<std::endl
<<std::endl
<<"SCRIPT SYNTAX"<<std::endl
<<std::endl
<<format(s.syntax()).toStdString()<<std::endl
<<std::endl
<<"Script Commands"<<std::endl
<<"SCRIPT COMMANDS"<<std::endl
<<std::endl
<<format(s.commands()).toStdString()<<std::endl;
return QString::fromStdString(ss.str());
@@ -81,7 +89,10 @@ int main(int argc, char *argv[]) try {
QDir().absolutePath()+QDir::separator()+"attachments"));
parser.process(a);
if (parser.isSet("version")) {
std::cout<<*argv<<" "<<VERSION<<std::endl;
std::cout<<*argv<<std::endl
<<" from package "<<package_string()<<std::endl
<<" by "<<author()<<std::endl
<<" built on "<<build_date()<<std::endl;
return 0;
}
int retries(parser.value("retries").toInt());