[xsd-users] build issue with VisualStudio 2005

Aaron Bray ARA/SED abray at ara.com
Tue Jun 24 15:10:19 EDT 2008


I first off write a simple batch file to run xsd.exe on all my *.xsd
files (it would contain your call below)
This generates my cxx and hxx files
I then have a DLL project dedicated to building the XSD generated
classes and link to it with my other APIs.
To avoid calling this batch file each time the project gets asked to
build, I use ant
Ant has a nice feature of checking to see if any *xsd files have been
updated, run the batch, if no files have been updated since the last
build, xsd.exe is not run.
In my Schema DLL project
I create a 'Build Events'->Pre-Build Event
I add a command line: ant -s buildSchema.xml compilenative
This calls ant to call the ant buildSchema.xml with the compilenative
target

I have the following targets in my ant xml file

<target name="compileXSD">
		<uptodate property="xsd.current"
targetfile="./build/xsd_schema_built">
		      <srcfiles dir="./xsd" includes="*.xsd"/>
		</uptodate>
	</target>

And

<target name="compilenative" depends="compileXSD" unless="xsd.current">
      <delete dir="./cpp/xsd"/>
    	<exec executable="cmd.exe" dir="./cpp" failonerror="true">
    		<arg line="/c buildSchema.bat"/>
    	</exec>
	<touch file="./build/xsd_schema_built"/>
    </target>

Since compile native gets called from my vcproj ant will not run the
buildSchema.bat file unless an .xsd file is new than the touch file.

Does that help?



-----Original Message-----
From: xsd-users-bounces at codesynthesis.com
[mailto:xsd-users-bounces at codesynthesis.com] On Behalf Of Rizzuto,
Raymond
Sent: Tuesday, June 24, 2008 1:08 PM
To: xsd-users at codesynthesis.com
Subject: [xsd-users] build issue with VisualStudio 2005

Hi!

I have a Visual Studio 2005 project with a rather large schema file in
it.  Compiling the schema into C++ is the slowest part of the build
process.  When I make a code change to my application code, and rebuild,
XSD is run against the schema file, even though the schema and its build
options haven't changed.  Is there some way to prevent that?

I am building using the xsd-cxx-tree.rules for vc-8.0.  My command line
looks like this:

xsd.exe cxx-tree --output-dir  . --hxx-suffix .hxx --cxx-suffix .cxx
--ixx-suffix .ixx --fwd-suffix -fwd.hxx --generate-serialization
--generate-polymorphic --generate-ostream --generate-doxygen
--generate-default-ctor --generate-from-base-ctor
--generate-intellisense --type-naming ucc --function-naming lcc
--root-element-all

All settings were done from the Code Generation tab for the schema file,
except for --root-element-all, which was set in the Additional Options
pane of the Command Line tab.

Ray

________________________________
Ray Rizzuto
raymond.rizzuto at sig.com
Susquehanna International Group
(610)747-2336 (W)
(215)776-3780 (C)



________________________________
IMPORTANT: The information contained in this email and/or its
attachments is confidential. If you are not the intended recipient,
please notify the sender immediately by reply and immediately delete
this message and all its attachments. Any review, use, reproduction,
disclosure or dissemination of this message or any attachment by an
unintended recipient is strictly prohibited. Neither this message nor
any attachment is intended as or should be construed as an offer,
solicitation or recommendation to buy or sell any security or other
financial instrument. Neither the sender, his or her employer nor any of
their respective affiliates makes any warranties as to the completeness
or accuracy of any of the information contained herein or that this
message or any of its attachments is free of viruses.




More information about the xsd-users mailing list