Skip to content

Commit ad64f00

Browse files
committed
fix manual-compilation of dependent RESX files (see comment in .build file for details as to why this is necessary)
1 parent dd78ba8 commit ad64f00

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/Spring/Spring.Core.Tests/Spring.Core.Tests.build

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@
104104
</if>
105105
-->
106106
</if>
107+
108+
<!-- Visual Studio (and more importantly, csc.exe) is incapable of compiling RESX files for e.g., Cultures not present on the OS + CLR version;
109+
this means that for us to have resource files availabel for each of the various OS + CLR combinations possible to support the right test
110+
assertions we need to manually compile each of the resource files external to the NANT csc task itself and manually copy the assemblied into
111+
their expected locations -->
112+
<property name="resource.designator" value="sr-Cyrl-CS" />
113+
<call target="compile-resource-files" />
114+
115+
<property name="resource.designator" value="sr-Cyrl-RS" />
116+
<call target="compile-resource-files" />
117+
118+
<property name="resource.designator" value="sr-SP-Cyrl" />
119+
<call target="compile-resource-files" />
107120

108121
<copy todir="${current.bin.dir}">
109122
<fileset basedir="${project::get-base-directory()}/Data">
@@ -124,6 +137,25 @@
124137

125138
</target>
126139

140+
<target name="compile-resource-files">
141+
<if test="${framework::get-target-framework() != 'net-2.0'}">
142+
<mkdir dir="${current.bin.dir}/sr-SP-Cyrl"/>
143+
<copy file="Resources/Spring.Context.Tests.${resource.designator}.resx" todir="${current.bin.dir}/${resource.designator}"/>
144+
<resgen input="${current.bin.dir}/${resource.designator}/Spring.Context.Tests.${resource.designator}.resx" output="${current.bin.dir}/${resource.designator}/Spring.Resources.Spring.Context.Tests.${resource.designator}.resources" />
145+
<copy file="Resources/Tesla.${resource.designator}.resx" todir="${current.bin.dir}/${resource.designator}"/>
146+
<resgen input="${current.bin.dir}/${resource.designator}/Tesla.${resource.designator}.resx" output="${current.bin.dir}/${resource.designator}/Spring.Resources.Tesla.${resource.designator}.resources" />
147+
<al output="${current.bin.dir}/${resource.designator}/Spring.Core.Tests.resources.dll"
148+
target="lib"
149+
culture="${resource.designator}">
150+
<sources>
151+
<include name="${current.bin.dir}/${resource.designator}/Spring.Resources.Spring.Context.Tests.${resource.designator}.resources"/>
152+
<include name="${current.bin.dir}/${resource.designator}/Spring.Resources.Tesla.${resource.designator}.resources" />
153+
</sources>
154+
</al>
155+
</if>
156+
</target>
157+
158+
127159
<target name="test" depends="build">
128160
<!-- property name="test.assemblyname" value="${project::get-name()}" / -->
129161
<call target="common.run-tests" />

0 commit comments

Comments
 (0)