Skip to content
This repository was archived by the owner on Jun 13, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: imatix/gsl
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: zeromq/gsl
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 526 additions and 43,576 deletions.
  1. +37 −0 .github/workflows/CI.yaml
  2. +3 −0 .gitignore
  3. +28 −0 .obs/workflows.yml
  4. +5 −2 .travis.yml
  5. +2 −2 Dockerfile
  6. +118 −0 Jenkinsfile
  7. +1 −18 Makefile
  8. +51 −9 README.md
  9. +44 −4 README.txt
  10. +0 −39 builds/gsl.pro
  11. +9 −18 ci_build.sh
  12. +3 −0 packaging/debian/.gitignore
  13. +2 −2 packaging/debian/changelog
  14. +2 −2 packaging/debian/control
  15. +22 −455 packaging/debian/copyright
  16. +3 −3 packaging/debian/{generator-scripting-language.dsc.obs → generator-scripting-language.dsc}
  17. +1 −1 packaging/debian/generator-scripting-language.install
  18. +1 −0 packaging/debian/generator-scripting-language.manpages
  19. +2 −9 packaging/debian/rules
  20. +8 −0 packaging/docker/run_gsl.sh
  21. +1 −1 packaging/linux/create_tarball.sh
  22. +9 −10 packaging/linux/rpm/SPECS/generator-scripting-language.spec
  23. +1 −1 packaging/nuget/package.config
  24. +1 −1 packaging/nuget/package.nuspec
  25. +25 −28 packaging/obs/_service
  26. +1 −0 packaging/redhat/generator-scripting-language.spec
  27. +0 −9 pcre/.gitignore
  28. +0 −23 pcre/AUTHORS
  29. +0 −68 pcre/COPYING
  30. +0 −2,110 pcre/ChangeLog
  31. +0 −185 pcre/INSTALL
  32. +0 −68 pcre/LICENCE
  33. +0 −216 pcre/Makefile
  34. +0 −255 pcre/NEWS
  35. +0 −269 pcre/NON-UNIX-USE
  36. +0 −518 pcre/README
  37. +0 −192 pcre/RunGrepTest.in
  38. +0 −258 pcre/RunTest.in
  39. +0 −59 pcre/build.sh
  40. +0 −539 pcre/c
  41. +0 −1,495 pcre/config.guess
  42. +0 −127 pcre/config.h
  43. +0 −127 pcre/config.h.in
  44. +0 −1,627 pcre/config.sub
  45. +0 −110 pcre/configure
  46. +0 −293 pcre/configure.ac
  47. +0 −94 pcre/configure.bat
  48. +0 −172 pcre/dftables.c
  49. +0 −251 pcre/install-sh
  50. +0 −20 pcre/libpcre.def
  51. +0 −12 pcre/libpcre.pc.in
  52. +0 −259 pcre/libpcre.vcproj
  53. +0 −25 pcre/libpcreposix.def
  54. +0 −6,971 pcre/ltmain.sh
  55. +0 −25 pcre/makevp.bat
  56. +0 −40 pcre/mkinstalldirs
  57. +0 −66 pcre/pcre-config.in
  58. +0 −29 pcre/pcre.def
  59. +0 −286 pcre/pcre.h
  60. +0 −5,124 pcre/pcre_compile.c
  61. +0 −116 pcre/pcre_config.c
  62. +0 −2,027 pcre/pcre_dfa_exec.c
  63. +0 −3,845 pcre/pcre_exec.c
  64. +0 −149 pcre/pcre_fullinfo.c
  65. +0 −352 pcre/pcre_get.c
  66. +0 −69 pcre/pcre_globals.c
  67. +0 −89 pcre/pcre_info.c
  68. +0 −930 pcre/pcre_internal.h
  69. +0 −138 pcre/pcre_maketables.c
  70. +0 −78 pcre/pcre_ord2utf8.c
  71. +0 −466 pcre/pcre_printint.src
  72. +0 −77 pcre/pcre_refcount.c
  73. +0 −173 pcre/pcre_scanner.cc
  74. +0 −163 pcre/pcre_scanner.h
  75. +0 −126 pcre/pcre_scanner_unittest.cc
  76. +0 −39 pcre/pcre_stringpiece.cc
  77. +0 −172 pcre/pcre_stringpiece.h.in
  78. +0 −145 pcre/pcre_stringpiece_unittest.cc
  79. +0 −482 pcre/pcre_study.c
  80. +0 −193 pcre/pcre_tables.c
  81. +0 −132 pcre/pcre_try_flipped.c
  82. +0 −176 pcre/pcre_ucp_searchfuncs.c
  83. +0 −130 pcre/pcre_valid_utf8.c
  84. +0 −64 pcre/pcre_version.c
  85. +0 −144 pcre/pcre_xclass.c
  86. +0 −781 pcre/pcrecpp.cc
  87. +0 −667 pcre/pcrecpp.h
  88. +0 −1,061 pcre/pcrecpp_unittest.cc
  89. +0 −171 pcre/pcrecpparg.h.in
  90. +0 −324 pcre/pcredemo.c
  91. +0 −1,721 pcre/pcregrep.c
  92. +0 −311 pcre/pcreposix.c
  93. +0 −147 pcre/pcreposix.h
  94. +0 −1,940 pcre/pcretest.c
  95. +0 −213 pcre/perltest
  96. +0 −1 pcre/readme.txt
  97. +0 −1 pcre/stamp_generate
  98. +0 −126 pcre/ucp.h
  99. +0 −87 pcre/ucpinternal.h
  100. +0 −2,968 pcre/ucptable.c
  101. +29 −9 src/Makefile
  102. +2 −2 src/c
  103. +3 −0 src/ggcode.c
  104. +1 −1 src/ggpcre.c
  105. +1 −1 src/ggpcre.gxl
  106. +1 −1 src/ggstrn.c
  107. +2 −2 src/ggthrd.c
  108. +61 −0 src/gsl.1
  109. +0 −3 src/gsl.c
  110. +5 −1 src/prelude.h
  111. +7 −3 src/sfl.h
  112. +1 −1 src/sfldate.c
  113. +1 −1 src/sflfile.c
  114. +18 −20 src/sfllang.c
  115. +2 −2 src/sfllang.h
  116. +1 −1 src/sflxmls.c
  117. +1 −1 src/smtlog.c
  118. +1 −1 src/smttst2.c
  119. +2 −0 src/testabort.gsl
  120. +1 −0 src/teststr.gsl
  121. +6 −5 src/version.h
37 changes: 37 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
push:
pull_request:


jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
BUILD_TYPE: default
PACKAGES: libpcre3-dev
env:
# Set CI_TIME: true to enable build-step profiling
# Set CI_TRACE: true to enable shell script tracing
# Set CI_CONFIG_QUIET: true to enable "configure --quiet" (only report stderr)
# Set CI_REQUIRE_GOOD_GITIGNORE: false to NOT fail if "git status -s" is not clean
# Set CI_REQUIRE_GOOD_CLANG_FORMAT: true to fail if "clang-format" check is not clean
CI_TIME: false
CI_TRACE: false
CI_CONFIG_QUIET: true
CI_REQUIRE_GOOD_GITIGNORE: false
platform: ${{ matrix.platform }}
configuration: ${{ matrix.configuration }}
BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
steps:
- uses: actions/checkout@v2
with:
path: gsl
- name: build
shell: bash
working-directory: gsl
run: ./ci_build.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ build/
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# Jenkins temp dir
src@tmp/

*_i.c
*_p.c
*.ilk
28 changes: 28 additions & 0 deletions .obs/workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pull_request:
steps:
- branch_package:
source_project: network:messaging:zeromq:git-draft
source_package: generator-scripting-language
target_project: network:messaging:zeromq:ci
filters:
event: pull_request
merge:
steps:
- trigger_services:
project: network:messaging:zeromq:git-stable
package: generator-scripting-language
filters:
event: push
branches:
only:
- master
release:
steps:
- trigger_services:
project: network:messaging:zeromq:release-stable
package: generator-scripting-language
- trigger_services:
project: network:messaging:zeromq:release-draft
package: generator-scripting-language
filters:
event: tag_push
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,11 @@ language: c

cache: ccache

sudo: true
os:
- linux
- osx

sudo: false

# Set CI_TIME=true to enable build-step profiling in Travis
# Set CI_TRACE=true to enable shell script tracing in Travis
@@ -15,7 +19,6 @@ env:
- CI_CONFIG_QUIET=true
matrix:
- BUILD_TYPE=default
- BUILD_TYPE=with-pcre

