Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Feb 3, 2022
2 parents e0e9e1a + fbe4d20 commit 4aacfbd
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 14 deletions.
18 changes: 16 additions & 2 deletions README-CHANGES.xml
Expand Up @@ -24,14 +24,28 @@
<c:change date="2020-12-19T00:00:00+00:00" summary="Slightly improve the CSS for table elements"/>
</c:changes>
</c:release>
<c:release date="2021-06-27T16:34:56+00:00" is-open="true" ticket-system="com.github.io7m.xstructural" version="1.3.0">
<c:release date="2022-02-03T00:00:00+00:00" is-open="false" ticket-system="com.github.io7m.xstructural" version="1.3.0">
<c:changes>
<c:change date="2021-06-27T00:00:00+00:00" summary="Add EPUB support">
<c:tickets>
<c:ticket id="13"/>
</c:tickets>
</c:change>
<c:change date="2021-06-27T16:34:56+00:00" summary="Fix a schema bug that rejected valid footnotes in documents"/>
<c:change date="2021-06-27T00:00:00+00:00" summary="Fix a schema bug that rejected valid footnotes in documents"/>
</c:changes>
</c:release>
<c:release date="2022-02-03T22:22:51+00:00" is-open="false" ticket-system="com.github.io7m.xstructural" version="1.4.0">
<c:changes>
<c:change date="2022-02-03T00:00:00+00:00" summary="Fix a bug where documents with comments would be rejected">
<c:tickets>
<c:ticket id="18"/>
</c:tickets>
</c:change>
<c:change date="2022-02-03T00:00:00+00:00" summary="Ensure existing files are replaced when producing EPUBs">
<c:tickets>
<c:ticket id="20"/>
</c:tickets>
</c:change>
</c:changes>
</c:release>
</c:releases>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.api/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.xstructural</artifactId>
<groupId>com.io7m.xstructural</groupId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.cmdline/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.xstructural</artifactId>
<groupId>com.io7m.xstructural</groupId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.cmdline</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.documentation/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.xstructural</artifactId>
<groupId>com.io7m.xstructural</groupId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.documentation</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.tests/pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<artifactId>com.io7m.xstructural</artifactId>
<groupId>com.io7m.xstructural</groupId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.tests</artifactId>
Expand Down
Expand Up @@ -991,4 +991,75 @@ public void testTransformXHTMLEPUBOKExample0_80()
"EPUB file exists"
);
}

@Test
public void testTransformXHTMLEPUBOKExampleTwice_80()
throws Exception
{
XSTestDirectories.resourceOf(
XSCommandLineTest.class,
this.sourceDirectory,
"poppy.jpg"
);
XSTestDirectories.resourceOf(
XSCommandLineTest.class,
this.sourceDirectory,
"missing.jpg"
);
XSTestDirectories.resourceOf(
XSCommandLineTest.class,
this.sourceDirectory,
"woods.jpg"
);

{
final var main = new Main(new String[]{
"epub",
"--sourceFile",
XSTestDirectories.resourceOf(
XSCommandLineTest.class,
this.sourceDirectory,
"example0_80.xml")
.toString(),
"--outputDirectory",
this.outputDirectory.toString(),
"--traceFile",
this.directory.resolve("trace.xml").toString(),
"--messagesFile",
this.directory.resolve("messages.log").toString(),
"--verbose",
"trace"
});

final var capture =
XSOutputCaptured.capture(main::run);

Assertions.assertEquals(0, main.exitCode());
}

{
final var main = new Main(new String[]{
"epub",
"--sourceFile",
XSTestDirectories.resourceOf(
XSCommandLineTest.class,
this.sourceDirectory,
"example0_80.xml")
.toString(),
"--outputDirectory",
this.outputDirectory.toString(),
"--traceFile",
this.directory.resolve("trace.xml").toString(),
"--messagesFile",
this.directory.resolve("messages.log").toString(),
"--verbose",
"trace"
});

final var capture =
XSOutputCaptured.capture(main::run);

Assertions.assertEquals(0, main.exitCode());
}
}
}
Expand Up @@ -24,6 +24,7 @@
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.UUID;

