Skip to content

Commit a264d96

Browse files
committed
Separate cli and gui
1 parent 405f777 commit a264d96

35 files changed

+322
-176
lines changed

.github/workflows/test-pr.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
cache: maven
4747
- name: Build with Maven
4848
run: mvn --batch-mode --update-snapshots -Dmaven.javadoc.skip=true -V -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 -Dmaven.wagon.http.pool=false verify
49-
- name: Upload greenfield coverage report
49+
- name: Upload CLI coverage report
5050
if: matrix.java-version == 8
5151
uses: actions/upload-artifact@v4
5252
with:
53-
name: greenfield-report
54-
path: greenfield-apps/target/site/jacoco/
53+
name: cli-report
54+
path: cli/target/site/jacoco/
5555
- name: Upload GUI coverage report
5656
if: matrix.java-version == 8
5757
uses: actions/upload-artifact@v4
@@ -66,11 +66,11 @@ jobs:
6666

6767
steps:
6868
- uses: actions/checkout@v4
69-
- name: Download greenfield coverage report
69+
- name: Download CLI coverage report
7070
uses: actions/download-artifact@v4
7171
with:
72-
name: greenfield-report
73-
path: greenfield-apps/target/site/jacoco/
72+
name: cli-report
73+
path: cli/target/site/jacoco/
7474
- name: Download GUI coverage report
7575
uses: actions/download-artifact@v4
7676
with:

apps/pom.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
This file is part of VeraPDF Library GUI, a module of the veraPDF project.
5+
Copyright (c) 2015-2025, veraPDF Consortium <info@verapdf.org>
6+
All rights reserved.
7+
8+
VeraPDF Library GUI is free software: you can redistribute it and/or modify
9+
it under the terms of either:
10+
11+
The GNU General public license GPLv3+.
12+
You should have received a copy of the GNU General Public License
13+
along with VeraPDF Library GUI as the LICENSE.GPL file in the root of the source
14+
tree. If not, see http://www.gnu.org/licenses/ or
15+
https://www.gnu.org/licenses/gpl-3.0.en.html.
16+
17+
The Mozilla Public License MPLv2+.
18+
You should have received a copy of the Mozilla Public License along with
19+
VeraPDF Library GUI as the LICENSE.MPL file in the root of the source tree.
20+
If a copy of the MPL was not distributed with this file, you can obtain one at
21+
http://mozilla.org/MPL/2.0/.
22+
23+
-->
24+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26+
<modelVersion>4.0.0</modelVersion>
27+
28+
<parent>
29+
<groupId>org.verapdf</groupId>
30+
<artifactId>verapdf-apps</artifactId>
31+
<version>1.29.0-SNAPSHOT</version>
32+
</parent>
33+
34+
<groupId>org.verapdf.apps</groupId>
35+
<artifactId>apps</artifactId>
36+
<name>VeraPDF Library Apps</name>
37+
38+
<build>
39+
<resources>
40+
<resource>
41+
<directory>src/main/resources</directory>
42+
<filtering>true</filtering>
43+
<includes>
44+
<include>**/*.properties</include>
45+
</includes>
46+
</resource>
47+
<resource>
48+
<directory>src/main/resources</directory>
49+
<filtering>false</filtering>
50+
<excludes>
51+
<exclude>**/*.properties</exclude>
52+
</excludes>
53+
</resource>
54+
</resources>
55+
</build>
56+
57+
<dependencies>
58+
59+
<dependency>
60+
<groupId>org.verapdf</groupId>
61+
<artifactId>core</artifactId>
62+
<version>${verapdf.library.version}</version>
63+
</dependency>
64+
65+
<dependency>
66+
<groupId>nl.jqno.equalsverifier</groupId>
67+
<artifactId>equalsverifier</artifactId>
68+
</dependency>
69+
70+
</dependencies>
71+
72+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.verapdf.apps;
2+
3+
public class AppsConstants {
4+
5+
public static final String PDF = "pdf"; //$NON-NLS-1$
6+
public static final String ZIP = "zip"; //$NON-NLS-1$
7+
8+
}

