Skip to content

Commit

Permalink
Add the possibility of repackaging everything with version informatio…
Browse files Browse the repository at this point in the history
…n after the fact
  • Loading branch information
olabini committed Apr 21, 2011
1 parent 9047037 commit fd1ea47
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bin/Ioke.Lang.Parser.Functional.dll
bin/Ioke.Lang.Parser.Functional.dll.mdb bin/Ioke.Lang.Parser.Functional.dll.mdb
bin/Ioke.Math.dll bin/Ioke.Math.dll
bin/Ioke.Math.dll.mdb bin/Ioke.Math.dll.mdb
bin/Ioke.Lang.Version.dll
bin/ioke.exe bin/ioke.exe
bin/ioke.exe.mdb bin/ioke.exe.mdb
bin/ispec.exe bin/ispec.exe
Expand Down
Binary file added bin/ILRepack.exe
Binary file not shown.
19 changes: 19 additions & 0 deletions build.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,6 +33,25 @@
<exec executable="ruby" input="generate_filter_data.rb" failonerror="false" failifexecutionfails="false"/> <exec executable="ruby" input="generate_filter_data.rb" failonerror="false" failifexecutionfails="false"/>
</target> </target>


<target name="generate_version_data" depends="generate_filters" description="Generates version data">
<filter filtersfile="version_data.properties"/>
<filter token="VERSION" value="${VERSION_NAME}"/>
<filter token="VERSION_RUNTIME" value="${VERSION_NUMBER}${VERSION_ADDITION}"/>
<filter token="VERSION_STRING" value="Ioke ${VERSION_NAME} ikj ${VERSION_NUMBER}${VERSION_ADDITION}"/>

<copy todir="${classes.dir}" filtering="true" overwrite="true">
<fileset dir="${src.dir}" includes="**/*.properties"/>
</copy>
</target>

<target name="add_new_version_file" depends="generate_version_data" description="Adds a new version property file to an existing jar-file">
<jar destfile="${lib.dir}/ioke.jar" update="true">
<fileset dir="${classes.dir}">
<include name="**/*.properties"/>
</fileset>
</jar>
</target>

<target name="gen-pom" description="Creates new pom.xml files based on the current version configuration. This should be run before doing any Maven stuff"> <target name="gen-pom" description="Creates new pom.xml files based on the current version configuration. This should be run before doing any Maven stuff">
<filter token="VERSION_NAME" value="${VERSION_NAME}"/> <filter token="VERSION_NAME" value="${VERSION_NAME}"/>
<filter token="VERSION_NUMBER" value="${VERSION_NUMBER}"/> <filter token="VERSION_NUMBER" value="${VERSION_NUMBER}"/>
Expand Down
44 changes: 34 additions & 10 deletions ioke-ikc.build
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,19 +51,21 @@
</exec> </exec>
</target> </target>


<target name="compile" depends="generate_filters" description="Compile the source files for the project."> <target name="generate_version_data" depends="generate_filters" description="Generates version data">
<csc target="library" output="${bin.dir}/Ioke.Math.dll" debug="true">
<sources>
<include name="${src.dir}/Ioke.Math/**/*.cs" />
</sources>
</csc>

<echo file="${build.filtered.dir}/Ioke.Lang.version.properties">ioke.build.version=${VERSION_NAME} <echo file="${build.filtered.dir}/Ioke.Lang.version.properties">ioke.build.version=${VERSION_NAME}
ioke.build.runtimeVersion=${VERSION_NUMBER}${VERSION_ADDITION} ioke.build.runtimeVersion=${VERSION_NUMBER}${VERSION_ADDITION}
ioke.build.versionString=Ioke ${VERSION_NAME} ikc ${VERSION_NUMBER}${VERSION_ADDITION} ioke.build.versionString=Ioke ${VERSION_NAME} ikc ${VERSION_NUMBER}${VERSION_ADDITION}
ioke.build.date=${version::extract-property('DATE', 'version_data.properties')} ioke.build.date=${version::extract-property('DATE', 'version_data.properties')}
ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties')} ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties')}
</echo> </echo>
</target>

