beagle r4621 - trunk/beagle/BeagleClient/generated
- From: dbera svn gnome org
- To: svn-commits-list gnome org
- Subject: beagle r4621 - trunk/beagle/BeagleClient/generated
- Date: Thu, 20 Mar 2008 21:43:14 +0000 (GMT)
Author: dbera
Date: Thu Mar 20 21:43:14 2008
New Revision: 4621
URL: http://svn.gnome.org/viewvc/beagle?rev=4621&view=rev
Log:
Use sgen to create xml serializers for the BeagleClient classes. Decreases deserialization time to a third.
Due to the extremely clumsy way sgen works, here is how we do it:
- "ifdef false" the part of the code which call the generated serializer class
- generate a dummy assembly
- run sgen on this and ask it to keep its source files (we would really like to access System.Xml.Serialization/SerializationCodeGenerator.cs but mono does give us that)
- now build the actual Beagle.dll by including the generated source file
Oh ... and the generated source file has a bug and also it does not look like end-user-usable so we have to change it namespace to something else (otherwise, when mono internally generates serializers in runtime, the generated types will conflict).
Added:
trunk/beagle/BeagleClient/generated/
trunk/beagle/BeagleClient/generated/Makefile (contents, props changed)
Added: trunk/beagle/BeagleClient/generated/Makefile
==============================================================================
--- (empty file)
+++ trunk/beagle/BeagleClient/generated/Makefile Thu Mar 20 21:43:14 2008
@@ -0,0 +1,20 @@
+GENERATED_TARGET = $(DUMMY_TARGET:%.dll=%.XmlSerializers.dll)
+
+all:
+ @echo "Generating serializer files"
+ @rm -rf *.cs *.dll *.mdb
+ MONO_PATH=../../Util mono ../../Util/sgen.exe ../$(DUMMY_TARGET) --debug --keep --out:.
+ @test -f $(GENERATED_TARGET) \
+ || { \
+ echo "ERROR in generating serializer assembly." ; \
+ echo "Run manually \"MONO_PATH=../../Util mono ../../Util/sgen.exe ../$(DUMMY_TARGET) --debug --keep --out:. \"."; \
+ exit 1; \
+ }
+ @echo "Patching generated file to change the namespace."
+ @echo "Otherwise mono's automatically generated serializers will have conflict."
+ @for i in *.cs; do \
+ sed -e "s|Mono.GeneratedSerializers.Literal|Beagle.GeneratedSerializers.Literal|" \
+ < $$i > $$i.patched; \
+ mv $$i.patched $$i; \
+ done;
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]