gui/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java renamed to apps/src/main/java/org/verapdf/apps/utils/ApplicationUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
import javanet.staxutils.SimpleNamespaceContext;
3232
import org.verapdf.apps.Applications;
33+
import org.verapdf.apps.AppsConstants;
3334
import org.verapdf.core.utils.FileUtils;
3435
import org.verapdf.features.FeatureExtractorConfig;
3536
import org.verapdf.features.FeatureFactory;
3637
import org.verapdf.features.FeatureObjectType;
37-
import org.verapdf.gui.utils.GUIConstants;
3838
import org.verapdf.policy.SchematronGenerator;
3939
import org.w3c.dom.Document;
4040
import org.xml.sax.SAXException;
@@ -84,8 +84,8 @@ public static List<File> filterPdfFiles(final List<File> toFilter, final boolean
8484
continue;
8585
}
8686
if (file.isFile()) {
87-
if (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), GUIConstants.PDF) ||
88-
FileUtils.hasExtNoCase(file.getName(), GUIConstants.ZIP)) {
87+
if (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), AppsConstants.PDF) ||
88+
FileUtils.hasExtNoCase(file.getName(), AppsConstants.ZIP)) {
8989
retVal.add(file);
9090
} else {
9191
LOGGER.log(Level.SEVERE, "File " + file.getAbsolutePath() + " doesn't have a .pdf extension. Try using --nonpdfext flag");
@@ -102,7 +102,7 @@ private static List<File> filterPdfFilesFromDirs(final List<File> toFilter,
102102
Applications.checkArgNotNull(toFilter, "toFilter"); //$NON-NLS-1$
103103
List<File> retVal = new ArrayList<>();
104104
for (File file : toFilter) {
105-
if (file.isFile() && (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), GUIConstants.PDF))) {
105+
if (file.isFile() && (nonPdfExt || FileUtils.hasExtNoCase(file.getName(), AppsConstants.PDF))) {
106106
retVal.add(file);
107107
} else if (file.isDirectory() && isRecursive) {
108108
retVal.addAll(filterPdfFilesFromDirs(Arrays.asList(file.listFiles()), isRecursive, nonPdfExt));

cli/pom.xml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
This file is part of VeraPDF Library GUI, a module of the veraPDF project.
5+
Copyright (c) 2015-2025, veraPDF Consortium <info@verapdf.org>
6+
All rights reserved.
7+
8+
VeraPDF Library GUI is free software: you can redistribute it and/or modify
9+
it under the terms of either:
10+
11+
The GNU General public license GPLv3+.
12+
You should have received a copy of the GNU General Public License
13+
along with VeraPDF Library GUI as the LICENSE.GPL file in the root of the source
14+
tree. If not, see http://www.gnu.org/licenses/ or
15+
https://www.gnu.org/licenses/gpl-3.0.en.html.
16+
17+
The Mozilla Public License MPLv2+.
18+
You should have received a copy of the Mozilla Public License along with
19+
VeraPDF Library GUI as the LICENSE.MPL file in the root of the source tree.
20+
If a copy of the MPL was not distributed with this file, you can obtain one at
21+
http://mozilla.org/MPL/2.0/.
22+
23+
-->
24+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
26+
<modelVersion>4.0.0</modelVersion>
27+
28+
<parent>
29+
<groupId>org.verapdf</groupId>
30+
<artifactId>verapdf-apps</artifactId>
31+
<version>1.29.0-SNAPSHOT</version>
32+
</parent>
33+
34+
<groupId>org.verapdf.apps</groupId>
35+
<artifactId>cli</artifactId>
36+
<name>VeraPDF Library CLI</name>
37+
38+
<build>
39+
<plugins>
40+
41+
<plugin>
42+
<artifactId>maven-compiler-plugin</artifactId>
43+
</plugin>
44+
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-assembly-plugin</artifactId>
48+
<configuration>
49+
<archive>
50+
<manifest>
51+
<mainClass>org.verapdf.apps.GreenfieldCliWrapper</mainClass>
52+
</manifest>
53+
</archive>
54+
<descriptorRefs>
55+
<descriptorRef>jar-with-dependencies</descriptorRef>
56+
</descriptorRefs>
57+
<appendAssemblyId>false</appendAssemblyId>
58+
</configuration>
59+
<executions>
60+
<execution>
61+
<id>make-assembly</id> <!-- this is used for inheritance merges -->
62+
<phase>package</phase> <!-- bind to the packaging phase -->
63+
<goals>
64+
<goal>single</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
69+
70+
</plugins>
71+
</build>
72+
73+
<dependencies>
74+
75+
<dependency>
76+
<groupId>org.verapdf</groupId>
77+
<artifactId>validation-model</artifactId>
78+
<version>${verapdf.validation.version}</version>
79+
</dependency>
80+
81+
<dependency>
82+
<groupId>javax.xml.bind</groupId>
83+
<artifactId>jaxb-api</artifactId>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>com.sun.xml.bind</groupId>
88+
<artifactId>jaxb-core</artifactId>
89+
</dependency>
90+
91+
<dependency>
92+
<groupId>com.sun.xml.bind</groupId>
93+
<artifactId>jaxb-impl</artifactId>
94+
</dependency>
95+
96+
<dependency>
97+
<groupId>org.verapdf.apps</groupId>
98+
<artifactId>apps</artifactId>
99+
<version>${project.version}</version>
100+
</dependency>
101+
102+
<dependency>
103+
<groupId>org.verapdf</groupId>
104+
<artifactId>core</artifactId>
105+
<version>${verapdf.library.version}</version>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>com.beust</groupId>
110+
<artifactId>jcommander</artifactId>
111+
</dependency>
112+
113+
<dependency>
114+
<groupId>junit</groupId>
115+
<artifactId>junit</artifactId>
116+
</dependency>
117+
118+
<dependency>
119+
<groupId>nl.jqno.equalsverifier</groupId>
120+
<artifactId>equalsverifier</artifactId>
121+
</dependency>
122+
123+
</dependencies>
124+
125+
</project>

0 commit comments

Comments
 (0)