Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java-version: [8, 11, 17, 21, 25]
java-version: [11, 17, 21, 25]

steps:
- uses: actions/checkout@v5
Expand All @@ -46,12 +46,12 @@ jobs:
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots -Dmaven.javadoc.skip=true -V -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 -Dmaven.wagon.http.pool=false verify
- name: Upload greenfield coverage report
- name: Upload CLI coverage report
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
with:
name: greenfield-report
path: greenfield-apps/target/site/jacoco/
name: cli-report
path: cli/target/site/jacoco/
- name: Upload GUI coverage report
if: matrix.java-version == 8
uses: actions/upload-artifact@v4
Expand All @@ -66,11 +66,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Download greenfield coverage report
- name: Download CLI coverage report
uses: actions/download-artifact@v4
with:
name: greenfield-report
path: greenfield-apps/target/site/jacoco/
name: cli-report
path: cli/target/site/jacoco/
- name: Download GUI coverage report
uses: actions/download-artifact@v4
with:
Expand All @@ -79,14 +79,14 @@ jobs:
- name: Codecov coverage reporting
uses: codecov/codecov-action@v2
with:
files: greenfield-apps/target/site/jacoco/jacoco.xml, gui/target/site/jacoco/jacoco.xml
files: cli/target/site/jacoco/jacoco.xml, gui/target/site/jacoco/jacoco.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}
- name: Codacy coverage reporting
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: greenfield-apps/target/site/jacoco/jacoco.xml, gui/target/site/jacoco/jacoco.xml
coverage-reports: cli/target/site/jacoco/jacoco.xml, gui/target/site/jacoco/jacoco.xml
- name: Codacy analysis reporting
uses: codacy/codacy-analysis-cli-action@master
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ passed directly as parameters when calling the shell or batch script.

In order to build this project you'll need:

