Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with gradle test #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests CI

on: [push]

jobs:
build:
strategy:
matrix:
jdk: [8, 11, 17] # lts releases
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: test

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ doc/
modbuild.xml
modules.xml
*.iml
.gradle
/bin/
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

15 changes: 6 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
:artifactId: jing
:repository: jing-trang

image:https://travis-ci.org/relaxng/{repository}.svg?branch=master["Build Status", link="https://travis-ci.org/relaxng/{repository}"]
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"]
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"]
image:http://www.javadoc.io/badge/{groupId}/{artifactId}.svg["Javadocs", link="http://www.javadoc.io/doc/{groupId}/{artifactId}"]

After cloning the repository, here's how to build.
== Building

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

. Run the `ant` script included in the repository. On Linux, use the
command `./ant`. On Windows, use `.\ant`.
That runs the version of `ant` included in the repository. When the
`ant` script completes, you should find `jing.jar` and `trang.jar` files
. Run `./gradlew` (Linux, macOS) or `.\gradle.bat` (Windows) at the root of the repository to build the project.
When the build completes, you should find `jing.jar` and `trang.jar` files
in the `build` subdirectory.
You can also tell the `ant` script to build the `test` target, which
will build the jars and then run some tests. On Linux, use the command
`./ant test`. On Windows, use `.\ant test`.
You can also use `./gradlew test` or `.\gradle.bat test` to run the `test` target, which
will build the jars and then run some tests.
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ tasks.named("build") {
dependsOn(jingTrang)
}

tasks.named("test") {
dependsOn(jingTrang)
dependsOn(":ant-test")
}

val antJar: TaskProvider<Task> = tasks.named("ant-jar")

// https://stackoverflow.com/questions/27993814/only-run-task-if-another-isnt-up-to-date-in-gradle
Expand Down
38 changes: 21 additions & 17 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
</xslt>
</target>

<target name="ant-test" depends="modbuild">
<ant antfile="modbuild.xml" target="test"/>
</target>

<target name="srczip" depends="modbuild">
<ant antfile="modbuild.xml" target="srczip"/>
</target>
Expand Down Expand Up @@ -271,12 +275,12 @@
</copy>
<replace file="${build.dir}/jing-bin/readme.html" token="@VERSION@" value="${version}"/>
<zip zipfile="${build.dir}/dist/jing-${version}.zip">
<zipfileset dir="${build.dir}" includes="jing.jar" prefix="jing-${version}/bin"/>
<zipfileset dir="${build.dir}" includes="jing.jar" prefix="jing-${version}/bin"/>
<zipfileset dir="lib" includes="saxon9.jar,isorelax.jar,xercesImpl.jar,xml-apis.jar"
prefix="jing-${version}/bin"/>
prefix="jing-${version}/bin"/>
<zipfileset dir="${build.dir}/mod/jing"
includes="src.zip"
prefix="jing-${version}"/>
prefix="jing-${version}"/>
<zipfileset dir="${build.dir}" includes="api/**" prefix="jing-${version}/doc"/>
<zipfileset dir="eg" includes="relaxng.rng,xslt.rng,relaxCore.rng,relaxCoreDatatypes.rng"
prefix="jing-${version}/lib"/>
Expand Down Expand Up @@ -333,7 +337,7 @@
includes="trang.jar"
prefix="trang-${version}"/>
<zipfileset dir="${build.dir}/mod/trang"
includes="src.zip"
includes="src.zip"
prefix="trang-${version}"/>
</zip>
<checksum file="${build.dir}/dist/trang-${version}.zip" algorithm="sha1"/>
Expand Down Expand Up @@ -376,7 +380,7 @@
includes="dtdinst.jar"
prefix="dtdinst-${version}"/>
<zipfileset dir="${build.dir}/mod/dtdinst"
includes="src.zip"
includes="src.zip"
prefix="dtdinst-${version}"/>
</zip>
<checksum file="${build.dir}/dist/dtdinst-${version}.zip" algorithm="sha1"/>
Expand Down Expand Up @@ -426,24 +430,24 @@
description="Upload files to Google Code. Run dist before this.">
<taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpath="${lib.dir}/ant-googlecode.jar" name="gcupload"/>
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="jing-${version}.zip"
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="jing-${version}.zip"
filename="${build.dir}/dist/jing-${version}.zip"
summary="Jing version ${version} packaged for use with JRE (includes binary, source and documentation)"
labels="Featured, Type-Archive, OpSys-All, Version-${version}"/>
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="trang-${version}.zip"
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="trang-${version}.zip"
filename="${build.dir}/dist/trang-${version}.zip"
summary="Trang version ${version} packaged for use with JRE (includes binary, source and documentation)"
labels="Featured, Type-Archive, OpSys-All, Version-${version}"/>
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="dtdinst-${version}.zip"
<gcupload username="${googlecode.username}"
password="${googlecode.password}"
projectname="jing-trang"
targetfilename="dtdinst-${version}.zip"
filename="${build.dir}/dist/dtdinst-${version}.zip"
summary="DTDinst version ${version} packaged for use with JRE (includes binary, source and documentation)"
labels="Type-Archive, OpSys-All, Version-${version}"/>
Expand Down
15 changes: 7 additions & 8 deletions build.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<xsl:output indent="yes"
encoding="utf-8"/>

<xsl:variable name="build" select="'${build.dir}'"/>
<xsl:variable name="doc" select="'${doc.dir}'"/>
<xsl:template match="/">
Expand Down Expand Up @@ -336,13 +336,12 @@
<xslt style="{$srctestdir}/{@transform}"
in="{$srctest}"
out="{$runtestdir}/{@name}test.xml">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<classpath>
<fileset dir="lib">
<filename name="saxon9.jar"/>
</fileset>
</classpath>
</factory>
<factory name="net.sf.saxon.TransformerFactoryImpl" />
<classpath>
<fileset dir="lib">
<filename name="saxon9.jar"/>
</fileset>
</classpath>
</xslt>
<!-- XXX Could validate intermediate result against a schema -->
</xsl:if>
Expand Down
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading