| <?xml version="1.0" encoding="UTF-8"?> |
| <project name="xpand" basedir="../.." default="set-version"> |
| |
| <target name="set-version" description="Modifies artifacts to set a release version"> |
| <input message="Please enter the new release version (MAJOR.MINOR.MICRO):" addproperty="newVersion" defaultvalue="1.4.0"/> |
| <property name="snapshot" value="y"/> |
| <condition property="version.mvn" value="${newVersion}-SNAPSHOT"> |
| <equals arg1="${snapshot}" arg2="y"/> |
| </condition> |
| <condition property="version.osgi" value="${newVersion}.qualifier"> |
| <equals arg1="${snapshot}" arg2="y"/> |
| </condition> |
| <condition property="version.mvn" value="${newVersion}"> |
| <equals arg1="${snapshot}" arg2="n"/> |
| </condition> |
| <condition property="version.osgi" value="${newVersion}"> |
| <equals arg1="${snapshot}" arg2="n"/> |
| </condition> |
| <echo message="VERSION MVN: ${version.mvn}"/> |
| <echo message="VERSION OSGI: ${version.osgi}"/> |
| <echo message=""/> |
| |
| <!-- MANIFEST.MF --> |
| <replaceregexp> |
| <regexp pattern="Bundle-Version: .*"/> |
| <substitution expression= "Bundle-Version: ${version.osgi}"/> |
| <fileset id="path.manifest" |
| dir="${basedir}"> |
| <include name="plugins/**/META-INF/MANIFEST.MF"/> |
| </fileset> |
| </replaceregexp> |
| <echo message=""/> |
| <property name="path.manifest" refid="path.manifest"/> |
| <echo message="Modified bundle manifests:"/> |
| <echo message="--------------------------"/> |
| <echo message="${path.manifest}"/> |
| |
| <!-- feature.xml --> |
| <replaceregexp> |
| <regexp pattern="version=".*\.qualifier""/> |
| <substitution expression= "version="${version.osgi}""/> |
| <fileset id="path.feature" |
| dir="${basedir}"> |
| <include name="features/**/feature.xml"/> |
| </fileset> |
| </replaceregexp> |
| <echo message=""/> |
| <property name="path.feature" refid="path.feature"/> |
| <echo message="Modified feature.xml:"/> |
| <echo message="--------------------------"/> |
| <echo message="${path.feature}"/> |
| |
| <!-- category.xml --> |
| <replaceregexp> |
| <regexp pattern="<feature url="(.*)_.*.jar" id="(.*)" version=".*">"/> |
| <substitution expression= "<feature url="\1_${version.osgi}.jar" id="\2" version="${version.osgi}">"/> |
| <fileset id="path.category" |
| dir="${basedir}"> |
| <include name="releng/**/category.xml"/> |
| </fileset> |
| </replaceregexp> |
| <echo message=""/> |
| <property name="path.category" refid="path.category"/> |
| <echo message="Modified category.xml:"/> |
| <echo message="--------------------------"/> |
| <echo message="${path.category}"/> |
| |
| <!-- publisher.properties --> |
| <replaceregexp file="releng/org.eclipse.xpand.releng/publisher.properties"> |
| <regexp pattern="version=.*"/> |
| <substitution expression= "version=${newVersion}"/> |
| </replaceregexp> |
| <echo message=""/> |
| <echo message="Modified: releng/org.eclipse.xpand.releng/publisher.properties"/> |
| </target> |
| |
| </project> |