Skip to content

Commit 7d5db84

Browse files
committed
Run tests with gradle test
* Update the docs to explain how to run tests * Create GitHub Actions CI to replace Travis CI Closes #269 Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 84ec6ad commit 7d5db84

12 files changed

Lines changed: 402 additions & 67 deletions

File tree

.github/workflows/tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Tests CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
jdk: [8, 11, 17] # lts releases
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set up JDK ${{ matrix.jdk }}
15+
uses: actions/setup-java@v3
16+
with:
17+
java-version: ${{ matrix.jdk }}
18+
distribution: 'temurin'
19+
- name: Validate Gradle wrapper
20+
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
21+
- name: Build with Gradle
22+
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
23+
with:
24+
arguments: test
25+

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ doc/
55
modbuild.xml
66
modules.xml
77
*.iml
8+
.gradle
9+
/bin/

.travis.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.adoc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
:artifactId: jing
44
:repository: jing-trang
55

6-
image:https://travis-ci.org/relaxng/{repository}.svg?branch=master["Build Status", link="https://travis-ci.org/relaxng/{repository}"]
6+
image:https://img.shields.io/github/workflow/status/relaxng/{repository}/tests/master?style=plastic["Build Status", link="https://github.com/relaxng/jing-trang/actions/workflows/tests.yml?query=branch%3Amaster"]
77
image:https://maven-badges.herokuapp.com/maven-central/{groupId}/{artifactId}/badge.svg["Artifact on Maven Central", link="http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22{groupId}%22%20a%3A%22{artifactId}%22"]
88
image:http://www.javadoc.io/badge/{groupId}/{artifactId}.svg["Javadocs", link="http://www.javadoc.io/doc/{groupId}/{artifactId}"]
99

10-
After cloning the repository, here's how to build.
10+
== Building
1111

1212
. Ensure you have git and JDK 8 or above installed.
1313
All other dependencies are included in the repository.
@@ -26,11 +26,8 @@ After cloning the repository, here's how to build.
2626
. Change your working directory to be the `jing-trang` directory (that is,
2727
the directory containing this file).
2828

29-
. Run the `ant` script included in the repository. On Linux, use the
30-
command `./ant`. On Windows, use `.\ant`.
31-
That runs the version of `ant` included in the repository. When the
32-
`ant` script completes, you should find `jing.jar` and `trang.jar` files
29+
. Run `./gradlew` (Linux, macOS) or `.\gradle.bat` (Windows) at the root of the repository to build the project.
30+
When the build completes, you should find `jing.jar` and `trang.jar` files
3331
in the `build` subdirectory.
34-
You can also tell the `ant` script to build the `test` target, which
35-
will build the jars and then run some tests. On Linux, use the command
36-
`./ant test`. On Windows, use `.\ant test`.
32+
You can also use `./gradlew test` or `.\gradle.bat test` to run the `test` target, which
33+
will build the jars and then run some tests.

build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ tasks.named("build") {
7575
dependsOn(jingTrang)
7676
}
7777

78+
tasks.named("test") {
79+
dependsOn(jingTrang)
80+
dependsOn(":ant-test")
81+
}
82+
7883
val antJar: TaskProvider<Task> = tasks.named("ant-jar")
7984

8085
// https://stackoverflow.com/questions/27993814/only-run-task-if-another-isnt-up-to-date-in-gradle

build.xml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</target>
5252

5353
<target name="ant-test" depends="modbuild">
54-
<ant antfile="modbuild.xml" target="ant-test"/>
54+
<ant antfile="modbuild.xml" target="test"/>
5555
</target>
5656

5757
<target name="srczip" depends="modbuild">
@@ -275,12 +275,12 @@
275275
</copy>
276276
<replace file="${build.dir}/jing-bin/readme.html" token="@VERSION@" value="${version}"/>
277277
<zip zipfile="${build.dir}/dist/jing-${version}.zip">
278-
<zipfileset dir="${build.dir}" includes="jing.jar" prefix="jing-${version}/bin"/>
278+
<zipfileset dir="${build.dir}" includes="jing.jar" prefix="jing-${version}/bin"/>
279279
<zipfileset dir="lib" includes="saxon9.jar,isorelax.jar,xercesImpl.jar,xml-apis.jar"
280-
prefix="jing-${version}/bin"/>
280+
prefix="jing-${version}/bin"/>
281281
<zipfileset dir="${build.dir}/mod/jing"
282282
includes="src.zip"
283-
prefix="jing-${version}"/>
283+
prefix="jing-${version}"/>
284284
<zipfileset dir="${build.dir}" includes="api/**" prefix="jing-${version}/doc"/>
285285
<zipfileset dir="eg" includes="relaxng.rng,xslt.rng,relaxCore.rng,relaxCoreDatatypes.rng"
286286
prefix="jing-${version}/lib"/>
@@ -337,7 +337,7 @@
337337
includes="trang.jar"
338338
prefix="trang-${version}"/>
339339
<zipfileset dir="${build.dir}/mod/trang"
340-
includes="src.zip"
340+
includes="src.zip"
341341
prefix="trang-${version}"/>
342342
</zip>
343343
<checksum file="${build.dir}/dist/trang-${version}.zip" algorithm="sha1"/>
@@ -380,7 +380,7 @@
380380
includes="dtdinst.jar"
381381
prefix="dtdinst-${version}"/>
382382
<zipfileset dir="${build.dir}/mod/dtdinst"
383-
includes="src.zip"
383+
includes="src.zip"
384384
prefix="dtdinst-${version}"/>
385385
</zip>
386386
<checksum file="${build.dir}/dist/dtdinst-${version}.zip" algorithm="sha1"/>
@@ -430,24 +430,24 @@
430430
description="Upload files to Google Code. Run dist before this.">
431431
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
432432
classpath="${lib.dir}/ant-googlecode.jar" name="gcupload"/>
433-
<gcupload username="${googlecode.username}"
434-
password="${googlecode.password}"
435-
projectname="jing-trang"
436-
targetfilename="jing-${version}.zip"
433+
<gcupload username="${googlecode.username}"
434+
password="${googlecode.password}"
435+
projectname="jing-trang"
436+
targetfilename="jing-${version}.zip"
437437
filename="${build.dir}/dist/jing-${version}.zip"
438438
summary="Jing version ${version} packaged for use with JRE (includes binary, source and documentation)"
439439
labels="Featured, Type-Archive, OpSys-All, Version-${version}"/>
440-
<gcupload username="${googlecode.username}"
441-
password="${googlecode.password}"
442-
projectname="jing-trang"
443-
targetfilename="trang-${version}.zip"
440+
<gcupload username="${googlecode.username}"
441+
password="${googlecode.password}"
442+
projectname="jing-trang"
443+
targetfilename="trang-${version}.zip"
444444
filename="${build.dir}/dist/trang-${version}.zip"
445445
summary="Trang version ${version} packaged for use with JRE (includes binary, source and documentation)"
446446
labels="Featured, Type-Archive, OpSys-All, Version-${version}"/>
447-
<gcupload username="${googlecode.username}"
448-
password="${googlecode.password}"
449-
projectname="jing-trang"
450-
targetfilename="dtdinst-${version}.zip"
447+
<gcupload username="${googlecode.username}"
448+
password="${googlecode.password}"
449+
projectname="jing-trang"
450+
targetfilename="dtdinst-${version}.zip"
451451
filename="${build.dir}/dist/dtdinst-${version}.zip"
452452
summary="DTDinst version ${version} packaged for use with JRE (includes binary, source and documentation)"
453453
labels="Type-Archive, OpSys-All, Version-${version}"/>

build.xsl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<xsl:output indent="yes"
66
encoding="utf-8"/>
7-
7+
88
<xsl:variable name="build" select="'${build.dir}'"/>
99
<xsl:variable name="doc" select="'${doc.dir}'"/>
1010
<xsl:template match="/">
@@ -336,13 +336,12 @@
336336
<xslt style="{$srctestdir}/{@transform}"
337337
in="{$srctest}"
338338
out="{$runtestdir}/{@name}test.xml">
339-
<factory name="net.sf.saxon.TransformerFactoryImpl">
340-
<classpath>
341-
<fileset dir="lib">
342-
<filename name="saxon9.jar"/>
343-
</fileset>
344-
</classpath>
345-
</factory>
339+
<factory name="net.sf.saxon.TransformerFactoryImpl" />
340+
<classpath>
341+
<fileset dir="lib">
342+
<filename name="saxon9.jar"/>
343+
</fileset>
344+
</classpath>
346345
</xslt>
347346
<!-- XXX Could validate intermediate result against a schema -->
348347
</xsl:if>

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)