Skip to content

Commit

Permalink
HPCC-18038 Remove the version option from the publish and java command
Browse files Browse the repository at this point in the history
- Remove the --version option from the usage message
- Don't pass in any version info when loading dependencies,
  pass in 0 instead.
- Don't validate version command option
- Replace --version with --build for printing out build info
- Remove the --version option from the batch file for ECL IDE
- Remove the --version from ReadMeFirst.txt help file

Signed-off-by: mayx <yanrui.ma@lexisnexisrisk.com>
  • Loading branch information
mayx committed Jul 31, 2017
1 parent f23e47f commit bdcbb70
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 42 deletions.
4 changes: 2 additions & 2 deletions clienttools/IDEPlugins/ESDL/esdl.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ for /f "tokens=1,2,3 delims=/:" %%a in ("%8") do set http=%%a&set server=%%b&set
echo.server: %server% >> %TMP%\log.txt
echo.port : %port% >> %TMP%\log.txt

echo "%clienttoolsbindir%\esdl.exe publish %newinput% %2 --server %server% --port %port% --version 1.0 --username %6 --password %9 -v" >>%TMP%\log.txt
"%clienttoolsbindir%"\esdl.exe publish %newinput% %2 --server %server% --port %port% --version 1.0 --username %6 --password %9 -v 2>%5 >>%TMP%\log.txt
echo "%clienttoolsbindir%\esdl.exe publish %newinput% %2 --server %server% --port %port% --username %6 --password %9 -v" >>%TMP%\log.txt
"%clienttoolsbindir%"\esdl.exe publish %newinput% %2 --server %server% --port %port% --username %6 --password %9 -v 2>%5 >>%TMP%\log.txt
goto end

:genecl
Expand Down
2 changes: 1 addition & 1 deletion esp/esdllib/esdl_def.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ void EsdlDefinition::walkDefinitionDepthFirst( AddedObjs& foundByName, EsdlDefOb
// ancestors- they've already been added.
// Checking up front here will also allow us to detect cycles in the strcuture
// graph -such as we have with BpsReportRelative- and avoid an infinite loop
if( found || esdlObj->checkOptional(opts) == false || esdlObj->checkVersion(requestedVer) == false )
if (found || esdlObj->checkOptional(opts) == false || (requestedVer != 0.0 && esdlObj->checkVersion(requestedVer) == false))
{
//DBGLOG("%s</%s><Skipped/>", indent.str(), esdlObj->queryName());
return;
Expand Down
4 changes: 2 additions & 2 deletions initfiles/examples/EsdlExample/ReadMeFirst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Make a copy of the /opt/HPCCSystems/examples/EsdlExample folder.
From EsdlExample copy folder:

1. Generate java base classes (and dummy implementation file):
esdl java esdl_example.esdl EsdlExample --version=9
esdl java esdl_example.esdl EsdlExample

2. Compile java base classes and example service (must have sudo access to place the classes in the default HPCC class location):
sudo javac -g EsdlExampleServiceBase.java -cp /opt/HPCCSystems/classes -d /opt/HPCCSystems/classes/
Expand All @@ -37,7 +37,7 @@ esdl ecl esdl_example.esdl .
ecl publish roxie RoxieEchoPersonInfo.ecl

5. Publish the esdl defined service to dynamicESDL:
esdl publish esdl_example.esdl EsdlExample --version 9 --overwrite
esdl publish esdl_example.esdl EsdlExample --overwrite

5. Bind both java and roxie implementations to DynamicESDL
esdl bind-service myesp 8088 esdlexample.1 EsdlExample --config esdl_binding.xml --overwrite
Expand Down
20 changes: 2 additions & 18 deletions tools/esdlcmd/esdl-publish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class EsdlPublishCmdCommon : public EsdlCmdCommon
" --port <port> WsESDLConfig service port\n"
" -u, --username <name> Username for accessing WsESDLConfig service\n"
" -pw, --password <pw> Password for accessing WsESDLConfig service\n"
" --version <ver> ESDL service version\n"
);
EsdlCmdCommon::usage();
}
Expand All @@ -94,8 +93,6 @@ class EsdlPublishCmdCommon : public EsdlCmdCommon
return true;
if (iter.matchFlag(optWSProcPort, ESDL_OPTION_SERVICE_PORT) || iter.matchFlag(optWSProcPort, ESDL_OPT_SERVICE_PORT))
return true;
if (iter.matchFlag(optVersionStr, ESDLOPT_VERSION))
return true;
if (iter.matchFlag(optUser, ESDL_OPT_SERVICE_USER) || iter.matchFlag(optUser, ESDL_OPTION_SERVICE_USER))
return true;
if (iter.matchFlag(optPass, ESDL_OPT_SERVICE_PASS) || iter.matchFlag(optPass, ESDL_OPTION_SERVICE_PASS))
Expand Down Expand Up @@ -127,7 +124,7 @@ class EsdlPublishCmd : public EsdlPublishCmdCommon
Owned<IClientPublishESDLDefinitionRequest> request = esdlConfigClient->createPublishESDLDefinitionRequest();

StringBuffer esxml;
esdlHelper->getServiceESXDL(optSource.get(), optESDLService.get(), esxml, optVersion);
esdlHelper->getServiceESXDL(optSource.get(), optESDLService.get(), esxml, 0);

if (esxml.length()==0)
{
Expand All @@ -152,7 +149,7 @@ class EsdlPublishCmd : public EsdlPublishCmdCommon
return 1;
}

fprintf(stdout, "\nESDL Service: %s(%f): %s", optESDLService.get() ,optVersion, resp->getStatus().getDescription());
fprintf(stdout, "\nESDL Service: %s: %s", optESDLService.get(), resp->getStatus().getDescription());

return 0;
}
Expand Down Expand Up @@ -229,19 +226,6 @@ class EsdlPublishCmd : public EsdlPublishCmdCommon

bool finalizeOptions(IProperties *globals)
{
if (!optVersionStr.isEmpty())
{
optVersion = atof( optVersionStr.get() );
if( optVersion <= 0 )
{
throw MakeStringException( 0, "Version option must be followed by a real number > 0" );
}
}
else
{
fprintf(stderr, "\nWARNING: ESDL Version not specified.\n");
}

if (optSource.isEmpty())
throw MakeStringException( 0, "Source ESDL definition file (ecm|esdl|xml) must be provided" );

Expand Down
2 changes: 1 addition & 1 deletion tools/esdlcmd/esdlcmd_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ esdlCmdOptionMatchIndicator EsdlCmdCommon::matchCommandLineOption(ArgvIterator &
usage();
return EsdlCmdOptionCompletion;
}
if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
if (iter.matchFlag(boolValue, ESDLOPT_BUILD))
{
fprintf(stdout, "%s\n", BUILD_TAG);
return EsdlCmdOptionCompletion;
Expand Down
2 changes: 2 additions & 0 deletions tools/esdlcmd/esdlcmd_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ typedef IEsdlCommand *(*EsdlCommandFactory)(const char *cmdname);
#define ESDLOPT_XSLT_PATH "--xslt"

#define ESDLOPT_VERSION "--version"
#define ESDLOPT_BUILD "--build"
#define ESDLOPT_SERVICE "--service"
#define ESDLOPT_METHOD "--method"
#define ESDLOPT_PREPROCESS_OUT "--preprocess-output"
Expand Down Expand Up @@ -124,6 +125,7 @@ class EsdlCmdCommon : public CInterface, implements IEsdlCommand
{
fprintf(stdout,
" --help display usage information for the given command\n"
" --build display the build information\n"
" -v,--verbose output additional tracing information\n"
);
}
Expand Down
20 changes: 4 additions & 16 deletions tools/esdlcmd/esdlcmd_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ class Esdl2WSDLCmd : public Esdl2XSDCmd
class Esdl2JavaCmd : public EsdlHelperConvertCmd
{
public:
Esdl2JavaCmd() : optVersion(0), optFlags(0)
Esdl2JavaCmd() : optFlags(0)
{}

virtual bool parseCommandLineOptions(ArgvIterator &iter)
Expand Down Expand Up @@ -668,8 +668,6 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd

virtual bool parseCommandLineOption(ArgvIterator &iter)
{
if (iter.matchOption(optVersionStr, ESDLOPT_VERSION))
return true;
if (iter.matchOption(optService, ESDLOPT_SERVICE))
return true;
if (iter.matchOption(optMethod, ESDLOPT_METHOD))
Expand Down Expand Up @@ -703,13 +701,6 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd
throw( MakeStringException(0, "A service name must be provided") );
}

if (!optVersionStr.isEmpty())
{
optVersion = atof( optVersionStr.get() );
if( optVersion <= 0 )
throw MakeStringException( 0, "Version option must be followed by a real number > 0" );
}

if (!optXsltPath.length())
{
StringBuffer binXsltPath;
Expand Down Expand Up @@ -738,8 +729,8 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd

virtual int processCMD()
{
cmdHelper.loadDefinition(optSource, optService, optVersion);
Owned<IEsdlDefObjectIterator> structs = cmdHelper.esdlDef->getDependencies( optService, optMethod, ESDLOPTLIST_DELIMITER, optVersion, NULL, optFlags );
cmdHelper.loadDefinition(optSource, optService, 0);
Owned<IEsdlDefObjectIterator> structs = cmdHelper.esdlDef->getDependencies( optService, optMethod, ESDLOPTLIST_DELIMITER, 0, NULL, optFlags );

if(!optPreprocessOutputDir.isEmpty())
{
Expand Down Expand Up @@ -768,7 +759,6 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd
void printOptions()
{
puts("Options:");
puts(" --version <version number> : Constrain to interface version");
puts(" --method <method name>[;<method name>]* : Constrain to list of specific method(s)" );
puts(" --xslt <xslt file path> : Path to xslt files used to transform EsdlDef to Java code" );
puts(" --preprocess-output <raw output directory> : Output pre-processed xml file to specified directory before applying XSLT transform" );
Expand Down Expand Up @@ -798,7 +788,7 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd
StringBuffer xml;

xml.appendf( "<esxdl name='%s'>", optService.get());
cmdHelper.defHelper->toXML( obj, xml, optVersion, NULL, optFlags );
cmdHelper.defHelper->toXML( obj, xml, 0, NULL, optFlags );
xml.append("</esxdl>");
saveAsFile(optPreprocessOutputDir, NULL, xml, NULL );
}
Expand Down Expand Up @@ -836,8 +826,6 @@ class Esdl2JavaCmd : public EsdlHelperConvertCmd
StringAttr optXsltPath;
StringAttr optMethod;
StringAttr optPreprocessOutputDir;
StringAttr optVersionStr;
double optVersion;
unsigned optFlags;

protected:
Expand Down
4 changes: 2 additions & 2 deletions tools/esdlcmd/esdlcmd_shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ bool EsdlCMDShell::parseCommandLineOptions(ArgvIterator &iter)
iter.next();
break;
}
if (iter.matchFlag(boolValue, "--version"))
if (iter.matchFlag(boolValue, ESDLOPT_BUILD))
{
fprintf(stdout, "%s\n", BUILD_TAG);
return false;
Expand All @@ -180,7 +180,7 @@ bool EsdlCMDShell::parseCommandLineOptions(ArgvIterator &iter)
void EsdlCMDShell::usage()
{
fprintf(stdout,"\nUsage:\n"
" esdl [--version] <command> [<args>]\n\n"
" esdl <command> [<args>]\n\n"
"Commonly used commands:\n"
" xml Generate XML from ESDL definition.\n"
" ecl Generate ECL from ESDL definition.\n"
Expand Down

0 comments on commit bdcbb70

Please sign in to comment.