Skip to content

Commit 9e1e02b

Browse files
committed
Merge pull request #116 from zbeekman/ford-build-deploy
Ford build updates
2 parents b30fb43 + ae2cb3f commit 9e1e02b

File tree

9 files changed

+176
-144
lines changed

9 files changed

+176
-144
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ env:
1212
# CMake build with unit tests, no documentation, with coverage analysis
1313
# No unicode so that coverage combined with the build script will cover unicode
1414
# and non-unicode code paths
15-
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DSKIP_DOC_GEN:BOOL=TRUE -DCMAKE_BUILD_TYPE=COVERAGE .. && make -j 4 check"
15+
- BUILD_SCRIPT="mkdir cmake-build && cd cmake-build && cmake -DCMAKE_BUILD_TYPE=COVERAGE .. && make -j 4 check"
1616
SPECIFIC_DEPENDS="cmake nodejs"
1717
JLINT="yes"
18-
DOCS="no"
18+
DOCS="yes"
1919
FoBiS="no"
2020
CODE_COVERAGE="yes"
2121

@@ -50,7 +50,7 @@ install:
5050
- sudo ln -fs /usr/bin/gcov-4.9 /usr/bin/gcov && gcov --version
5151
- if [[ $FoBiS == [yY]* ]]; then sudo -H pip install FoBiS.py && FoBiS.py --version; fi
5252
- if [[ $DOCS == [yY]* ]]; then sudo -H pip install ford && ford --version; fi
53-
- if [[ $CHECK_README_PROGS == [yY]* ]]; then gfortran -o f90split f90split.f90 && ./f90split README.md && shopt -s extglob && for f in !(README|CONTRIBUTING).md; do mv $f src/tests/jf_test_${f%.md}.f90; done; rm f90split.f90 f90split; fi
53+
- if [[ $CHECK_README_PROGS == [yY]* ]]; then gfortran -o f90split f90split.f90 && ./f90split README.md && for f in example*.md; do mv $f src/tests/jf_test_${f%.md}.f90; done; rm f90split.f90 f90split; fi
5454

5555
script:
5656
- echo $BUILD_SCRIPT
@@ -61,4 +61,4 @@ after_success:
6161
- if [[ $CODE_COVERAGE == [yY]* ]]; then bash <(curl -s https://codecov.io/bash) ; fi
6262
- git config --global user.name "TRAVIS-CI-for-$(git --no-pager show -s --format='%cn' $TRAVIS_COMMIT)"
6363
- git config --global user.email "$(git --no-pager show -s --format='%ce' $TRAVIS_COMMIT)"
64-
- ./deploy.sh #handles updating documentation for master branch as well as tags
64+
#broken for now# - ./deploy.sh #handles updating documentation for master branch as well as tags

CMakeLists.txt

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -138,41 +138,46 @@ set_target_properties ( ${LIB_NAME}
138138
Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR} )
139139

