Browse Source

Merge branch 'master' into master

Jhonny Mertz 6 years ago
parent
commit
9a49194635

+ 0 - 4
.travis.yml

@@ -6,10 +6,6 @@ cache:
   directories:
   - "$HOME/.m2"
 after_success:
-- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in $GPG_DIR/pubring.gpg.enc
-  -out $GPG_DIR/pubring.gpg -d
-- openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in $GPG_DIR/secring.gpg.enc
-  -out $GPG_DIR/secring.gpg -d
 - "$GPG_DIR/publish.sh"
 env:
   global:

+ 17 - 11
README.md

@@ -12,25 +12,25 @@ Make sure you have Java Wrapper dependency added to your project.
 
 If you are using Gradle/Maven, see example below:
 
-##### Gradle
+#### Gradle
 In your `build.gradle`:
 ```groovy
-	dependencies {
-		compile 'com.github.jhonnymertz:java-wkhtmltopdf-wrapper:1.1.8-RELEASE'
-	}
+dependencies {
+    compile 'com.github.jhonnymertz:java-wkhtmltopdf-wrapper:1.1.8-RELEASE'
+}
 ```
 
-##### Maven
+#### Maven
 In your `pom.xml`:
 ```xml
-	<dependency>
+<dependency>
     <groupId>com.github.jhonnymertz</groupId>
     <artifactId>java-wkhtmltopdf-wrapper</artifactId>
     <version>1.1.8-RELEASE</version>
-  </dependency>
+</dependency>
 ```
 
-Usage
+Usage and Examples
 ------------
 ```
 Pdf pdf = new Pdf();
@@ -53,8 +53,8 @@ pdf.addTocParam(new Param("--xsl-style-sheet", "my_toc.xsl"));
 pdf.saveAs("output.pdf");
 ```
 
-Xvfb Support
-------------
+### Xvfb Support
+
 ```
 XvfbConfig xc = new XvfbConfig();
 xc.addParams(new Param("--auto-servernum"), new Param("--server-num=1"));
@@ -68,7 +68,7 @@ pdf.addPageFromUrl("http://www.google.com");
 pdf.saveAs("output.pdf");
 ```
 
-wkhtmltopdf exit codes
+### wkhtmltopdf exit codes
 ------------
 wkhtmltopdf may return non-zero exit codes to denote warnings, you can now set the Pdf 
 object to allow this:
@@ -84,7 +84,13 @@ pdf.setSuccessValues(Arrays.asList(0, 1));
 pdf.saveAs("output.pdf");
 ```
 
+This is not an official Wkhtmltopdf product
+------------
+This library is not an official Wkhtmltopdf product. Support is available on a best-effort basis via github issue tracking. Pull requests are welcomed.
 
+Bugs
+------------
+- Tests are incomplete
 
 License
 ------------

+ 7 - 3
deploy/publish.sh

@@ -1,6 +1,10 @@
 #!/bin/bash
 
-if [[ ($TRAVIS_PULL_REQUEST == "false") && ($TRAVIS_BRANCH == "master") ]]; then
-    mvn deploy --settings $GPG_DIR/settings.xml -DperformRelease=true -DskipTests=true
-    exit $?
+if [ ! -z "$TRAVIS_TAG" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
+  openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in $GPG_DIR/pubring.gpg.enc -out $GPG_DIR/pubring.gpg -d
+  openssl aes-256-cbc -pass pass:$ENCRYPTION_PASSWORD -in $GPG_DIR/secring.gpg.enc -out $GPG_DIR/secring.gpg -d
+  mvn deploy --settings $GPG_DIR/settings.xml -DperformRelease=true -DskipTests=true
+  exit $?
+else
+  echo "This will not deploy because its not a release!"
 fi

+ 1 - 1
src/main/java/com/github/jhonnymertz/wkhtmltopdf/wrapper/configurations/WrapperConfig.java

@@ -67,7 +67,7 @@ public class WrapperConfig {
         try {
             String osname = System.getProperty("os.name").toLowerCase();
 
-            String cmd = osname.contains("windows") ? "where wkhtmltopdf" : "which wkhtmltopdf";
+            String cmd = osname.contains("windows") ? "where.exe wkhtmltopdf" : "which wkhtmltopdf";
 
             Process p = Runtime.getRuntime().exec(cmd);
             p.waitFor();