Skip to content

Commit ebfe2ea

Browse files
authored
Merge branch 'open-source-parsers:master' into master
2 parents a39e933 + 65bb1b1 commit ebfe2ea

File tree

218 files changed

+5734
-4498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+5734
-4498
lines changed

.clang-format

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,4 @@
1-
---
2-
# BasedOnStyle: LLVM
3-
AccessModifierOffset: -2
4-
ConstructorInitializerIndentWidth: 4
5-
AlignEscapedNewlinesLeft: false
6-
AlignTrailingComments: true
7-
AllowAllParametersOfDeclarationOnNextLine: true
8-
AllowShortIfStatementsOnASingleLine: false
9-
AllowShortLoopsOnASingleLine: false
10-
AlwaysBreakTemplateDeclarations: false
11-
AlwaysBreakBeforeMultilineStrings: false
12-
BreakBeforeBinaryOperators: false
13-
BreakBeforeTernaryOperators: true
14-
BreakConstructorInitializersBeforeComma: false
15-
BinPackParameters: false
16-
ColumnLimit: 80
17-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
18-
DerivePointerBinding: false
19-
ExperimentalAutoDetectBinPacking: false
20-
IndentCaseLabels: false
21-
MaxEmptyLinesToKeep: 1
22-
NamespaceIndentation: None
23-
ObjCSpaceBeforeProtocolList: true
24-
PenaltyBreakBeforeFirstCallParameter: 19
25-
PenaltyBreakComment: 60
26-
PenaltyBreakString: 1000
27-
PenaltyBreakFirstLessLess: 120
28-
PenaltyExcessCharacter: 1000000
29-
PenaltyReturnTypeOnItsOwnLine: 60
30-
PointerBindsToType: true
31-
SpacesBeforeTrailingComments: 1
32-
Cpp11BracedListStyle: false
33-
Standard: Cpp03
34-
IndentWidth: 2
35-
TabWidth: 8
36-
UseTab: Never
37-
BreakBeforeBraces: Attach
38-
IndentFunctionDeclarationAfterType: false
39-
SpacesInParentheses: false
40-
SpacesInAngles: false
41-
SpaceInEmptyParentheses: false
42-
SpacesInCStyleCastParentheses: false
43-
SpaceAfterControlStatementKeyword: true
44-
SpaceBeforeAssignmentOperators: true
45-
ContinuationIndentWidth: 4
46-
...
1+
BasedOnStyle: LLVM
2+
DerivePointerAlignment: false
3+
PointerAlignment: Left
474

.clang-tidy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
Checks: 'google-readability-casting,modernize-deprecated-headers,modernize-loop-convert,modernize-use-auto,modernize-use-default-member-init,modernize-use-using,readability-else-after-return,readability-redundant-member-init,readability-redundant-string-cstr'
3+
WarningsAsErrors: ''
4+
HeaderFilterRegex: ''
5+
AnalyzeTemporaryDtors: false
6+
FormatStyle: none
7+
CheckOptions:
8+
- key: modernize-use-using.IgnoreMacros
9+
value: '0'
10+
...
11+

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1.
16+
17+
**Expected behavior**
18+
A clear and concise description of what you expected to happen.
19+
20+
**Desktop (please complete the following information):**
21+
- OS: [e.g. iOS]
22+
- Meson version
23+
- Ninja version
24+
25+
**Additional context**
26+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
/libs/
1111
/doc/doxyfile
1212
/dist/
13-
#/version
14-
#/include/json/version.h
13+
/.cache/
1514

1615
# MSVC project files:
1716
*.sln
@@ -30,9 +29,9 @@
3029

3130
# CMake-generated files:
3231
CMakeFiles/
33-
*.cmake
3432
/pkg-config/jsoncpp.pc
3533
jsoncpp_lib_static.dir/
34+
compile_commands.json
3635

3736
# In case someone runs cmake in the root-dir:
3837
/CMakeCache.txt
@@ -53,3 +52,6 @@ jsoncpp_lib_static.dir/
5352

5453
# DS_Store
5554
.DS_Store
55+
56+
# temps
57+
/version

.travis.yml

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,71 @@
11
# Build matrix / environment variables are explained on:
22
# http://about.travis-ci.org/docs/user/build-configuration/
3-
# This file can be validated on:
4-
# http://lint.travis-ci.org/
5-
# See also
6-
# http://stackoverflow.com/questions/22111549/travis-ci-with-clang-3-4-and-c11/30925448#30925448
7-
# to allow C++11, though we are not yet building with -std=c++11
8-
9-
before_install:
10-
- source travis.before_install.${TRAVIS_OS_NAME}.sh
11-
install:
12-
- source travis.install.${TRAVIS_OS_NAME}.sh
3+
# This file can be validated on: http://www.yamllint.com/
4+
# Or using the Ruby based travel command line tool:
5+
# gem install travis --no-rdoc --no-ri
6+
# travis lint .travis.yml
7+
language: cpp
8+
sudo: false
139
addons:
10+
homebrew:
11+
packages:
12+
- clang-format
13+
- meson
14+
- ninja
15+
update: false # do not update homebrew by default
1416
apt:
1517
sources:
16-
#- ubuntu-toolchain-r-test
17-
- llvm-toolchain-precise-3.5
18+
- ubuntu-toolchain-r-test
19+
- llvm-toolchain-xenial-8
1820
packages:
19-
#- gcc-4.9
20-
#- g++-4.9
21-
- clang-3.5
21+
- clang-format-8
22+
- clang-8
2223
- valgrind
23-
language: cpp
24-
script: ./travis.sh
25-
matrix:
26-
allow_failures:
27-
- os: osx
2824
matrix:
2925
include:
30-
- os: osx
31-
osx_image: xcode9.4
26+
- name: Mac clang meson static release testing
27+
os: osx
28+
osx_image: xcode11
3229
compiler: clang
33-
#env: PYENV_ROOT=/usr/local/var/pyenv
34-
env: LIB_TYPE=static BUILD_TYPE=release
35-
#- LIB_TYPE=shared BUILD_TYPE=debug
36-
- os: linux
37-
dist: trusty
30+
env:
31+
CXX="clang++"
32+
CC="clang"
33+
LIB_TYPE=static
34+
BUILD_TYPE=release
35+
script: ./.travis_scripts/meson_builder.sh
36+
- name: Linux xenial clang meson static release testing
37+
os: linux
38+
dist: xenial
3839
compiler: clang
39-
env: LIB_TYPE=static BUILD_TYPE=release
40+
env:
41+
CXX="clang++"
42+
CC="clang"
43+
LIB_TYPE=static
44+
BUILD_TYPE=release
45+
PYTHONUSERBASE="$(pwd)/LOCAL"
46+
PATH="$PYTHONUSERBASE/bin:$PATH"
47+
# before_install and install steps only needed for linux meson builds
48+
before_install:
49+
- source ./.travis_scripts/travis.before_install.${TRAVIS_OS_NAME}.sh
50+
install:
51+
- source ./.travis_scripts/travis.install.${TRAVIS_OS_NAME}.sh
52+
script: ./.travis_scripts/meson_builder.sh
53+
- name: Linux xenial gcc cmake coverage
54+
os: linux
55+
dist: xenial
56+
compiler: gcc
57+
env:
58+
CXX=g++
59+
CC=gcc
60+
DO_Coverage=ON
61+
BUILD_TOOL="Unix Makefiles"
62+
BUILD_TYPE=Debug
63+
LIB_TYPE=shared
64+
DESTDIR=/tmp/cmake_json_cpp
65+
before_install:
66+
- pip install --user cpp-coveralls
67+
script: ./.travis_scripts/cmake_builder.sh
68+
after_success:
69+
- coveralls --include src/lib_json --include include
4070
notifications:
4171
email: false
42-
sudo: false

.travis_scripts/cmake_builder.sh

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#!/usr/bin/env sh
2+
# This script can be used on the command line directly to configure several
3+
# different build environments.
4+
# This is called by `.travis.yml` via Travis CI.
5+
# Travis supplies $TRAVIS_OS_NAME.
6+
# http://docs.travis-ci.com/user/multi-os/
7+
# Our .travis.yml also defines:
8+
9+
# - BUILD_TYPE=Release/Debug
10+
# - LIB_TYPE=static/shared
11+
#
12+
# Optional environmental variables
13+
# - DESTDIR <- used for setting the install prefix
14+
# - BUILD_TOOL=["Unix Makefile"|"Ninja"]
15+
# - BUILDNAME <- how to identify this build on the dashboard
16+
# - DO_MemCheck <- if set, try to use valgrind
17+
# - DO_Coverage <- if set, try to do dashboard coverage testing
18+
#
19+
20+
env_set=1
21+
if ${BUILD_TYPE+false}; then
22+
echo "BUILD_TYPE not set in environment."
23+
env_set=0
24+
fi
25+
if ${LIB_TYPE+false}; then
26+
echo "LIB_TYPE not set in environment."
27+
env_set=0
28+
fi
29+
if ${CXX+false}; then
30+
echo "CXX not set in environment."
31+
env_set=0
32+
fi
33+
34+
35+
if [ ${env_set} -eq 0 ]; then
36+
echo "USAGE: CXX=$(which clang++) BUILD_TYPE=[Release|Debug] LIB_TYPE=[static|shared] $0"
37+
echo ""
38+
echo "Examples:"
39+
echo " CXX=$(which clang++) BUILD_TYPE=Release LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp $0"
40+
echo " CXX=$(which clang++) BUILD_TYPE=Debug LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp $0"
41+
echo " CXX=$(which clang++) BUILD_TYPE=Release LIB_TYPE=static DESTDIR=/tmp/cmake_json_cpp $0"
42+
echo " CXX=$(which clang++) BUILD_TYPE=Debug LIB_TYPE=static DESTDIR=/tmp/cmake_json_cpp $0"
43+
44+
echo " CXX=$(which g++) BUILD_TYPE=Release LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp $0"
45+
echo " CXX=$(which g++) BUILD_TYPE=Debug LIB_TYPE=shared DESTDIR=/tmp/cmake_json_cpp $0"
46+
echo " CXX=$(which g++) BUILD_TYPE=Release LIB_TYPE=static DESTDIR=/tmp/cmake_json_cpp $0"
47+
echo " CXX=$(which g++) BUILD_TYPE=Debug LIB_TYPE=static DESTDIR=/tmp/cmake_json_cpp $0"
48+
49+
exit -1
50+
fi
51+
52+
if ${DESTDIR+false}; then
53+
DESTDIR="/usr/local"
54+
fi
55+
56+
# -e: fail on error
57+
# -v: show commands
58+
# -x: show expanded commands
59+
set -vex
60+
61+
env | sort
62+
63+
which cmake
64+
cmake --version
65+
66+
echo ${CXX}
67+
${CXX} --version
68+
_COMPILER_NAME=`basename ${CXX}`
69+
if [ "${LIB_TYPE}" = "shared" ]; then
70+
_CMAKE_BUILD_SHARED_LIBS=ON
71+
else
72+
_CMAKE_BUILD_SHARED_LIBS=OFF
73+
fi
74+
75+
CTEST_TESTING_OPTION="-D ExperimentalTest"
76+
# - DO_MemCheck <- if set, try to use valgrind
77+
if ! ${DO_MemCheck+false}; then
78+
valgrind --version
79+
CTEST_TESTING_OPTION="-D ExperimentalMemCheck"
80+
else
81+
# - DO_Coverage <- if set, try to do dashboard coverage testing
82+
if ! ${DO_Coverage+false}; then
83+
export CXXFLAGS="-fprofile-arcs -ftest-coverage"
84+
export LDFLAGS="-fprofile-arcs -ftest-coverage"
85+
CTEST_TESTING_OPTION="-D ExperimentalTest -D ExperimentalCoverage"
86+
#gcov --version
87+
fi
88+
fi
89+
90+
# Ninja = Generates build.ninja files.
91+
if ${BUILD_TOOL+false}; then
92+
BUILD_TOOL="Ninja"
93+
export _BUILD_EXE=ninja
94+
which ninja
95+
ninja --version
96+
else
97+
# Unix Makefiles = Generates standard UNIX makefiles.
98+
export _BUILD_EXE=make
99+
fi
100+
101+
_BUILD_DIR_NAME="build-cmake_${BUILD_TYPE}_${LIB_TYPE}_${_COMPILER_NAME}_${_BUILD_EXE}"
102+
mkdir -p ${_BUILD_DIR_NAME}
103+
cd "${_BUILD_DIR_NAME}"
104+
if ${BUILDNAME+false}; then
105+
_HOSTNAME=`hostname -s`
106+
BUILDNAME="${_HOSTNAME}_${BUILD_TYPE}_${LIB_TYPE}_${_COMPILER_NAME}_${_BUILD_EXE}"
107+
fi
108+
cmake \
109+
-G "${BUILD_TOOL}" \
110+
-DBUILDNAME:STRING="${BUILDNAME}" \
111+
-DCMAKE_CXX_COMPILER:PATH=${CXX} \
112+
-DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} \
113+
-DBUILD_SHARED_LIBS:BOOL=${_CMAKE_BUILD_SHARED_LIBS} \
114+
-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR} \
115+
../
116+
117+
ctest -C ${BUILD_TYPE} -D ExperimentalStart -D ExperimentalConfigure -D ExperimentalBuild ${CTEST_TESTING_OPTION} -D ExperimentalSubmit
118+
# Final step is to verify that installation succeeds
119+
cmake --build . --config ${BUILD_TYPE} --target install
120+
121+
if [ "${DESTDIR}" != "/usr/local" ]; then
122+
${_BUILD_EXE} install
123+
fi
124+
cd -
125+
126+
if ${CLEANUP+false}; then
127+
echo "Skipping cleanup: build directory will persist."
128+
else
129+
rm -r "${_BUILD_DIR_NAME}"
130+
fi

0 commit comments

Comments
 (0)