140140
#-------------------------------------
141-
# Build the documentation with ROBODoc
141+
# Build the documentation with FORD
142142
#-------------------------------------
143143
set ( SKIP_DOC_GEN FALSE CACHE BOOL
144-
"Disable building the API documentation with ROBODoc" )
144+
"Disable building the API documentation with FORD" )
145145
if ( NOT SKIP_DOC_GEN )
146-
find_program ( ROBODOC robodoc )
147-
if ( ROBODOC ) # Found
148-
set ( ROBODOC_OPTIONS --rc ${CMAKE_SOURCE_DIR}/robodoc.rc
149-
CACHE STRING "Options passed to robodoc to control building the documentation" )
150-
set ( DOC_DIR "${CMAKE_BINARY_DIR}/documentation" )
151-
set ( REQUIRED_ROBODOC_OPTIONS
152-
--src "${CMAKE_SOURCE_DIR}/src" --doc "${DOC_DIR}"
153-
--documenttitle "${CMAKE_PROJECT_NAME}" )
154-
# Dynamically generate the ROBODoc outputs list
155-
message ( STATUS "Dynamically computing ROBODoc output information..." )
156-
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
157-
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_DIR}
158-
COMMAND "${ROBODOC}" ${REQUIRED_ROBODOC_OPTIONS} ${ROBODOC_OPTIONS} )
159-
file ( GLOB_RECURSE ROBODOC_OUTPUTS
160-
"${DOC_DIR}/*" )
161-
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR} )
162-
message ( STATUS "Done dynamically computing ROBODoc outputs." )
146+
find_program ( FORD ford )
147+
if ( FORD ) # Found
148+
file ( COPY "${CMAKE_SOURCE_DIR}/media" DESTINATION "${CMAKE_BINARY_DIR}/" )
149+
set ( DOC_DIR "${CMAKE_BINARY_DIR}/doc" )
150+
set ( FORD_PROJECT_FILE "${CMAKE_SOURCE_DIR}/json-fortran.md" )
151+
# Dynamically generate the FORD outputs list
152+
message ( STATUS "Dynamically computing FORD output information..." )
153+
if ( NOT (DEFINED FORD_OUTPUTS_CACHED) )
154+
message ( STATUS "Running FORD to dynamically compute documentation outputs, this could take a while..." )
155+
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
156+
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_DIR}
157+
COMMAND "${FORD}" -d "${CMAKE_SOURCE_DIR}/src" -o "${DOC_DIR}" "${FORD_PROJECT_FILE}" OUTPUT_QUIET )
158+
endif ()
159+
file ( GLOB_RECURSE FORD_OUTPUTS
160+
"${DOC_DIR}/*.html" )
161+
file ( GLOB_RECURSE FORD_CLEAN_OUTPUTS
162+
"${DOC_DIR}/*.*" )
163+
if ( (DEFINED FORD_OUTPUTS) AND ( NOT ( "${FORD_OUTPUTS}" STREQUAL "" ) ) )
164+
set ( FORD_OUTPUTS_CACHED "${FORD_OUTPUTS}"
165+
CACHE INTERNAL "internal variable to attempt to prevent rebuilding FORD docs" FORCE )
166+
endif ()
167+
message ( STATUS "Done dynamically computing FORD outputs." )
163168

164169
foreach ( SRC_FILE ${JF_LIB_SRCS} ${JF_TEST_SRCS} )
165-
list ( APPEND ROBO_DEPENDS "${SRC_FILE}" )
170+
list ( APPEND FORD_DEPENDS "${SRC_FILE}" )
166171
endforeach ( SRC_FILE )
167-
add_custom_command ( OUTPUT ${ROBODOC_OUTPUTS}
168-
COMMAND "${CMAKE_COMMAND}" -E make_directory "${DOC_DIR}" # Ensure DOC_DIR exists at build time
169-
COMMAND "${ROBODOC}" ${REQUIRED_ROBODOC_OPTIONS} ${ROBODOC_OPTIONS}
170-
DEPENDS ${ROBO_DEPENDS}
171-
COMMENT "Building HTML documentation for ${CMAKE_PROJECT_NAME} using ROBODoc" )
172+
add_custom_command ( OUTPUT ${FORD_OUTPUTS_CACHED}
173+
COMMAND "${FORD}" -d "${CMAKE_SOURCE_DIR}/src" -o "${DOC_DIR}" "${FORD_PROJECT_FILE}"
174+
MAIN_DEPENDENCY "${FORD_PROJECT_FILE}"
175+
DEPENDS ${FORD_DEPENDS}
176+
COMMENT "Building HTML documentation for ${CMAKE_PROJECT_NAME} using FORD" )
172177
add_custom_target ( documentation ALL
173-
DEPENDS ${ROBODOC_OUTPUTS} )
178+
DEPENDS ${FORD_OUTPUTS} )
174179
set ( INSTALL_API_DOCUMENTATION TRUE
175-
CACHE BOOL "Install ROBODoc generated documentation?" )
180+
CACHE BOOL "Install FORD generated documentation?" )
176181
if ( INSTALL_API_DOCUMENTATION )
177182
if ( USE_GNU_INSTALL_CONVENTION )
178183
install ( DIRECTORY "${DOC_DIR}/" DESTINATION "${CMAKE_INSTALL_DOCDIR}" )
@@ -182,7 +187,7 @@ if ( NOT SKIP_DOC_GEN )
182187
endif ()
183188
else () # Not found
184189
message ( WARNING
185-
"ROBODoc not found! Please set the CMake cache variable ROBODOC to point to the installed ROBODoc binary, and reconfigure or disable building the documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/ If you do not wish to install ROBODoc and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
190+
"FORD not found! Please set the CMake cache variable FORD to point to the installed FORD executable, and reconfigure or disable building the documentation. FORD can be installed from PYPI with `sudo pip install FORD` or from <https://github.com/cmacmackin/ford> If you do not wish to install FORD and build the json-fortran documentation, then please set the CMake cache variable SKIP_DOC_GEN to TRUE." )
186191
endif ()
187192
endif ()
188193

