ant extract distversion from project_params

- don't hardcode distversion anymore
  - extract it from project_version= line of project_params
This commit is contained in:
philippe lhardy
2022-04-17 11:00:56 +02:00
parent 5a6fc2b879
commit 17020ac822

View File

@@ -12,7 +12,19 @@
<property name="dist" location="dist"/> <property name="dist" location="dist"/>
<!-- Fill me please / todo --> <!-- Fill me please / todo -->
<property name="artgraphicslib" value="artgaphics-0.2.0"/> <property name="artgraphicslib" value="artgaphics-0.2.0"/>
<property name="distversion" value="1.1"/> <target name="gather_project_params">
<!-- original source parameter is in project_params project_version -->
<loadfile property="distversion" srcfile="${basedir}/project_params">
<filterchain>
<tokenfilter>
<containsregex
pattern="project_version=([0-9.]+)$"
replace="\1" />
</tokenfilter>
</filterchain>
</loadfile>
<echo message="distversion : ${distversion}" />
</target>
<target name="init"> <target name="init">
<!-- Create the time stamp --> <!-- Create the time stamp -->
@@ -30,7 +42,7 @@
</javac> </javac>
</target> </target>
<target name="dist" depends="compile" <target name="dist" depends="gather_project_params,compile"
description="generate the distribution" > description="generate the distribution" >
<!-- Create the distribution directory --> <!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/> <mkdir dir="${dist}/lib"/>