Created
August 5, 2015 12:41
-
-
Save simonharrer/fb0656957b0e3a12a9ae to your computer and use it in GitHub Desktop.
How to convert a SVG to a PNG in a gradle build script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurations { | |
rasterizer | |
} | |
dependencies { | |
rasterizer 'org.apache.xmlgraphics:batik-rasterizer:1.7' | |
rasterizer 'org.apache.xmlgraphics:batik-codec:1.7' | |
} | |
task svg2png(type: org.gradle.api.tasks.JavaExec) { | |
classpath configurations.rasterizer | |
main "org.apache.batik.apps.rasterizer.Main" | |
// -scriptSecurityOff required as the security manager of batik would interfere with the security manager of gradle | |
args "-scriptSecurityOff", "-d", "src/main/resources/images/splash.png", "-m", "image/png", "src/graphics/splash/splash-release.svg" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment