-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Sterl
committed
Feb 15, 2016
1 parent
301f2e6
commit d0192c1
Showing
13 changed files
with
152 additions
and
58 deletions.
There are no files selected for viewing
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
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
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
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
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
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
4 changes: 2 additions & 2 deletions
4
...g/sterl/encoding/config/OutputConfig.java → ...rg/sterl/svg2png/config/OutputConfig.java
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
2 changes: 1 addition & 1 deletion
2
...ava/org/sterl/encoding/util/FileUtil.java → ...java/org/sterl/svg2png/util/FileUtil.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.sterl.encoding.util; | ||
package org.sterl.svg2png.util; | ||
|
||
import java.io.File; | ||
import java.net.URI; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"files": [ | ||
{ | ||
"name": "ic_launcher.png", | ||
"directory": "mipmap-xxxhdpi", | ||
"height": 192, | ||
"width": 192 | ||
},{ | ||
"name": "ic_launcher.png", | ||
"directory": "mipmap-xxhdpi", | ||
"height": 144, | ||
"width": 144 | ||
},{ | ||
"name": "ic_launcher.png", | ||
"directory": "mipmap-xhdpi", | ||
"height": 96, | ||
"width": 96 | ||
},{ | ||
"name": "ic_launcher.png", | ||
"directory": "mipmap-hdpi", | ||
"height": 72, | ||
"width": 72 | ||
},{ | ||
"name": "ic_launcher.png", | ||
"directory": "mipmap-mdpi", | ||
"height": 48, | ||
"width": 48 | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.sterl.svg2png; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import java.io.File; | ||
|
||
import org.apache.commons.cli.CommandLine; | ||
import org.apache.commons.cli.DefaultParser; | ||
import org.apache.commons.cli.Options; | ||
import org.junit.Test; | ||
import org.sterl.svg2png.config.FileOutput; | ||
import org.sterl.svg2png.config.OutputConfig; | ||
|
||
public class CliOptionsTest { | ||
|
||
@Test | ||
public void test() throws Exception { | ||
Options options = new Options(); | ||
CliOptions.addOptions(options); | ||
|
||
CommandLine cmd = new DefaultParser().parse(options, new String[]{"--android", "-f", "ic_launcher.svg"}); | ||
OutputConfig cfg = CliOptions.parse(cmd); | ||
|
||
assertNull(cfg.getInputDirectory()); | ||
assertNull(cfg.getOutputDirectory()); | ||
assertNull(cfg.getOutputName()); | ||
assertEquals(5, cfg.getFiles().size()); | ||
assertEquals("ic_launcher.svg", cfg.getInputFile()); | ||
|
||
for (FileOutput fo : cfg.getFiles()) { | ||
final String outPath = fo.toOutputFile(new File("ic_launcher.svg"), null, null).getAbsolutePath(); | ||
System.out.println(outPath); | ||
assertTrue(!outPath.startsWith("null/")); | ||
assertTrue(outPath.endsWith("/ic_launcher.png")); | ||
} | ||
} | ||
} |
Oops, something went wrong.