-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
90 lines (58 loc) · 3.15 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
This is optipng-ant-task, an Apache Ant task for optimizing PNG images.
Under the hood this task uses (and requires) OptiPNG, see:
http://optipng.sourceforge.net/
This Ant task has been tested with the following combination of software:
- J2SE 5.0 and Java SE 6 (source code uses Java 5-features)
- Ant 1.7.1
- OptiPNG 0.6.3
This software is available under the terms of a BSD-style license, see
the accompanied LICENSE file.
This task comes as a collection of Java source files that can be built with
Ant. To compile the Java classes, run all available unit tests and build the
JAR file run:
ant
Note that this already requires 'optipng' on the PATH. The result will be a
JAR file:
build/optipng-ant-task.jar
If you don't have 'optipng' installed and still want to build the JAR file,
just execute:
ant jar
This will skip the execution of the available unit tests.
Example usage of the task in an Ant build file:
<taskdef name="optipng"
classname="com.pensioenpage.jynx.optipng.OptiPNGTask"
classpath="lib/optipng-ant-task.jar" />
<optipng dir="src/htdocs" todir="build/htdocs" />
Although all parameters are optional, the task supports various:
process - flag that indicates if the input files should be processed at
all; there are 3 possible modes:
"yes" - the files must be processed by OptiPNG, if at least
one file could not be processed, then this task will
fail (alternative is "true");
"no" - the files must not be processed by OptiPNG but must
instead just be copied as-is, unchanged (alternative
is "false");
"try" - attempt to process all matching file(s), when a file
fails to be processed, then copy the original file
instead.
dir - the source directory, to read PNG image files from, defaults to
the project base directory;
todir - the destination directory, to write the generated CSS files to,
defaults to the source directory;
overwrite - when set this flag forces each existing output file to be
overwritten, even if it is newer than the respective source
file; defaults to 'no';
command - the command to execute, by default the task uses 'optipng';
timeOut - the time-out in milliseconds for executing a single command,
defaults to 60000 (meaning 60 seconds);
includes - the files in the source directory to include, defaults to all
files, although only those that end in '.png' will actually
be optimized or copied;
excludes - the files to exclude, even if they are matched by the includes;
and other parameters inherited from the MatchingTask, see:
http://ant.apache.org/manual/dirtasks.html
If you want to file a bug report or a feature request, please do so here:
http://github.com/znerd/optipng-ant-task/issues
This software has been developed by:
Ernst de Haan - [email protected]
PensioenPage B.V. - https://www.pensioenpage.com/