wiflish
          Loving Life! Loving Coding!
          posts - 98,comments - 98,trackbacks - 0
          一個ant中用于編譯的宏定義例子:
          ?1
          ?????<macrodef?name="compile">
          ?2?????????<attribute?name="module"/>
          ?3?????????<attribute?name="additional.src.dirs"?default=""/>
          ?4?????????<element?name="options"?optional="yes"/>
          ?5?
          ?6?????????<sequential>
          ?7?????????????<echo>Compiling?@{module}</echo>
          ?8?????????????<mkdir?dir="${build.dir}/@{module}/classes"/>
          ?9?????????????<mkdir?dir="${test.dir}/@{module}/classes"/>
          10?????????????<javac?srcdir="${src}/@{module};@{additional.src.dirs}"
          11?????????????????destdir="${build.dir}/@{module}/classes"?debug="${compile.debug}"
          12?????????????????deprecation="${compile.deprecation}"?optimize="${compile.optimize}"
          13?????????????????classpathref="@{module}.compile.classpath">
          14?????????????????<options/>
          15?????????????</javac>
          16?????????????<javac?srcdir="test/@{module}"?debug="true"
          17?????????????????destdir="${test.dir}/@{module}/classes">
          18?????????????????<classpath>
          19?????????????????????<path?refid="@{module}.test.classpath"/>
          20?????????????????????<path?location="${build.dir}/@{module}/classes"/>
          21?????????????????</classpath>
          22?????????????????<options/>
          23?????????????</javac>
          24?????????</sequential>
          25?????</macrodef>

          ?? 調用宏代碼:?
          1、<compile?module="web"?additional.src.dirs="${build.dir}/web/gen"/>
          2、<compile module="dao"/>
          posted on 2006-05-18 16:47 想飛的魚 閱讀(442) 評論(0)  編輯  收藏 所屬分類: java
          主站蜘蛛池模板: 自贡市| 平遥县| 汕头市| 色达县| 南昌县| 大悟县| 怀安县| 扬中市| 浮梁县| 通化县| 深泽县| 大竹县| 阳信县| 建平县| 同仁县| 江都市| 紫云| 新化县| 钦州市| 宜兰县| 鹤峰县| 娄烦县| 屏山县| 门源| 双鸭山市| 兰考县| 衡阳市| 沐川县| 满城县| 铁力市| 博兴县| 襄樊市| 兖州市| 江北区| 荣昌县| 廉江市| 北宁市| 罗源县| 文安县| 鄯善县| 始兴县|