From 1c7bc5914fe605bb8c7a406e529ca085bb440d40 Mon Sep 17 00:00:00 2001 From: Alexander Dyuzhev Date: Fri, 3 Apr 2020 12:34:47 +0300 Subject: [PATCH] Barcode and QRcode processing added (#19) * Code updated for barcode support * barcode4j project added * Makefile updated Co-authored-by: Ronald Tse --- .github/workflows/macos.yml | 8 ++++---- .github/workflows/release.yml | 9 +++++++-- .github/workflows/ubuntu.yml | 16 +++++++-------- Makefile | 21 +++++++++++--------- README.adoc | 10 +++++----- pom.xml | 24 +++++++++++++++-------- settings.xml | 33 +++++++++++++++++++++++++++++++ settings.xml.in | 37 ----------------------------------- 8 files changed, 85 insertions(+), 73 deletions(-) create mode 100644 settings.xml delete mode 100644 settings.xml.in diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 83bb7ba8..a44ce8cc 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -39,15 +39,15 @@ jobs: - name: Build env: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - PAT_USERNAME: ${{ secrets.PAT_USERNAME }} + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} run: | make all - name: Run tests env: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - PAT_USERNAME: ${{ secrets.PAT_USERNAME }} + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} run: | export MN_PDF_FONT_PATH=${GITHUB_WORKSPACE}/fonts ls -alR ${MN_PDF_FONT_PATH} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8446d777..254beeab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,11 +33,16 @@ jobs: - uses: actions/checkout@master - name: Build + env: + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} run: | make all - name: Run tests env: + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} MN_PDF_FONT_PATH: ~/.fonts run: | make test @@ -46,7 +51,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} with: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} @@ -64,7 +69,7 @@ jobs: id: upload-release-asset uses: actions/upload-release-asset@v1.0.1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./target/mn2pdf-${{ steps.get_version.outputs.VERSION }}.jar diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 355ec949..9d12e99a 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -25,23 +25,23 @@ jobs: # If necessary echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections - sudo apt-get install ttf-mscorefonts-installer +# sudo apt-get install ttf-mscorefonts-installer - - name: Setup Cambria fonts - run: | - curl -Ls https://raw.githubusercontent.com/metanorma/vista-fonts-installer/master/vista-fonts-installer.sh | sudo bash +# - name: Setup Cambria fonts +# run: | +# curl -Ls https://raw.githubusercontent.com/metanorma/vista-fonts-installer/master/vista-fonts-installer.sh | sudo bash - name: Build env: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - PAT_USERNAME: ${{ secrets.PAT_USERNAME }} + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} run: | make all - name: Run tests env: - PAT_TOKEN: ${{ secrets.PAT_TOKEN }} - PAT_USERNAME: ${{ secrets.PAT_USERNAME }} + GITHUB_TOKEN: ${{ github.token }} + GITHUB_USERNAME: ${{ github.actor }} MN_PDF_FONT_PATH: ~/.fonts run: | make test diff --git a/Makefile b/Makefile index 183b348d..e03a7a4e 100644 --- a/Makefile +++ b/Makefile @@ -7,17 +7,20 @@ JAR_FILE := mn2pdf-$(JAR_VERSION).jar all: target/$(JAR_FILE) -target/$(JAR_FILE): settings.xml - mvn -DskipTests clean package shade:shade +target/$(JAR_FILE): + mvn --settings settings.xml -DskipTests clean package shade:shade test: target/$(JAR_FILE) - mvn test surefire-report:report - -settings.xml: - PAT_TOKEN=${PAT_TOKEN}; \ - PAT_USERNAME=${PAT_USERNAME}; \ - envsubst < settings.xml.in > ~/.m2/settings.xml - cat ~/.m2/settings.xml + mvn --settings settings.xml test surefire-report:report + +# settings.xml: settings.xml.in +#settings: +# GITHUB_USERNAME=${GITHUB_USERNAME} +# GITHUB_TOKEN=${GITHUB_TOKEN} +# envsubst < settings.xml > ~/.m2/settings.xml +# cp settings.xml ~/.m2/settings.xml +# cat ~/.m2/settings.xml + clean: mvn clean diff --git a/README.adoc b/README.adoc index fe8b9dfb..16dd4759 100644 --- a/README.adoc +++ b/README.adoc @@ -14,14 +14,14 @@ You will need the `maven` build tool and `make`. [source,sh] ---- -java -jar target/mn2pdf-1.5.jar --xml-file --xsl-file --pdf-file +java -jar target/mn2pdf-1.6.jar --xml-file --xsl-file --pdf-file ---- e.g. [source,sh] ---- -java -jar target/mn2pdf-1.5.jar --xml-file tests/G.191.xml --xsl-file tests/itu.recommendation.xsl --pdf-file tests/G.191.pdf +java -jar target/mn2pdf-1.6.jar --xml-file tests/G.191.xml --xsl-file tests/itu.recommendation.xsl --pdf-file tests/G.191.pdf ---- @@ -41,7 +41,7 @@ Update version in `pom.xml`, e.g.: ---- com.metanorma.fop mn2pdf -1.5 +1.6 Metanorma XML to PDF converter ---- @@ -52,8 +52,8 @@ Tag the same version in Git: [source,xml] ---- -git tag v1.5 -git push origin v1.5 +git tag v1.6 +git push origin v1.6 ---- Then the corresponding GitHub release will be automatically created at: diff --git a/pom.xml b/pom.xml index bc24a6e0..b19c72b9 100644 --- a/pom.xml +++ b/pom.xml @@ -18,13 +18,21 @@ com.metanorma.fop.mn2pdf 5.4.2 - - - metanormarepository - Metanorma repository - https://maven.pkg.github.com/metanorma/barcode4j - - + + + central + https://repo1.maven.org/maven2 + true + true + + + metanorma + GitHub Metanorma Apache Maven Packages + https://maven.pkg.github.com/metanorma/barcode4j + true + true + + @@ -105,7 +113,7 @@ net.sf.barcode4j barcode4j - 2.2-SNAPSHOT + 2.3 net.sf.barcode4j diff --git a/settings.xml b/settings.xml new file mode 100644 index 00000000..b9b532e6 --- /dev/null +++ b/settings.xml @@ -0,0 +1,33 @@ + + + + multiple-repos + + + + + multiple-repos + + + central + https://repo1.maven.org/maven2 + + + metanorma + GitHub Metanorma Apache Maven Packages + https://maven.pkg.github.com/metanorma/barcode4j + + + + + + + + metanorma + ${env.GITHUB_USERNAME} + ${env.GITHUB_TOKEN} + + + diff --git a/settings.xml.in b/settings.xml.in deleted file mode 100644 index abc39e4b..00000000 --- a/settings.xml.in +++ /dev/null @@ -1,37 +0,0 @@ - - - - - github - - - - - github - - - central - https://repo1.maven.org/maven2 - true - true - - - github - GitHub Metanorma Apache Maven Packages - https://maven.pkg.github.com/metanorma/barcode4j - - - - - - - - github - ${PAT_USERNAME} - ${PAT_TOKEN} - - - -