Created
May 18, 2011 18:19
-
-
Save rponte/979167 to your computer and use it in GitHub Desktop.
ant macrodef sample
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
<!-- Create migrate task --> | |
<macrodef name="migrate"> | |
<attribute name="command" /> | |
<attribute name="environment" /> | |
<element name="extraarguments" optional="true" /> | |
<sequential> | |
<echo>** Executing "migrate @{command}" on "@{environment}" environment **</echo> | |
<java classname="org.apache.ibatis.migration.Migrator" | |
failonerror="true" fork="true" classpathref="classpath"> | |
<sysproperty key="file.encoding" value="UTF-8"/> | |
<arg value="@{command}" /> | |
<arg value="--env=@{environment}" /> | |
<extraarguments /> | |
</java> | |
</sequential> | |
</macrodef> | |
<!-- Simula o comando: --> | |
<!-- $ migrate new <description> --> | |
<target name="migrate.new"> | |
<input addproperty="description" message="Descricao da nova migration:"/> | |
<migrate command="new" environment="${environment}"> | |
<extraarguments> | |
<arg value="${description}" /> | |
</extraarguments> | |
</migrate> | |
</target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment