I'm sure some regex may surprise, but I'm just creating a custom task.
getProjet().setProperty().
:
public class PreviousMonthTask extends Task {
private String currentDate;
private String propertyName;
public void setCurrentDate(String currentDate) {
this.currentDate = currentDate;
}
public void setPropertyName(String propertyName) {
this.propertyName = propertyName;
}
@Override
public void execute() throws BuildException {
String previousMonth = ...;
getProject().setProperty(this.propertyName, previousMonth);
}
}
, :
previousmonth = org.myproject.PreviousMonthTask
(. Ant), :
<previousmonth propertyName="previous" currentDate="${current}"/>