script:
- ./ci_build.sh
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q --force-yes libpcre3-de

RUN mkdir /tmp/gsl
COPY src /tmp/gsl/src
COPY pcre /tmp/gsl/pcre
COPY packaging/docker/run_gsl.sh /usr/local/bin/run_gsl.sh
WORKDIR /tmp/gsl/src
RUN make
RUN make install
ENTRYPOINT ["/usr/local/bin/gsl"]
ENTRYPOINT ["run_gsl.sh"]
118 changes: 118 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
pipeline {
agent { label "linux || macosx || bsd || solaris || posix || windows" }
parameters {
// Use DEFAULT_DEPLOY_BRANCH_PATTERN and DEFAULT_DEPLOY_JOB_NAME if
// defined in this jenkins setup -- in Jenkins Management Web-GUI
// see Configure System / Global properties / Environment variables
// Default (if unset) is empty => no deployment attempt after good test
// See zproject Jenkinsfile-deploy.example for an example deploy job.
// TODO: Try to marry MultiBranchPipeline support with pre-set defaults
// directly in MultiBranchPipeline plugin, or mechanism like Credentials,
// or a config file uploaded to master for all jobs or this job, see
// https://jenkins.io/doc/pipeline/examples/#configfile-provider-plugin
string (
defaultValue: '${DEFAULT_DEPLOY_BRANCH_PATTERN}',
description: 'Regular expression of branch names for which a deploy action would be attempted after a successful build and test; leave empty to not deploy. Reasonable value is ^(master|release/.*|feature/*)$',
name : 'DEPLOY_BRANCH_PATTERN')
string (
defaultValue: '${DEFAULT_DEPLOY_JOB_NAME}',
description: 'Name of your job that handles deployments and should accept arguments: DEPLOY_GIT_URL DEPLOY_GIT_BRANCH DEPLOY_GIT_COMMIT -- and it is up to that job what to do with this knowledge (e.g. git archive + push to packaging); leave empty to not deploy',
name : 'DEPLOY_JOB_NAME')
booleanParam (
defaultValue: true,
description: 'If the deployment is done, should THIS job wait for it to complete and include its success or failure as the build result (true), or should it schedule the job and exit quickly to free up the executor (false)',
name: 'DEPLOY_REPORT_RESULT')
booleanParam (
defaultValue: true,
description: 'Attempt a "make install" check in this run?',
name: 'DO_TEST_INSTALL')
string (
defaultValue: "`pwd`/tmp/_inst",
description: 'If attempting a "make install" check in this run, what DESTDIR to specify? (absolute path, defaults to "BUILD_DIR/tmp/_inst")',
name: 'USE_TEST_INSTALL_DESTDIR')
booleanParam (
defaultValue: true,
description: 'When using temporary subdirs in build/test workspaces, wipe them after successful builds?',
name: 'DO_CLEANUP_AFTER_BUILD')
}
triggers {
pollSCM 'H/5 * * * *'
}
// Note: your Jenkins setup may benefit from similar setup on side of agents:
// PATH="/usr/lib64/ccache:/usr/lib/ccache:/usr/bin:/bin:${PATH}"
stages {
stage ('compile') {
steps {
dir ('src') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make -k -j4 || make'
sh 'echo "Are GitIgnores good after make? (should have no output below)"; git status -s || true'
}
}
}
stage ('test') {
steps {
dir ('src') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make test'
// The test is trivial (run the binary to see if it works
// and prints the version), there is no git status to validate
}
}
}
stage ('self-check GSL parser') {
steps {
dir ('src') {
sh 'CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make check'
sh 'echo "Are GitIgnores good after make check? (should have no output below)"; git status -s || true'
}
}
}
stage ('install') {
when { expression { return ( params.DO_TEST_INSTALL ) } }
steps {
timeout (time: 5, unit: 'MINUTES') {
sh """CCACHE_BASEDIR="`pwd`" ; export CCACHE_BASEDIR; make DESTDIR="${params.USE_TEST_INSTALL_DESTDIR}" install"""
}
sh 'echo "Are GitIgnores good after make install? (should have no output below)"; git status -s || true'
script {
if ( params.DO_CLEANUP_AFTER_BUILD ) {
dir("${params.USE_TEST_INSTALL_DESTDIR}") {
deleteDir()
}
}
}
}
}
stage ('deploy if appropriate') {
steps {
script {
def myDEPLOY_JOB_NAME = sh(returnStdout: true, script: """echo "${params["DEPLOY_JOB_NAME"]}" """).trim();
def myDEPLOY_BRANCH_PATTERN = sh(returnStdout: true, script: """echo "${params["DEPLOY_BRANCH_PATTERN"]}" """).trim();
def myDEPLOY_REPORT_RESULT = sh(returnStdout: true, script: """echo "${params["DEPLOY_REPORT_RESULT"]}" """).trim().toBoolean();
echo "Original: DEPLOY_JOB_NAME : ${params["DEPLOY_JOB_NAME"]} DEPLOY_BRANCH_PATTERN : ${params["DEPLOY_BRANCH_PATTERN"]} DEPLOY_REPORT_RESULT : ${params["DEPLOY_REPORT_RESULT"]}"
echo "Used: myDEPLOY_JOB_NAME:${myDEPLOY_JOB_NAME} myDEPLOY_BRANCH_PATTERN:${myDEPLOY_BRANCH_PATTERN} myDEPLOY_REPORT_RESULT:${myDEPLOY_REPORT_RESULT}"
if ( (myDEPLOY_JOB_NAME != "") && (myDEPLOY_BRANCH_PATTERN != "") ) {
if ( env.BRANCH_NAME =~ myDEPLOY_BRANCH_PATTERN ) {
def GIT_URL = sh(returnStdout: true, script: """git remote -v | egrep '^origin' | awk '{print \$2}' | head -1""").trim()
def GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse --verify HEAD').trim()
build job: "${myDEPLOY_JOB_NAME}", parameters: [
string(name: 'DEPLOY_GIT_URL', value: "${GIT_URL}"),
string(name: 'DEPLOY_GIT_BRANCH', value: env.BRANCH_NAME),
string(name: 'DEPLOY_GIT_COMMIT', value: "${GIT_COMMIT}")
], quietPeriod: 0, wait: myDEPLOY_REPORT_RESULT, propagate: myDEPLOY_REPORT_RESULT
} else {
echo "Not deploying because branch '${env.BRANCH_NAME}' did not match filter '${myDEPLOY_BRANCH_PATTERN}'"
}
} else {
echo "Not deploying because deploy-job parameters are not set"
}
}
}
}
stage ('cleanup') {
when { expression { return ( params.DO_CLEANUP_AFTER_BUILD ) } }
steps {
deleteDir()
}
}
}
}
19 changes: 1 addition & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -35,22 +35,5 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

all: gsl

gsl: gsl-shared

pcre/libpcre.a:
cd pcre && $(MAKE) libpcre.a

gsl-shared:
cd src && $(MAKE) all && cp -f gsl $@

gsl-static: pcre/libpcre.a
cd src && $(MAKE) CCLIBS="../pcre/libpcre.a" all && cp -f gsl $@

check install uninstall:
cd src && $(MAKE) $@

clean:
all check clean install uninstall:
cd src && $(MAKE) $@
cd pcre && $(MAKE) $@
60 changes: 51 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,9 +9,11 @@
* [Scope and Goals](#scope-and-goals)
* [Ownership and License](#ownership-and-license)
 [Ownership and License of generated sources](#ownership-and-license-of-generated-sources)
* [Run with docker](#run-with-docker)
* [Building and installing](#building-and-installing)
 [Building on FreeBSD 10](#building-on-freebsd-10)
 [Building on Cygwin](#building-on-cygwin)
 [Building on MacOS ](#building-on-macos-)
* [This Document](#this-document)

**[Starting with GSL](#starting-with-gsl)**
@@ -112,6 +114,26 @@ The authors grant you free use of this software under the terms of the GNU Gener

The copyright of the output of GSL is by default the property of the user or whomever writes the template(s).

### Run with docker

To run gsl from docker on your current working directory:

# Shell and Powershell
docker run -v ${PWD}:/gsl zeromqorg/gsl <parameters and options>

# Windows CMD
docker run -v %cd%:/gsl zeromqorg/gsl <parameters and options>

The default build directy is `/gsl`. If you mounted it elsewhere you need the specify the `GSL_BUILD_DIR` environment variable:

docker run -v <build_dir>:/projects/myproject -e GSL_BUILD_DIR=/projects/myproject zeromqorg/gsl <parameters and options>

The above commands assumes that your script files are within your build directory. If you placed your scripts in other directories specify them as follows:

docker run -v <script_dir1>:/tmp/scripts1 -v <script_dir2>:/tmp/scripts2 -v ${PWD}:/gsl -e GSL_SCRIPTS_PATH=/tmp/scripts2:/tmp/scripts2 zeromqorg/gsl <parameters and options>

The scripts that runs docker inside the container will place the script directories onto the PATH so that gsl can find them.

### Building and installing

Dependencies:
@@ -120,7 +142,7 @@ Dependencies:

To build from git on a UNIX-like box, and install into `/usr/local/bin`:

git clone git://github.com/imatix/gsl
git clone git://github.com/zeromq/gsl
cd gsl/src
make
sudo make install
@@ -174,14 +196,34 @@ Download, Build and Install gcc:

Finally build gsl:

git clone git://github.com/imatix/gsl
git clone git://github.com/zeromq/gsl
cd gsl/src
make
make install

Finally build gsl:

git clone git://github.com/zeromq/gsl
cd gsl/src
make
make install

#### Building on MacOS

The modern way of building on MacOS is to make sure you have pcre installed and use brew.

brew install pcre

And then build gsl as above:

git clone git://github.com/zeromq/gsl
cd gsl/src
make
sudo make install

### This Document

This document was written by Pieter Hintjens in October 2010 based on two 2005 articles on 'model oriented programming', and the GSL reference manual. This text is originally at README.txt and is built using [gitdown](http://github.com/imatix/gitdown). The text was updated by Gyepi Sam in January 2013 to port documentation from earlier versions and to include more examples.
This document was written by Pieter Hintjens in October 2010 based on two 2005 articles on 'model oriented programming', and the GSL reference manual. This text is originally at README.txt and is built using [gitdown](http://github.com/zeromq/gitdown). The text was updated by Gyepi Sam in January 2013 to port documentation from earlier versions and to include more examples.

## Starting with GSL

@@ -190,7 +232,7 @@ GSL is an acronym for Generator Scripting Language. And that is what it does. Yo
Read on to get you started with code generation!

<center>
<img src="http://github.com/imatix/gsl/raw/master/images/README_1.png" alt="1">
<img src="http://github.com/zeromq/gsl/raw/master/images/README_1.png" alt="1">
</center>

### Hello World
@@ -407,7 +449,7 @@ I've defined a `<section>` tag that breaks the pages into groups. Now let's jump

We'll make the web site as several XML files. This is a design choice. We could also make the site as a single large XML file. It's a trade-off between ease of use (a single file is easier in smaller cases) and scalability (it's not practical to edit a large site with hundreds of pages as a single file).

To start with, we'll define the overall site like this:
To start with, we'll define the overall site like this (in file `site.xml`):

<?xml version = "1.0" ?>
<site
@@ -425,7 +467,7 @@ To start with, we'll define the overall site like this:

Note the first line, which defines the file as XML, and the `script` tag, which tells GSL what script to run to process the data. We've defined three pages. Let's write very a simple version of each of these:

Next, we will write three more short XML files as shown below. First the index page:
Next, we will write three more short XML files as shown below. First the index page (in file `index.xml`):

<page
name = "index"
@@ -442,7 +484,7 @@ Next, we will write three more short XML files as shown below. First the index p
</content>
</page>

Next, the fruit page:
Next, the fruit page (in file `fruit.xml`):

<page
name = "fruit"
@@ -459,7 +501,7 @@ Next, the fruit page:
</content>
</page>

and last the vegetable page:
and last the vegetable page (in file `vegetables.xml`):

<page
name = "vegetables"
@@ -477,7 +519,7 @@ and last the vegetable page:
</content>
</page>

Finally, here is the first draft of the web generation script. It does not produce anything, it simply loads the web site data into an XML tree and then saves this (in a file called `root.xml`) that we can look at to see what live data the script is actually working with:
Finally, here is the first draft of the web generation script. It does not produce anything, it simply loads the web site data into an XML tree and then saves this (in a file called `root.xml`) that we can look at to see what live data the script is actually working with. Save script below in file `sitegen_1.gsl`:

.### Since we run the script off the XML file, it starts in
.### template mode.
Loading