Author: dims Date: Mon May 28 12:55:34 2007 New Revision: 542310 URL: http://svn.apache.org/viewvc?view=rev&rev=542310 Log: Experimenting with flags for skipping generation of some of the artifacts.
"--noWSDL" skips creating a resources directory with the wsdl inside "--noBuildXML" skips the build.xml "--noMessageReceiver" skips generating the message receiver Please note that i have not added short options on purpose. Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?view=diff&rev=542310&r1=542309&r2=542310 ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Mon May 28 12:55:34 2007 @@ -208,7 +208,9 @@ private boolean serverSide = false; private boolean generateDeployementDescriptor = true; private boolean writeTestCase = false; - private boolean writeMessageReceiver = true; + private boolean skipMessageReceiver = false; + private boolean skipWriteWSDLs = false; + private boolean skipBuildXML = false; private String packageName = URLProcessor.DEFAULT_PACKAGE; // Default packClasses is true, which means the classes generated @@ -413,17 +415,33 @@ return generateDeployementDescriptor; } + + public boolean isSkipBuildXML() { + return skipBuildXML; + } + + public void setSkipBuildXML(boolean skipBuildXML) { + this.skipBuildXML = skipBuildXML; + } + public boolean isWriteTestCase() { return writeTestCase; } + public boolean isSkipWriteWSDLs() { + return skipWriteWSDLs; + } + + public void setSkipWriteWSDLs(boolean writeWriteWSDLs) { + this.skipWriteWSDLs = writeWriteWSDLs; + } - public boolean isWriteMessageReceiver() { - return writeMessageReceiver; + public boolean isSkipMessageReceiver() { + return skipMessageReceiver; } - public void setWriteMessageReceiver(boolean writeMessageReceiver) { - this.writeMessageReceiver = writeMessageReceiver; + public void setSkipMessageReceiver(boolean skipMessageReceiver) { + this.skipMessageReceiver = skipMessageReceiver; } public void setRepositoryPath(String repositoryPath) { Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?view=diff&rev=542310&r1=542309&r2=542310 ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java Mon May 28 12:55:34 2007 @@ -62,6 +62,15 @@ config.setWriteTestCase(loadOption(WSDL2JavaConstants.GENERATE_TEST_CASE_OPTION, WSDL2JavaConstants.GENERATE_TEST_CASE_OPTION_LONG, optionMap) != null); + config.setSkipWriteWSDLs(loadOption(null, + WSDL2JavaConstants.NO_WSDLS_OPTION_LONG, + optionMap) != null); + config.setSkipMessageReceiver(loadOption(null, + WSDL2JavaConstants.NO_MESSAGE_RECEIVER_OPTION_LONG, + optionMap) != null); + config.setSkipBuildXML(loadOption(null, + WSDL2JavaConstants.NO_BUILD_XML_OPTION_LONG, + optionMap) != null); boolean asyncFlagPresent = (loadOption(WSDL2JavaConstants.CODEGEN_ASYNC_ONLY_OPTION, Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=542310&r1=542309&r2=542310 ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Mon May 28 12:55:34 2007 @@ -10,7 +10,6 @@ import org.apache.axis2.description.AxisOperation; import org.apache.axis2.description.AxisService; import org.apache.axis2.description.Parameter; -import org.apache.axis2.description.PolicyInclude; import org.apache.axis2.description.WSDL20DefaultValueHolder; import org.apache.axis2.description.WSDL2Constants; import org.apache.axis2.util.CommandLineOptionConstants; @@ -53,8 +52,6 @@ import org.w3c.dom.Element; import org.w3c.dom.Text; -import com.ibm.wsdl.util.xml.DOM2Writer; - import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -481,18 +478,19 @@ copyMap(originalTypeMap, this.mapper.getAllMappedNames()); } - // write an ant build file - // Note that ant build is generated only once - // and that has to happen here only if the - // client side code is required - if (!codeGenConfiguration.isGenerateAll()) { - //our logic for the build xml is that it will - //only be written when not flattened - if (!codeGenConfiguration.isFlattenFiles()) { - writeAntBuild(); + if(!codeGenConfiguration.isSkipBuildXML()){ + // write an ant build file + // Note that ant build is generated only once + // and that has to happen here only if the + // client side code is required + if (!codeGenConfiguration.isGenerateAll()) { + //our logic for the build xml is that it will + //only be written when not flattened + if (!codeGenConfiguration.isFlattenFiles()) { + writeAntBuild(); + } } } - } catch (CodeGenerationException ce) { throw ce; } catch (Exception e) { @@ -1244,15 +1242,19 @@ writeSkeleton(); } - // write a MessageReceiver for this particular service. - writeMessageReceiver(); + if(!codeGenConfiguration.isSkipMessageReceiver()){ + // write a MessageReceiver for this particular service. + writeMessageReceiver(); + } // write the Exceptions writeExceptions(); - //for the server side codegen - //we need to serialize the WSDL's - writeWSDLFiles(); + if(!codeGenConfiguration.isSkipWriteWSDLs()){ + //for the server side codegen + //we need to serialize the WSDL's + writeWSDLFiles(); + } } // save back type map @@ -1266,10 +1268,12 @@ writeServiceXml(); } - //write the ant build - //we skip this for the flattened case - if (!codeGenConfiguration.isFlattenFiles()) { - writeAntBuild(); + if(!codeGenConfiguration.isSkipBuildXML()){ + //write the ant build + //we skip this for the flattened case + if (!codeGenConfiguration.isFlattenFiles()) { + writeAntBuild(); + } } @@ -1380,32 +1384,29 @@ * @throws Exception */ protected void writeMessageReceiver() throws Exception { + //loop through the meps and generate code for each mep + Iterator it = mepToClassMap.keySet().iterator(); + while (it.hasNext()) { + String mep = (String) it.next(); + Document classModel = createDocumentForMessageReceiver( + mep, + codeGenConfiguration.isServerSideInterface()); + debugLogDocument("Document for message receiver (mep=" + mep + + "):", classModel); + //write the class only if any methods are found + if (Boolean.TRUE.equals(infoHolder.get(mep))) { + MessageReceiverWriter writer = + new MessageReceiverWriter( + codeGenConfiguration.isFlattenFiles() ? + getOutputDirectory( + codeGenConfiguration.getOutputLocation(), + null) : + getOutputDirectory( + codeGenConfiguration.getOutputLocation(), + codeGenConfiguration.getSourceLocation()), + codeGenConfiguration.getOutputLanguage()); - if (codeGenConfiguration.isWriteMessageReceiver()) { - //loop through the meps and generate code for each mep - Iterator it = mepToClassMap.keySet().iterator(); - while (it.hasNext()) { - String mep = (String)it.next(); - Document classModel = createDocumentForMessageReceiver( - mep, - codeGenConfiguration.isServerSideInterface()); - debugLogDocument("Document for message receiver (mep=" + mep + - "):", classModel); - //write the class only if any methods are found - if (Boolean.TRUE.equals(infoHolder.get(mep))) { - MessageReceiverWriter writer = - new MessageReceiverWriter( - codeGenConfiguration.isFlattenFiles() ? - getOutputDirectory( - codeGenConfiguration.getOutputLocation(), - null) : - getOutputDirectory( - codeGenConfiguration.getOutputLocation(), - codeGenConfiguration.getSourceLocation()), - codeGenConfiguration.getOutputLanguage()); - - writeClass(classModel, writer); - } + writeClass(classModel, writer); } } } Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?view=diff&rev=542310&r1=542309&r2=542310 ============================================================================== --- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java (original) +++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java Mon May 28 12:55:34 2007 @@ -124,7 +124,14 @@ .equalsIgnoreCase(optionType) || (WSDL2JavaConstants.SUPPRESS_PREFIXES_OPTION_LONG) .equalsIgnoreCase(optionType) || - (WSDL2JavaConstants.XSDCONFIG_OPTION_LONG).equalsIgnoreCase(optionType) + (WSDL2JavaConstants.XSDCONFIG_OPTION_LONG) + .equalsIgnoreCase(optionType) || + (WSDL2JavaConstants.NO_MESSAGE_RECEIVER_OPTION_LONG) + .equalsIgnoreCase(optionType) || + (WSDL2JavaConstants.NO_WSDLS_OPTION_LONG) + .equalsIgnoreCase(optionType) || + (WSDL2JavaConstants.NO_BUILD_XML_OPTION_LONG) + .equalsIgnoreCase(optionType) ); } Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java?view=diff&rev=542310&r1=542309&r2=542310 ============================================================================== --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java (original) +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/CommandLineOptionConstants.java Mon May 28 12:55:34 2007 @@ -82,6 +82,9 @@ String WSDL_VERSION_1 = "1.1"; + String NO_MESSAGE_RECEIVER_OPTION_LONG = "noMessageReceiver"; + String NO_WSDLS_OPTION_LONG = "noWSDL"; + String NO_BUILD_XML_OPTION_LONG = "noBuildXML"; } interface Java2WSDLConstants { --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]