- Java 8, 11, 17, 21 or 25, which can be downloaded [from Oracle](https://www.oracle.com/technetwork/java/javase/downloads/index.html), or for Linux users [OpenJDK](https://openjdk.java.net/install/index.html).
- Java 11, 17, 21 or 25, which can be downloaded [from Oracle](https://www.oracle.com/technetwork/java/javase/downloads/index.html), or for Linux users [OpenJDK](https://openjdk.java.net/install/index.html).
- [Maven v3+](https://maven.apache.org/)

Life will be easier if you also use [Git](https://git-scm.com/) to obtain and manage the source.
Expand Down Expand Up @@ -111,15 +111,15 @@ Call Maven install:

#### Testing the build

You can test your build by running the greenfield GUI application from the `greenfield-apps` sub-module.
You can test your build by running the greenfield GUI application from the `gui` sub-module.

java -jar greenfield-apps/target/greenfield-apps-${project.version}.jar
java -jar gui/target/gui-${project.version}.jar

Where `${project.version}` is the current Maven project version. This should bring up the veraPDF GUI main window if the build was successful.

## Building the Docker image

The accompanying [`Dockerfile`](Dockerfile) can be used to build a Docker image containing the veraPDF CLI and GUI applications. The image is based on the official Alpine image. It doesn't build the project, instead it downloads a version of the installer. It also builds a slimline JRE which is used to trim the final image size.
The accompanying [`Dockerfile`](Dockerfile) can be used to build a Docker image containing the veraPDF CLI application. The image is based on the official Alpine image. It doesn't build the project, instead it downloads a version of the installer. It also builds a slimline JRE which is used to trim the final image size.

The version built is controlled by three arguments in the Dockerfile, `VERAPDF_VERSION`, `VERAPDF_MINOR_VERSION` and `VERAPDF_INSTALLER_FOLDER`. These can be used to select a specific installer at invocation time. The default values are `VERAPDF_VERSION=1.28`, `VERAPDF_MINOR_VERSION=2` and `VERAPDF_INSTALLER_FOLDER=releases`, which builds the latest production version, e.g. `1.28.2`.

Expand Down
88 changes: 88 additions & 0 deletions apps/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

This file is part of VeraPDF Library GUI, a module of the veraPDF project.
Copyright (c) 2015-2025, veraPDF Consortium <info@verapdf.org>
All rights reserved.

VeraPDF Library GUI is free software: you can redistribute it and/or modify
it under the terms of either:

The GNU General public license GPLv3+.
You should have received a copy of the GNU General Public License
along with VeraPDF Library GUI as the LICENSE.GPL file in the root of the source
tree. If not, see http://www.gnu.org/licenses/ or
https://www.gnu.org/licenses/gpl-3.0.en.html.

The Mozilla Public License MPLv2+.
You should have received a copy of the Mozilla Public License along with
VeraPDF Library GUI as the LICENSE.MPL file in the root of the source tree.
If a copy of the MPL was not distributed with this file, you can obtain one at
http://mozilla.org/MPL/2.0/.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.verapdf</groupId>
<artifactId>verapdf-apps</artifactId>
<version>1.29.0-SNAPSHOT</version>
</parent>

<groupId>org.verapdf.apps</groupId>
<artifactId>apps</artifactId>
<name>VeraPDF Library Apps</name>

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>org.verapdf.apps</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>

</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
</resource>
</resources>
</build>

<dependencies>

<dependency>
<groupId>org.verapdf</groupId>
<artifactId>core</artifactId>
<version>${verapdf.library.version}</version>
</dependency>

<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private static File getStartFile(File veraPdfDirectory) {
* @return the Application Release details for the GUI
*/
public static ReleaseDetails getAppDetails() {
return ReleaseDetails.byId("gui"); //$NON-NLS-1$
return ReleaseDetails.byId("apps"); //$NON-NLS-1$
}

/**
Expand Down
9 changes: 9 additions & 0 deletions apps/src/main/java/org/verapdf/apps/AppsConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.verapdf.apps;

public class AppsConstants {

// File extensions
public static final String PDF = "pdf"; //$NON-NLS-1$
public static final String ZIP = "zip"; //$NON-NLS-1$

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import javax.xml.parsers.*;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;

import org.verapdf.ReleaseDetails;
Expand All @@ -42,7 +41,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

/**
* @author <a href="mailto:carl@openpreservation.org">Carl Wilson</a>
Expand All @@ -52,7 +50,7 @@

public class SoftwareUpdaterImpl implements SoftwareUpdater {
private static final Logger logger = Logger.getLogger(SoftwareUpdaterImpl.class.getCanonicalName());
private static final String latestGF = "https://search.maven.org/solrsearch/select?q=g:org.verapdf.apps+AND+a:greenfield-apps&core=gav&rows=1&wt=xml";
private static final String latestGF = "https://search.maven.org/solrsearch/select?q=g:org.verapdf.apps+AND+a:apps&core=gav&rows=1&wt=xml";
private final String currentVersion = Applications.getAppDetails().getVersion();

/**
Expand Down Expand Up @@ -131,7 +129,7 @@ private static SemanticVersionNumber getLatestVersionFromUrl(final String endpoi
XPath path = XPathFactory.newInstance().newXPath();
NodeList versions = ((NodeList) path.evaluate("//str[@name='v']", doc, XPathConstants.NODESET));
return Versions.fromString(versions.item(0).getFirstChild().getNodeValue());
} catch (IOException | ParserConfigurationException | SAXException | XPathExpressionException excep) {
} catch (Exception excep) {
excep.printStackTrace();
throw new IllegalStateException(String.format("Problem parsing version number from URL %s", endpoint), //$NON-NLS-1$
excep);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

import javanet.staxutils.SimpleNamespaceContext;
import org.verapdf.apps.Applications;
import org.verapdf.apps.AppsConstants;
import org.verapdf.core.utils.FileUtils;
import org.verapdf.features.FeatureExtractorConfig;
import org.verapdf.features.FeatureFactory;
import org.verapdf.features.FeatureObjectType;
import org.verapdf.gui.utils.GUIConstants;
import org.verapdf.policy.SchematronGenerator;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;
Expand Down Expand Up @@ -84,8 +84,8 @@ public static List<File> filterPdfFiles(final List<File> toFilter, final boolean
continue;
}
if (file.isFile()) {
if (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), GUIConstants.PDF) ||
FileUtils.hasExtNoCase(file.getName(), GUIConstants.ZIP)) {
if (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), AppsConstants.PDF) ||
FileUtils.hasExtNoCase(file.getName(), AppsConstants.ZIP)) {
retVal.add(file);
} else {
LOGGER.log(Level.SEVERE, "File " + file.getAbsolutePath() + " doesn't have a .pdf extension. Try using --nonpdfext flag");
Expand All @@ -102,7 +102,7 @@ private static List<File> filterPdfFilesFromDirs(final List<File> toFilter,
Applications.checkArgNotNull(toFilter, "toFilter"); //$NON-NLS-1$
List<File> retVal = new ArrayList<>();
for (File file : toFilter) {
if (file.isFile() && (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), GUIConstants.PDF))) {
if (file.isFile() && (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), AppsConstants.PDF))) {
retVal.add(file);
} else if (file.isDirectory() && isRecursive) {
retVal.addAll(filterPdfFilesFromDirs(Arrays.asList(file.listFiles()), isRecursive, nonPdfExt));
Expand Down
4 changes: 4 additions & 0 deletions apps/src/main/resources/org/verapdf/release/apps.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
verapdf.project.id=${project.artifactId}
verapdf.release.version=${project.version}
verapdf.release.date=${verapdf.timestamp}
verapdf.date.format=${maven.build.timestamp.format}
7 changes: 3 additions & 4 deletions auto-install-tmp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
</com.izforge.izpack.panels.target.TargetPanel>
<com.izforge.izpack.panels.packs.PacksPanel id="sdk_pack_select">
<pack index="0" name="veraPDF GUI" selected="true"/>
<pack index="1" name="veraPDF Mac and *nix Scripts" selected="true"/>
<pack index="2" name="veraPDF Corpus and Validation model" selected="false"/>
<pack index="3" name="veraPDF Documentation" selected="true"/>
<pack index="4" name="veraPDF Sample Plugins" selected="false"/>
<pack index="1" name="veraPDF CLI" selected="true"/>
<pack index="2" name="veraPDF Documentation" selected="true"/>
<pack index="3" name="veraPDF Sample Plugins" selected="false"/>
</com.izforge.izpack.panels.packs.PacksPanel>
<com.izforge.izpack.panels.install.InstallPanel id="install"/>
<com.izforge.izpack.panels.finish.FinishPanel id="finish"/>
Expand Down
Loading
Loading