A few tweaks

This commit is contained in:
Jon Skeet 2008-10-22 14:11:30 +01:00
parent 87d6a3b8f7
commit 52a035a4af
3 changed files with 29 additions and 4 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ src/ProtoGen/obj/
src/ProtoGen.Test/bin/ src/ProtoGen.Test/bin/
src/ProtoGen.Test/obj/ src/ProtoGen.Test/obj/
tmp/ tmp/
dist/
*.user *.user
*.suo *.suo
_ReSharper.* _ReSharper.*

View File

@ -20,6 +20,11 @@
value="${project::get-base-directory()}/lib/protoc.exe" value="${project::get-base-directory()}/lib/protoc.exe"
overwrite="false" /> overwrite="false" />
<!-- Output directory for copying generated binaries -->
<property name="output-dir"
value="${path::combine(project::get-base-directory(), 'dist')}"
overwrite="false" />
<!-- Base directory to find protos (core, C# options, tests) --> <!-- Base directory to find protos (core, C# options, tests) -->
<property name="protos-dir" <property name="protos-dir"
value="${path::combine(project::get-base-directory(), 'protos')}" value="${path::combine(project::get-base-directory(), 'protos')}"
@ -52,6 +57,7 @@
<include name="${src}/ProtocolBuffers.Test/bin/**" /> <include name="${src}/ProtocolBuffers.Test/bin/**" />
<include name="${src}/ProtocolBuffers.Test/obj/**" /> <include name="${src}/ProtocolBuffers.Test/obj/**" />
<include name="${tmp-dir}" /> <include name="${tmp-dir}" />
<include name="${output-dir}" />
</fileset> </fileset>
</delete> </delete>
</target> </target>
@ -103,14 +109,16 @@
</copy> </copy>
</target> </target>
<target name="build" description="Builds all C# code"> <target name="build"
description="Builds all C# code">
<msbuild project="${src}/ProtocolBuffers.sln"> <msbuild project="${src}/ProtocolBuffers.sln">
<property name="Configuration" <property name="Configuration"
value="${build-configuration}" /> value="${build-configuration}" />
</msbuild> </msbuild>
</target> </target>
<target name="test" description="Runs all unit tests"> <target name="test"
description="Runs all unit tests">
<nunit2> <nunit2>
<formatter type="Plain" /> <formatter type="Plain" />
<test assemblyname="${src}/ProtocolBuffers.Test/bin/${build-configuration}/Google.ProtocolBuffers.Test.dll" /> <test assemblyname="${src}/ProtocolBuffers.Test/bin/${build-configuration}/Google.ProtocolBuffers.Test.dll" />
@ -118,9 +126,24 @@
</nunit2> </nunit2>
</target> </target>
<target name="perf-test" description="Runs all performance tests"> <target name="perf-test"
description="Runs all performance tests">
<fail message="Performance tests not implemented yet" /> <fail message="Performance tests not implemented yet" />
</target> </target>
<target name="dist"
description="Copies compiled binaries into the output directory">
<delete dir="${output-dir}" />
<mkdir dir="${output-dir}" />
<copy todir="${output-dir}"
flatten="true">
<fileset basedir="${src}">
<include name="ProtocolBuffers/bin/${build-configuration}/Google.ProtocolBuffers.dll" />
<include name="ProtoGen/bin/${build-configuration}/ProtoGen.exe" />
</fileset>
</copy>
</target>
</project> </project>

View File

@ -37,6 +37,7 @@ namespace Google.ProtocolBuffers {
while (ancestor != null) { while (ancestor != null) {
string candidate = Path.Combine(ancestor.FullName, "testdata"); string candidate = Path.Combine(ancestor.FullName, "testdata");
if (Directory.Exists(candidate)) { if (Directory.Exists(candidate)) {
testDataDirectory = candidate;
return candidate; return candidate;
} }
ancestor = ancestor.Parent; ancestor = ancestor.Parent;