Skip to content

Commit

Permalink
Releasing v7.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgraham-antenna committed May 28, 2020
1 parent 6392380 commit a20da6f
Show file tree
Hide file tree
Showing 17 changed files with 1,789 additions and 923 deletions.
28 changes: 28 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# AH Formatter Analysis Utility v7.0.2

Corresponds to AH Formatter V7.0 MR2.

- Summary table includes totals for each error type.
- Thumbnail hover text lists counts of error types instead of all error messages.
- Default 'report' stylesheet is 'compact-report.xsl'.
- 'compact' report typically six pages per report page.
- Added `-pdfver` option for PDF version of reports.
- Better handling hyphen errors where only one error has a message.
- Callouts only for errors with a message.
- Error message changes.
- Handling an Option Setting File with `(` and `)` in filename.
- Merging adjacent identical messages.
- Not showing AH Formatter version in report PDF.
- Better able to run Ant from a different directory.
- Consistent namespace for functions.
- Simplified XSLT stylesheet names.
- Updated l10n.
- More named templates.
- Deconstructing templates in main report stylesheet for easier reuse.
- Better generation of spaces in comments.

# AH Formatter Analysis Utility v7.0.1

Initial release.

Corresponds to AH Formatter V7.0 MR1.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# analysis-utility
# `analysis-utility` - AH Formatter Analysis Utility
Stylesheets and scripts for working with the results from AH Formatter automated analysis.

## Windows
Expand All @@ -8,22 +8,26 @@ usage: analyzer -d file [-format format] [-lang lang]
[-ahfcmd AHFCmd] [-opt "options"]
[-xslt xslt] [-xsltparam "xslt-params" ]
[-transformer transformer ]
[-force yes]
[-pdfver pdfver] [-force yes]
file : File to format and analyze
format : Analysis result format -- annotate or report
Default is annotate
Default is 'annotate'
lang : Language for error messages -- en or ja
Default is 'en'
AHFCmd : Path to AHFCmd.exe
options : Additional AHFCmd command-line parameters
xslt : XSLT stylesheet to use
xslt-params : XSLT processor parameters
transformer : XSLT 1.0 processor -- msxsl, xsltproc, or saxon6
Used with 'annotate' result format only
pdfver : PDF version of reports. Default is 'PDF1.7'
-force yes : Force all stages to run
````

`analyzer` generates a report in one of two formats:

- `-format annotate` (the default) generates a PDF version of the formmatted source document that has additional PDF annotations and PDF layers.
- `-format annotate` (the default) generates a PDF version of the formatted source document that has additional PDF annotations and PDF layers.
- `-format report` generates a PDF report that includes a copy of every page that contains an analysis error.

