| 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|---|
| 2 |
<project name="OwnTaskExample" default="compile" basedir="."> |
|---|
| 3 |
|
|---|
| 4 |
<taskdef classname="anttasks.D" name="D" /> |
|---|
| 5 |
<taskdef classname="anttasks.DModuleBuildNumber" name="DBldNum" /> |
|---|
| 6 |
<taskdef classname="anttasks.DModuleBuildNumber" name="foreach" /> |
|---|
| 7 |
|
|---|
| 8 |
<property name="compiler.dir" value="/opt/dmd" /> |
|---|
| 9 |
<property name="compiler.type" value="dmd-linux" /> |
|---|
| 10 |
<property name="tango.dir" value="${user.home}/tango" /> |
|---|
| 11 |
<property name="tango.examples.dir" value="${tango.dir}/example" /> |
|---|
| 12 |
<property name="tango.examples.hello" value="${tango.examples.dir}/hello" /> |
|---|
| 13 |
|
|---|
| 14 |
<target name="resgen" > |
|---|
| 15 |
<!-- convert any file into a d module as a constant array |
|---|
| 16 |
and read the data directly |
|---|
| 17 |
This data can be any icon or other resource --> |
|---|
| 18 |
<BinToD |
|---|
| 19 |
file="t.d" |
|---|
| 20 |
fqn="t" |
|---|
| 21 |
> |
|---|
| 22 |
<resource file="src/anttasks/BinToD.java" id="bintod" variable="bintod" version="all" /> |
|---|
| 23 |
</BinToD> |
|---|
| 24 |
</target> |
|---|
| 25 |
|
|---|
| 26 |
<target name="build-number" > |
|---|
| 27 |
<DBldNum file="${tango.examples.hello}_bn.d" fqn="hello_bn" /> |
|---|
| 28 |
</target> |
|---|
| 29 |
|
|---|
| 30 |
<macrodef name="compile" > |
|---|
| 31 |
<attribute name="bldtrg" /> |
|---|
| 32 |
<sequential> |
|---|
| 33 |
<D |
|---|
| 34 |
type = "${compiler.type}" |
|---|
| 35 |
mode = "executable" |
|---|
| 36 |
compilerdir = "${compiler.dir}" |
|---|
| 37 |
destfile = "${tango.examples.dir}/@{bldtrg}" |
|---|
| 38 |
cleanup = "true" |
|---|
| 39 |
> |
|---|
| 40 |
<version value="Posix" /> |
|---|
| 41 |
|
|---|
| 42 |
<!-- The main modules --> |
|---|
| 43 |
<mainmodules> |
|---|
| 44 |
<fileset file="${tango.examples.dir}/@{bldtrg}.d"/> |
|---|
| 45 |
</mainmodules> |
|---|
| 46 |
|
|---|
| 47 |
<!-- Modules for compilation and linking, if imported --> |
|---|
| 48 |
<includemodules> |
|---|
| 49 |
<dirset file="${tango.examples.dir}" /> |
|---|
| 50 |
<dirset file="${tango.dir}" /> |
|---|
| 51 |
</includemodules> |
|---|
| 52 |
|
|---|
| 53 |
<!-- Imported modules, only for declarations, no compile/link (libs) --> |
|---|
| 54 |
<includepath> |
|---|
| 55 |
</includepath> |
|---|
| 56 |
</D> |
|---|
| 57 |
</sequential> |
|---|
| 58 |
</macrodef> |
|---|
| 59 |
|
|---|
| 60 |
<target name="compile" > |
|---|
| 61 |
<compile bldtrg="argparser" /> |
|---|
| 62 |
<compile bldtrg="chainsaw" /> |
|---|
| 63 |
<compile bldtrg="composite" /> |
|---|
| 64 |
<compile bldtrg="filebubbler" /> |
|---|
| 65 |
<compile bldtrg="filecat" /> |
|---|
| 66 |
<compile bldtrg="filecopy" /> |
|---|
| 67 |
<compile bldtrg="filescan" /> |
|---|
| 68 |
<compile bldtrg="formatalign" /> |
|---|
| 69 |
<compile bldtrg="formatindex" /> |
|---|
| 70 |
<compile bldtrg="hello" /> |
|---|
| 71 |
<compile bldtrg="homepage" /> |
|---|
| 72 |
<compile bldtrg="httpget" /> |
|---|
| 73 |
<compile bldtrg="httpserver" /> |
|---|
| 74 |
<compile bldtrg="lineio" /> |
|---|
| 75 |
<compile bldtrg="localetime" /> |
|---|
| 76 |
<!--compile bldtrg="localtime" /--> |
|---|
| 77 |
<compile bldtrg="logging" /> |
|---|
| 78 |
<compile bldtrg="mmap" /> |
|---|
| 79 |
<compile bldtrg="randomio" /> |
|---|
| 80 |
<compile bldtrg="servlets" /> |
|---|
| 81 |
<compile bldtrg="servletserver" /> |
|---|
| 82 |
<compile bldtrg="sockethello" /> |
|---|
| 83 |
<compile bldtrg="socketserver" /> |
|---|
| 84 |
<compile bldtrg="stdout" /> |
|---|
| 85 |
<compile bldtrg="token" /> |
|---|
| 86 |
<compile bldtrg="unifile" /> |
|---|
| 87 |
</target> |
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
</project> |
|---|