public final class XSTestDirectories
Expand Down Expand Up @@ -70,7 +71,7 @@ public static Path resourceOf(
LOGGER.debug("copy {} {}", name, target);

try (var stream = url.openStream()) {
Files.copy(stream, target);
Files.copy(stream, target, StandardCopyOption.REPLACE_EXISTING);
}
return target;
}
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:7:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:8:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:7:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:8:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:7:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:8:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:7:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8" ?>

<!-- Comments! -->

<Document xmlns="urn:com.io7m.structural:8:0"
xmlns:dc="http://purl.org/dc/elements/1.1/"
tableOfContentsDepth="3"
tableOfContents="true">

<!-- Comments! -->

<Metadata>
<dc:contributor>A Contributor</dc:contributor>
<dc:creator>A Creator</dc:creator>
Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.vanilla/pom.xml
Expand Up @@ -9,7 +9,7 @@
<parent>
<artifactId>com.io7m.xstructural</artifactId>
<groupId>com.io7m.xstructural</groupId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.vanilla</artifactId>
Expand Down
Expand Up @@ -44,6 +44,10 @@
import java.util.zip.ZipEntry;

import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;

/**
* An EPUB creator.
Expand Down Expand Up @@ -466,7 +470,7 @@ private void copyOEBPS()
this.oebpsDirectory.resolve(file.getFileName().toString());

LOG.info("copy {} {}", file, outputFile);
Files.copy(file, outputFile);
Files.copy(file, outputFile, REPLACE_EXISTING);
}
}
}
Expand All @@ -488,7 +492,11 @@ private void writeContainerFile()
throws IOException
{
try (var stream = resource("container.xml")) {
Files.copy(stream, this.metaDirectory.resolve("container.xml"));
Files.copy(
stream,
this.metaDirectory.resolve("container.xml"),
REPLACE_EXISTING
);
}
}

Expand All @@ -498,7 +506,10 @@ private void writeMimetypeFile()
Files.writeString(
this.epubDirectory.resolve("mimetype"),
"application/epub+zip",
UTF_8
UTF_8,
WRITE,
CREATE,
TRUNCATE_EXISTING
);
}

Expand Down
2 changes: 1 addition & 1 deletion com.io7m.xstructural.xml/pom.xml
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.io7m.xstructural</groupId>
<artifactId>com.io7m.xstructural</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
</parent>

<artifactId>com.io7m.xstructural.xml</artifactId>
Expand Down
Expand Up @@ -37,6 +37,8 @@
select="concat('Unexpectedly reached catch-all template: ', namespace-uri(.), ':', node-name(.))"/>
</xsl:template>

<xsl:template match="comment()"/>

<!-- -->
<!-- Top-level web multi templates. -->
<!-- -->
Expand Down
Expand Up @@ -36,6 +36,8 @@
select="concat('Unexpectedly reached catch-all template: ', namespace-uri(.), ':', node-name(.))"/>
</xsl:template>

<xsl:template match="comment()"/>

<!-- -->
<!-- Top-level web single templates. -->
<!-- -->
Expand Down
Expand Up @@ -37,6 +37,8 @@
select="concat('Unexpectedly reached catch-all template: ', namespace-uri(.), ':', node-name(.))"/>
</xsl:template>

<xsl:template match="comment()"/>

<!-- -->
<!-- Top-level web multi templates. -->
<!-- -->
Expand Down
Expand Up @@ -36,6 +36,8 @@
select="concat('Unexpectedly reached catch-all template: ', namespace-uri(.), ':', node-name(.))"/>
</xsl:template>

<xsl:template match="comment()"/>

<!-- -->
<!-- Top-level web single templates. -->
<!-- -->
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -11,7 +11,7 @@

<groupId>com.io7m.xstructural</groupId>
<artifactId>com.io7m.xstructural</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<packaging>pom</packaging>

<description>Structural document format</description>
Expand All @@ -29,7 +29,7 @@

<properties>
<com.io7m.immutables.version>2.8.8</com.io7m.immutables.version>
<io7m.api.previousVersion>1.2.0</io7m.api.previousVersion>
<io7m.api.previousVersion>1.3.0</io7m.api.previousVersion>
<junit.version>5.7.0</junit.version>
</properties>

Expand Down

0 comments on commit 4aacfbd

Please sign in to comment.