Skip to content

Commit

Permalink
Switched rendering to slimerjs + firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
thvitt committed Oct 18, 2016
1 parent 6094c56 commit c6e92c0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
54 changes: 29 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,9 @@
<repositories>

<repository>
<id>dh.nexus.releases</id>
<name>Cophi Nexus Releases</name>
<url>http://dev.digital-humanities.de/nexus/content/repositories/releases</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>dh.nexus.snapshots</id>
<name>Cophi Nexus snapshots</name>
<url>http://dev.digital-humanities.de/nexus/content/repositories/snapshots</url>
<id>dh.nexus.public</id>
<name>Cophi Nexus</name>
<url>http://dev.digital-humanities.de/nexus/content/groups/public</url>
<releases>
<enabled>true</enabled>
</releases>
Expand Down Expand Up @@ -225,21 +214,35 @@
<activation><activeByDefault>true</activeByDefault></activation>
<build>
<plugins>

<plugin>
<groupId>com.github.klieber</groupId>
<artifactId>phantomjs-maven-plugin</artifactId>
<version>0.7</version>
<configuration>
<version>2.2.0-SNAPSHOT</version>
</configuration>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<goals>
<goal>install</goal>
</goals>
<id>get-slimerjs</id>
<phase>compile</phase>
<goals><goal>unpack</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>net.faustedition</groupId>
<artifactId>slimerjs</artifactId>
<version>0.10.1</version>
<type>zip</type>
</artifactItem>
<artifactItem>
<groupId>org.mozilla</groupId>
<artifactId>firefox</artifactId>
<version>45.4.0esr</version>
<classifier>linux-x86_64</classifier>
<type>tar.bz2</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</executions>
</plugin>

<plugin>
Expand All @@ -257,12 +260,13 @@
<environmentVariables>
<LANG>en_US.UTF-8</LANG>
<LC_ALL>en_US.UTF-8</LC_ALL>
<SLIMERJSLAUNCHER>${project.build.directory}/dependency/firefox/firefox</SLIMERJSLAUNCHER>
</environmentVariables>
<executable>java</executable>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>-Dphantomjs.binary=${phantomjs.binary}</argument>
<argument>-Dphantomjs.binary=${project.build.directory}/dependency/slimerjs-0.10.1/slimerjs</argument>
<argument>-Dfaust.diplo.allowedFailures=${faust.diplo.allowedFailures}</argument>
<argument>-Dfaust.diplo.server=${faust.diplo.server}</argument>
<argument>-Dfaust.diplo.debug=${faust.diplo.debug}</argument>
Expand Down
2 changes: 1 addition & 1 deletion rendersvgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var page = require('webpage').create(),
var backend = system.args[1],
input = system.args[2],
output = system.args[3],
links = system.args[4];
links = system.args[4],
linkout = system.args[5];

if (system.args.length !== 4 && system.args.length !== 6) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/faustedition/gen/DiplomaticConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ public boolean buildSVGs() {
}

try {
if (debugPhantomJS)
logger.fine(() -> String.join(" ", arguments));
logger.info(() -> String.join(" ", arguments));
final Process renderProcess = new ProcessBuilder(arguments).redirectErrorStream(true).start();
final BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(new BufferedInputStream(renderProcess.getInputStream())));
Expand Down Expand Up @@ -180,6 +179,8 @@ public static void main(final String[] args) throws IOException {
"rendersvgs.js",
serverURL);
logger.info(() -> "PhantomJS command line: " + String.join(" ", baseCmdLine) + " <input> <output> [<links> <linkoutput>]");

logger.info(() -> "Environment:\n" + Joiner.on("\n").withKeyValueSeparator("=").join(System.getenv()));

if (onlyWebServer) {
logger.info("Hit Ctrl+C to interrupt");
Expand Down

0 comments on commit c6e92c0

Please sign in to comment.