@@ -209,7 +214,7 @@ if ( ENABLE_TESTS )
209214
set ( DATA_DIR "${CMAKE_BINARY_DIR}/files" )
210215

211216
set_directory_properties ( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
212-
"${DATA_DIR}/test2.json;${DATA_DIR}/test4.json" )
217+
"${DATA_DIR}/test2.json;${DATA_DIR}/test4.json;${FORD_CLEAN_OUTPUTS}" )
213218

214219
# Validate input
215220
if ( JSONLINT )
@@ -222,7 +227,7 @@ if ( ENABLE_TESTS )
222227
get_filename_component ( TESTNAME "${VALID_JSON}" NAME )
223228
add_test ( NAME validate-${TESTNAME}
224229
WORKING_DIRECTORY "${DATA_DIR}/inputs"
225-
COMMAND ${JSONLINT} "${VALID_JSON}" )
230+
COMMAND ${JSONLINT} "--allow=nonescape-characters" "${VALID_JSON}" )
226231
endforeach ()
227232

228233
foreach ( INVALID ${INVALID_JSON} )
@@ -267,7 +272,7 @@ if ( ENABLE_TESTS )
267272
get_filename_component ( TESTNAME ${JSON_FILE} NAME )
268273
add_test ( NAME validate-output-${TESTNAME}
269274
WORKING_DIRECTORY "${DATA_DIR}"
270-
COMMAND ${JSONLINT} ${TESTNAME} )
275+
COMMAND ${JSONLINT} "--allow=nonescape-characters" ${TESTNAME} )
271276
set_property ( TEST validate-output-${TESTNAME}
272277
APPEND
273278
PROPERTY

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ git rebase upstream/master
9090
- Please adhere to the code indentation and formatting as it currently exists, aligning common elements vertically, etc. Tab characters are not allowed. Indentations should be done with *4* space characters.
9191
- *Do NOT* allow your editor to make a bunch of indentation or white space changes, that will introduce non-substantive changes on lines that you have not actually edited.
9292
- The coding style is modern free-form Fortran, consistent with the Fortran 2008 standard. Note that the two supported compilers (ifort and gfortran) do not currently include the entire Fortran 2008 standard. Therefore, only those language features supported by Gfortran 4.9 and Intel 13.1.0 are currently allowed. This also means that previous versions of these compilers are not supported, and major changes to the code to support earlier compilers (or Fortran 95) will not be accepted. At some point in the future (when compiler support has improved), all Fortran 2008 features will be allowed.
93-
- All subroutines and functions *must* be properly documented. This includes useful inline comments as well as comment blocks using the [ROBODoc](http://rfsber.home.xs4all.nl/Robo/manual.html) syntax.
93+
- All subroutines and functions *must* be properly documented. This includes useful inline comments as well as comment blocks using the [FORD](https://github.com/cmacmackin/ford/wiki/Writing-Documentation) syntax.
9494
- For simplicity, json-fortran currently consists of one module file. It is not envisioned that it will ever need to expand to include multiple files (if it does, there would need to be a very good reason).
9595

9696
[top](#contributing-to-json-fortran)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ brew install --with-unicode-support json-fortran
6666
_Please note_, if you wish to support usage of json-fortran with
6767
multiple Fortran compilers, please follow the CMake installation
6868
instructions below, as the homebrew installation is only intended to
69-
support a single Fortran compiler. Cheers! :beers:
69+
support a single Fortran compiler. Cheers!
7070

7171
[top](#json-fortran-)
7272
Building the library
@@ -276,7 +276,7 @@ The code above produces the file:
276276
Documentation
277277
--------------
278278

279-
The API documentation for the latest release version can be found [here](http://jacobwilliams.github.io/json-fortran). The documentation can also be generated by processing the source files with [RoboDoc](http://rfsber.home.xs4all.nl/Robo/). Note that both the shell script, CMake, and SCons will also generate these files automatically in the documentation folder, assuming you have RoboDoc installed.
279+
The API documentation for the latest release version can be found [here](http://jacobwilliams.github.io/json-fortran). The documentation can also be generated by processing the source files with [FORD](https://github.com/cmacmackin/ford). Note that both the shell script, CMake, and SCons will also generate these files automatically in the documentation folder, assuming you have FORD installed.
280280

281281
[top](#json-fortran-)
282282
Contributing [![Ready in backlog](https://badge.waffle.io/jacobwilliams/json-fortran.png?label=Ready&title=Ready)](CONTRIBUTING.md)

build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# profiling flags
2121
# with :
2222
# unit tests enabled
23-
# documentation (if ROBODoc is installed)
23+
# documentation (if FORD is installed)
2424
#
2525
# More recent (right-most) flags will override preceding flags
2626
# flags:
@@ -51,19 +51,18 @@
5151
# fortran unit tests
5252
#
5353
# --skip-documentation [{yes|no}]: Skip (or don't skip) building the json-
54-
# fortran documentation using ROBODoc
54+
# fortran documentation using FORD
5555
#
5656
# REQUIRES
5757
# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
58-
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
58+
# FORD : https://github.com/cmacmackin/ford [version 3.0.2 is the one tested]
5959
#
6060
# AUTHOR
6161
# Jacob Williams : 12/27/2014
6262
#
6363

6464
set -e
6565

66-
#PROJECTNAME='jsonfortran' # project name for robodoc (example: jsonfortran_2.0.0)
6766
FORDMD='json-fortran.md' # FORD options file for building documentation
6867
DOCDIR='./documentation/' # build directory for documentation
6968
SRCDIR='./src/' # library source directory

json-fortran.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
project: json-fortran
2+
favicon: ./media/json-fortran-32x32.png
23
project_dir: ./src
4+
macro: USE_UCS4
35
output_dir: ./doc
6+
media_dir: ./media
47
project_github: https://github.com/jacobwilliams/json-fortran
58
summary: JSON-FORTRAN -- A Fortran 2008 JSON API
69
author: Jacob Williams
710
github: https://github.com/jacobwilliams
11+
website: http://degenerateconic.com
12+
twitter: https://twitter.com/degenerateconic
813
predocmark_alt: >
914
predocmark: <
1015
docmark_alt:
1116
docmark: !
1217
exclude_dir: tests
1318
exclude_dir: introspection
1419
display: public
15-
display: protected
16-
display: private
20+
protected
21+
private
1722
source: true
23+
md_extensions: markdown.extensions.toc(anchorlink=True)
24+
markdown.extensions.smarty(smart_quotes=False)
25+
26+
<!-- Uncommenting these should work, but this actually causes issues
27+
28+
*[API]: Application Programmable Interface
29+
*[JSON]: JavaScript Object Notation
30+
31+
-->
32+
33+
[TOC]
1834

1935
# Brief description
2036

media/json-fortran-32x32.png

4.17 KB
Loading
File renamed without changes.

0 commit comments

Comments
 (0)