Optionally use an external checker

This commit is contained in:
Filip Gralinski 2022-06-06 20:03:04 +02:00
parent b81c455a1b
commit 6f9f5f6a07
2 changed files with 15 additions and 2 deletions

View File

@ -35,13 +35,14 @@ make
withEnv(["HOME=${env.WORKSPACE}"]) {
sh """
rm -f autozoil.xml
make autozoil.xml
make autozoil
"""
}}
post {
always {
archiveArtifacts artifacts: 'autozoil.xml', fingerprint: true
archiveArtifacts artifacts: 'autozoil*.xml', fingerprint: true
junit testResults: 'autozoil-external-check.xml', skipPublishingChecks: true
// junit testResults: 'autozoil.xml'
}
}

View File

@ -13,6 +13,8 @@ CURRENT_DIR=$(shell pwd)
AUTOZOIL_DIR?=/opt/autozoil
AUTOZOIL_LOCALE={{cookiecutter.locale}}
EXTERNAL_PLAIN_TEXT_CHECKER=
space := $(subst ,, )
ifneq (,$(wildcard appendix.tex))
@ -96,6 +98,16 @@ scores/%.txt:
autozoil-log.txt: $(CONTENT_TEX_SOURCES)
cd $(AUTOZOIL_DIR) && set -o pipefail && ./autozoil --locale $(AUTOZOIL_LOCALE) $(CONTENT_TEX_SOURCES_WITH_DIR) --alt-log-file $(CURRENT_DIR)/$(PAPER_ID).log | tee $(CURRENT_DIR)/$@
ifeq ($(EXTERNAL_PLAIN_TEXT_CHECKER),)
autozoil: autozoil.xml
else
autozoil: autozoil.xml autozoil-external-check.xml
autozoil-external-check.xml: sentences.txt
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@sentences.txt" $(EXTERNAL_PLAIN_TEXT_CHECKER) > $@
endif
autozoil.xml: $(CONTENT_TEX_SOURCES)
cd $(AUTOZOIL_DIR) && set -o pipefail && ./autozoil --locale $(AUTOZOIL_LOCALE) $(CONTENT_TEX_SOURCES_WITH_DIR) --format xml --alt-log-file $(CURRENT_DIR)/$(PAPER_ID).log --exit-with-zero > $(CURRENT_DIR)/autozoil.xml