### `-format annotate`
Expand All @@ -32,11 +36,11 @@ This runs an XSLT 1.0 stylesheet and requires `msxsl.exe`, `xsltproc.exe`, or `j

`msxsl.exe` can be downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=21714

The script uses its built-in `ahfcmd-reporter.xsl` stylesheet to annotate the Area Tree XML for the formatted document with indications of the error areas. An alternative XSLT stylesheet can be specified with the `-xslt` parameter. Additional options and parameters can be passed to the XSLT processor with the `-xsltparam` parameter. The options and parameters must be in the correct syntax for the XSLT processor that will be used, since the `-xsltparam` value is not modified before being used.
The script uses its built-in `annotate.xsl` stylesheet to annotate the Area Tree XML for the formatted document with indications of the error areas. An alternative XSLT stylesheet can be specified with the `-xslt` parameter. Additional options and parameters can be passed to the XSLT processor with the `-xsltparam` parameter. The options and parameters must be in the correct syntax for the XSLT processor that will be used, since the `-xsltparam` value is not modified before being used.

### `-format report`

This runs the built-in `ahfcmd-reporter-xslt3.xsl` XSLT 3.0 stylesheet and requires `java.exe` to be on the PATH.
This runs the built-in `compact-report.xsl` XSLT 3.0 stylesheet and requires `java.exe` to be on the PATH.

The stylesheet generates a PDF report . An alternative XSLT stylesheet can be specified with the `-xslt` parameter. Additional options and parameters can be passed to the XSLT processor with the `-xsltparam` parameter. The options and parameters must be in the correct syntax for the XSLT processor that will be used, since the `-xsltparam` value is not modified before being used.

Expand All @@ -56,9 +60,9 @@ usage: analyzer.sh -d file [-opt "options"] [-lang lang] [-ahfcmd AHFCmd]

Requires `xsltproc` and `getopt` to be on the path.

Expects AH Formatter to be installed at `/usr/AHFormatterV7_64/run.sh`.
Expects AH Formatter to be installed at `/usr/AHFormatterV70_64/run.sh`.

The script uses its built-in `ahfcmd-reporter.xsl` stylesheet to annotate the Area Tree XML for the formatted document with indications of the error areas. An alternative XSLT stylesheet can be specified with the `-xslt` parameter. Additional options and parameters can be passed to the XSLT processor with the `-xsltparam` parameter. The options and parameters must be in the correct syntax for the XSLT processor that will be used, since the `-xsltparam` value is not modified before being used.
The script uses its built-in `annotate.xsl` stylesheet to annotate the Area Tree XML for the formatted document with indications of the error areas. An alternative XSLT stylesheet can be specified with the `-xslt` parameter. Additional options and parameters can be passed to the XSLT processor with the `-xsltparam` parameter. The options and parameters must be in the correct syntax for the XSLT processor that will be used, since the `-xsltparam` value is not modified before being used.

## Apache Ant

Expand Down
74 changes: 52 additions & 22 deletions analyzer.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@echo off


rem Copyright 2020 Antenna House, Inc.
rem
rem Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -22,34 +23,53 @@ rem https://www.microsoft.com/en-us/download/details.aspx?id=21714

setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION

rem Directory locations
set PWD=%cd%
rem Value of '%~dp0' includes trailing '\'.
set ANALYZER_DIR=%~dp0
set LIB_DIR=%ANALYZER_DIR%lib
set XSL_DIR=%ANALYZER_DIR%xsl

rem Command-line parameter defaults (possibly used in 'usage' message)
set ahfcmd=
set d=
set force=
set format=annotate
set lang=en
set opt=
set pdfver=PDF1.7
set transformer=
set xslt=
set xsltparam=

if "%1"=="" goto usage

goto start

:usage
echo.
echo Analyze a formatted file and generate annotated PDF

:usage_command_line
echo.
echo usage: analyzer -d file [-format format] [-lang lang]
echo [-ahfcmd AHFCmd] [-opt "options"]
echo [-xslt xslt] [-xsltparam "xslt-params" ]
echo [-transformer transformer ]
echo [-force yes]
echo [-pdfver pdfver] [-force yes]
echo.
echo file : File to format and analyze
echo format : Analysis result format -- annotate or report
echo Default is annotate
echo Default is '%format%'
echo lang : Language for error messages -- en or ja
echo Default is '%lang%'
echo AHFCmd : Path to AHFCmd.exe
echo options : Additional AHFCmd command-line parameters
echo xslt : XSLT stylesheet to use
echo xslt-params : XSLT processor parameters
echo transformer : XSLT 1.0 processor -- msxsl, xsltproc, or saxon6
echo Used with 'annotate' result format only
echo pdfver : PDF version of reports. Default is '%pdfver%'
echo -force yes : Force all stages to run
echo.
goto done
Expand All @@ -61,17 +81,6 @@ rem Command-line argument handling based on:
rem https://stackoverflow.com/a/32078177
rem https://stackoverflow.com/a/54234876

rem Command-line parameter defaults
set lang=en
set ahfcmd=
set d=
set opt=
set xslt=
set xsltparam=
set transformer=
set format=annotate
set force=

rem List of names of recognized parameters that do not require a value.
rem There must be at least one space (' ') at the beginning and end of
rem the list and between parameter names.
Expand All @@ -80,7 +89,7 @@ set __short_param= f
rem List of names of recognized parameters that require a value.
rem There must be at least one space (' ') at the beginning and end of
rem the list and between parameter names.
set __long_param= ahfcmd lang d opt xslt xsltparam transformer format force
set __long_param= ahfcmd d force format lang opt pdfver transformer xslt xsltparam

rem List of all recognized parameter names.
rem There must be at least one space (' ') at the beginning and end of
Expand All @@ -98,7 +107,8 @@ if "%~1"=="--" (

rem echo %1
set aux=%~1
if "%__expect_param_name%"=="yes" (
rem if "%__expect_param_name%"=="yes" (
if not "%__expect_param_name%"=="yes" goto parameters_value
if "%aux:~0,1%"=="-" (
rem Parameter name.
set __param=%aux:~1,250%
Expand All @@ -117,22 +127,27 @@ if "%aux:~0,1%"=="-" (
rem echo __param_removed: "%__param_removed%"
rem set __param_removed=
set __expect_param_name=
shift
goto initial
) else (
echo.
echo Expected a parameter starting with "-": %aux%
goto usage_command_line
)
) else (
:parameters_value
rem ) else (
rem echo __param_removed: "!__param_removed!"
rem echo __param_removed: "%__param_removed%"
rem List of all parameter names, possibly with __param removed.
if "x%__param_removed%"=="x%__all_param%" (
echo.
echo Unrecognized parameter: -!__param!
goto error
goto usage_command_line
)
set "%__param%=%~1"
set __param=
set __expect_param_name=yes
)
rem )
shift
goto initial
:parameters_done
Expand All @@ -158,9 +173,13 @@ goto error
rem echo opt: %opt%


set REPORTER_XSLT=%XSL_DIR%\ahfcmd-reporter.xsl
set REPORTER_XSLT=%XSL_DIR%\annotate.xsl
if "%format%"=="report" (
set REPORTER_XSLT=%XSL_DIR%\ahfcmd-reporter-xslt3.xsl
rem Default 'report' format is 'compact' format.
set REPORTER_XSLT=%XSL_DIR%\compact-report.xsl
) else if "%format%"=="compact" (
rem 'compact' was used internally but never in a public release.
set REPORTER_XSLT=%XSL_DIR%\compact-report.xsl
)

if not "%xslt%"=="" (
Expand Down Expand Up @@ -198,6 +217,15 @@ if not "%ahfcmd%"=="" (
goto error
)

rem Check format value before taking time to generate Area Tree XML.
if not "%format%"=="annotate" (
if not "%format%"=="compact" (
if not "%format%"=="report" (
echo Unrecognized result format: %format%
goto error
)
)
)

rem All of the reasons to generate %BASENAME%.AT.XML...

Expand Down Expand Up @@ -253,6 +281,8 @@ if not exist %BASENAME%.AT.XML (

if "%format%"=="annotate" (
goto annotate
) else if "%format%"=="compact" (
goto report
) else if "%format%"=="report" (
goto report
) else (
Expand Down Expand Up @@ -342,7 +372,7 @@ rem ----------------------------------------------------------------------
:report

if not "%transformer%"=="" (
echo '-transformer' is ignored with '-format report'
echo '-transformer' is ignored unless '-format annotate'
)

rem Whether or not to regenerate %BASENAME%.pdf...
Expand Down Expand Up @@ -419,7 +449,7 @@ goto report_pdf_done

:report_pdf_do

call :sub_2pdf %PWD%\%BASENAME%.report.fo %PWD%\%BASENAME%.report.pdf %PWD%\%BASENAME%.report.log.txt
call :sub_2pdf %PWD%\%BASENAME%.report.fo %PWD%\%BASENAME%.report.pdf %PWD%\%BASENAME%.report.log.txt "-pdfver %pdfver%"

if %ERRORLEVEL% NEQ 0 goto error

Expand Down
2 changes: 1 addition & 1 deletion analyzer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ else
fi

if [ "x$XSLT" == "x" ] ; then
REPORTER_XSLT=${XSL_DIR}/ahfcmd-reporter.xsl
REPORTER_XSLT=${XSL_DIR}/annotate.xsl
else
if [ ! -e "$XSLT" ] ; then
echo "XSLT file does not exist: $XSLT" >&2 ; exit 1
Expand Down
Loading

0 comments on commit a20da6f

Please sign in to comment.