Skip to content

Commit d13d62b

Browse files
committed
As AssemblyVersionAttribute only allows numeric value for each part, commit hash is now part of AssemblyProductAttribute.
1 parent 707138b commit d13d62b

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

GitSharp.build

+33-13
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<target name="compile-core" depends="init">
3838
<property name="assembly.name" value="GitSharp.Core" />
3939
<property name="assembly.type" value="library" />
40-
40+
4141
<fileset id="project.references" basedir="${path.lib}" >
4242
<include name="ICSharpCode.SharpZipLib.dll" />
4343
<include name="Winterdom.IO.FileMap.dll" />
@@ -64,7 +64,7 @@
6464
<include name="Commands.xml" />
6565
</fileset>
6666
</copy>
67-
67+
6868
<call target="compile-dll" />
6969
</target>
7070

@@ -103,7 +103,7 @@
103103
<!-- ********************************************** -->
104104
<target name="run-tests" depends="compile-tests">
105105
<property name="path.testresults" value="${path.build}/${build.platform}-${build.config}/test-results" />
106-
106+
107107
<mkdir dir="${path.testresults}" if="${not(directory::exists(path.testresults))}"/>
108108
<echo message="path.testresults = ${path.testresults}"/>
109109

@@ -112,7 +112,7 @@
112112
<include name="${path.build.output}/*.dll" />
113113
</fileset>
114114
</copy>
115-
115+
116116
<copy todir="${path.testresults}/Resources">
117117
<fileset basedir="${path.base}/GitSharp.Tests/Resources">
118118
<include name="**" />
@@ -140,7 +140,7 @@
140140
<property name="nunit.consolerunner" value="nunit-console2" />
141141
<property name="nunit.commandline" value="${path.testresults}/GitSharp.Tests.dll -xml:${path.testresults}/GitSharp.Tests.dll-results.xml -noshadow " />
142142
</if>
143-
143+
144144
<exec
145145
program="${nunit.consolerunner}"
146146
workingdir="${path.testresults}"
@@ -178,16 +178,12 @@
178178

179179
<target name="compile-dll">
180180
<call target="copy-references"/>
181-
181+
182182
<property name="project.directory" value="${assembly.name}" />
183183
<property name="project.sources.path" value="${path.base}/${project.directory}"/>
184184

185-
<copy todir="${project.sources.path}">
186-
<fileset>
187-
<include name="${path.base}/SharedAssemblyInfo.cs" />
188-
</fileset>
189-
</copy>
190-
185+
<call target="create-assembly-info"/>
186+
191187
<fileset id="project.sources" failonempty="true">
192188
<include name="${project.sources.path}/**/*.cs" />
193189
</fileset>
@@ -208,8 +204,32 @@
208204
</nowarn>
209205
</csc>
210206

207+
<call target="cleanup-assembly-info"/>
208+
</target>
209+
210+
<target name="cleanup-assembly-info">
211211
<delete file="${project.sources.path}/SharedAssemblyInfo.cs" />
212-
212+
<delete file="${project.sources.path}/VersionAssemblyInfo.cs" />
213+
</target>
214+
215+
<target name="create-assembly-info">
216+
<copy todir="${project.sources.path}">
217+
<fileset>
218+
<include name="${path.base}/SharedAssemblyInfo.cs" />
219+
</fileset>
220+
</copy>
221+
222+
<asminfo output="${project.sources.path}/VersionAssemblyInfo.cs" language="CSharp">
223+
<imports>
224+
<import namespace="System"/>
225+
<import namespace="System.Reflection"/>
226+
<import namespace="System.Runtime.InteropServices"/>
227+
</imports>
228+
<attributes>
229+
<attribute type="AssemblyVersionAttribute" value="${version}"/>
230+
<attribute type="AssemblyProductAttribute" value="GitSharp [${version.revision}]"/>
231+
</attributes>
232+
</asminfo>
213233
</target>
214234

215235
<target name="copy-references">

SharedAssemblyInfo.cs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
using System.Runtime.CompilerServices;
33
using System.Runtime.InteropServices;
44

5-
[assembly: AssemblyProduct("GitSharp")]
6-
75
[assembly: AssemblyCompany("The Git Development Community")]
86
[assembly: AssemblyCopyright("Copyright © 2009 The GitSharp Team")]
97
[assembly: ComVisible(false)]

0 commit comments

Comments
 (0)