<target name="compile" depends="generate_version_data" description="Compile the source files for the project.">
<csc target="library" output="${bin.dir}/Ioke.Math.dll" debug="true">
<sources>
<include name="${src.dir}/Ioke.Math/**/*.cs" />
</sources>
</csc>


<csc target="library" output="${bin.dir}/Ioke.Lang.dll" debug="true"> <csc target="library" output="${bin.dir}/Ioke.Lang.dll" debug="true">
<sources> <sources>
Expand All @@ -74,8 +76,8 @@ ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties
<exclude name="${src.dir}/Ioke.Lang/DokgenMain.cs"/> <exclude name="${src.dir}/Ioke.Lang/DokgenMain.cs"/>
</sources> </sources>
<references basedir="${bin.dir}"> <references basedir="${bin.dir}">
<include name="*.dll" /> <include name="Ioke.Math.dll" />
<exclude name="Ioke.Lang.dll" /> <include name="NRegex.dll" />
</references> </references>
<resources basedir="${src.raw.dir}" dynamicprefix="true"> <resources basedir="${src.raw.dir}" dynamicprefix="true">
<include name="builtin/**/*.ik" /> <include name="builtin/**/*.ik" />
Expand Down Expand Up @@ -116,6 +118,22 @@ ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties
</csc> </csc>
</target> </target>


<target name="compile-version" depends="generate_version_data" description="Compiles a version DLL">
<al output="${bin.dir}/Ioke.Lang.Version.dll" target="lib">
<sources basedir="${build.filtered.dir}" defaultexcludes="true">
<include name="*.properties" />
</sources>
</al>
</target>

<target name="add-new-version-file" depends="compile-version" description="Adds a version DLL to the original DLL">
<move file="${bin.dir}/Ioke.Lang.dll" tofile="${bin.dir}/Ioke.Lang.Org.dll"/>
<exec managed="true" program="bin/ILRepack.exe">
<arg line="/out:${bin.dir}/Ioke.Lang.dll ${bin.dir}/Ioke.Lang.Org.dll ${bin.dir}/Ioke.Lang.Version.dll"/>
</exec>
<delete file="${bin.dir}/Ioke.Lang.Org.dll"/>
</target>

<target name="test" depends="compile" description="Runs all ISpec tests"> <target name="test" depends="compile" description="Runs all ISpec tests">
<exec managed="true" program="bin/ispec.exe"> <exec managed="true" program="bin/ispec.exe">
<arg line="test -fs"/> <arg line="test -fs"/>
Expand All @@ -124,7 +142,7 @@ ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties


<target name="ci-test" description="Runs all ISpec tests"> <target name="ci-test" description="Runs all ISpec tests">
<exec managed="true" program="bin/ispec.exe"> <exec managed="true" program="bin/ispec.exe">
<arg line="test -fx to: ${test.results.dir}"/> <arg line="test -fx to: ${test.results.dir}"/>
</exec> </exec>
</target> </target>


Expand All @@ -138,6 +156,9 @@ ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties
<include name="bin/*.exe"/> <include name="bin/*.exe"/>
<include name="bin/ispec"/> <include name="bin/ispec"/>
<include name="bin/dokgen"/> <include name="bin/dokgen"/>
<exclude name="bin/Ioke.Lang.Org.dll"/>
<exclude name="bin/Ioke.Lang.Version.dll"/>
<exclude name="bin/ILRepack.exe"/>
</fileset> </fileset>


<fileset basedir="." prefix="ioke"> <fileset basedir="." prefix="ioke">
Expand All @@ -158,6 +179,9 @@ ioke.build.commit=${version::extract-property('COMMIT', 'version_data.properties
<include name="bin/*.exe"/> <include name="bin/*.exe"/>
<include name="bin/ispec"/> <include name="bin/ispec"/>
<include name="bin/dokgen"/> <include name="bin/dokgen"/>
<exclude name="bin/Ioke.Lang.Org.dll"/>
<exclude name="bin/Ioke.Lang.Version.dll"/>
<exclude name="bin/ILRepack.exe"/>
</fileset> </fileset>


<fileset basedir="." prefix="ioke"> <fileset basedir="." prefix="ioke">
Expand Down

0 comments on commit fd1ea47

Please sign in to comment.