Hi Martin, Martin S. Weber wrote: > Hey people, > > so I've found that castor (wrongly) creates Java Enums of all uppercase > symbols for an xsd:enumeration xsd:restriction like the following: > > <xsd:simpleType> > <xsd:restriction base="xsd:token"> > <xsd:enumeration value="m"> <!-- prefix 'milli' --> > <xsd:enumeration value="M"> <!-- prefix 'mega' --> > </xsd:restriction> > </xsd:simpleType> > > The generated enum symbols for that will be 'M' and, er, yes, 'M'. So I > found that code, fixed it, and then wanted to compile castor. Is there really a need to fix this ? Actually, with java 5.0 you might have a valid point there. But I am not 100% convinced ....
> Heh, dumb > me. I'm getting more errors than my time allows to report, so instead > I'm asking you: > > Where is the FieldMappingType, ClassMapping etc. etc. coming from? I > assume that is coming from some java generated code that you generate > from some schema. Yes. > But how to bootstrap that? Why isn't that bootstrap > procedure in the build.xml? How do YOU compile castor just from the > released sources? Whilst the answer is simple, it might carry some potential to frustrate you. Anyhow, here's the answer: don't use Ant, use Maven. With Maven, a simple > mvn clean install does the job. A few weeks ago, we decided to drop hundreds of so-called generates classes from our SVN repository, as it was getting painful to change those again and again. In other words, to minimize our future efforts (and to make our build more maintainable), we included source code generation from XML schemas with our Maven build. Until then, once could use Ant and Maven interchangebly. But with that feature being introduced, this is not the case anymore. We had some discussions ourselves (committers), but for the majority of us it is more important to have cleaner and more maintainable code than sticking with a build tool. > I admit I'm not a java expert, but I would assume that given the > build.xml, and having ant available as well as a recent JDK would be > enough to compile castor.# Yes, it is. As long as you get Maven 2.0.9 as well. > To give you a scent of what I'm talking about, running the distributed > build.bat gives me ... > > [javac] symbol : class FieldMapping > [javac] location: class org.exolab.castor.xml.XMLMappingLoader > [javac] protected FieldDescriptorImpl createFieldDesc( Cla > [javac] > [javac] symbol : class FieldMapping > [javac] location: class org.exolab.castor.xml.XMLMappingLoader > [javac] protected TypeInfo getTypeInfo( Class fieldType, C > [javac] > [javac] symbol : class ClassMapping > [javac] location: class org.exolab.castor.tools.MappingTool > [javac] ClassMapping classMap; > [javac] ^ > [javac] symbol : class FieldMapping > [javac] location: class org.exolab.castor.tools.MappingTool > [javac] FieldMapping fieldMap; > [javac] ^ > [javac] symbol : class ClassMapping > [javac] location: class org.exolab.castor.tools.MappingTool > [javac] classMap = new ClassMapping(); > [javac] ^ > [javac] symbol : class MapTo > [javac] location: class org.exolab.castor.tools.MappingTool > [javac] MapTo mapTo = new MapTo(); > [javac] ^ > [javac] symbol : class MapTo > [javac] location: class org.exolab.castor.tools.MappingTool > [javac] MapTo mapTo = new MapTo(); > [javac] ^ > > (cut some at the x axis as well as removed my path references. Files > it's talking abou tis XMLMappingLoader.java and MappingTool.java). > > So I guess my question really boils down to: Why is your build.xml > incomplete? You have to switch to using Maven. Ant will not work anymore. And yes, that should finally be reflected in the build documentation as well. Feel free to open a Jira issue to remind us about this .... ;-). > And what do I have to do which is not noted in the build.xml? > > Regards, > > -Martin Weber > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

