Slice2java - How to add command option (i.e. --underscore) to Ant Task Def

in Comments
Hi All:
Please see the below maven ant plugin pom.xml. I am trying to add the "--underscore option" to the task definition. I read your wiki (https://doc.zeroc.com/display/Ice35/Slice2Java+Ant+Task). I tried to add , but the slice2jva is still complaining that my ice file has underscores. Thanks much for any help
maven-antrun-plugin
${maven-antrun-plugin.version}
generate-sources
run
com.zeroc
ant-ice
${ant-ice.version}
Tagged:
0
Comments
it looks my pom.xml snipped was to rendered as I expected
Hi,
What version of slice2java are you using? this option was removed in 3.7 it was replaced by underscore file metadata for example with 3.7 you can use
in your Slice files that needs to use underscores.
Hi xdm:
Thanks for your prompt reply. I am using 3.7.5. I basically have two issues:
1. want to still use underscore as per below ice file:
enum ResourceMatchingScope {SELF, SELF[["underscore"]]OR[["underscore"]]DESCENDANTS};
I tried this and the slice2java complained.
BTW the command line below will not complain and generate the source code. Because of that I thought to somehow add the "--underscode" to the ant task def for slice2java but got stuck how to add this option
I was wrong before the option was deprecated but still works, it will be better to upgrade your slice definitions to use file-metadata as in
The ant task doesn't support
--underscore
optiondefine
is for preprocessor definitions, we mostly use Gradle these days, and the ant task was not updated to support this option.you can try
I think it was not supported because it is not mentioned in the docs but looking at the code there is support for it.
Anyway switching to file metadata seems better given that
--underscore
is now deprecatedThanks much xdm!!! In fact I was looking at the ant-ice code too, but could not figure it out. Your first option works (adding to the ice file). I will also try your second option for completeness. Again Thanks much!!!
Hi xdm:
I am still trying to get the maven-ant plugin work. Below is the "issue" got it from running "mvn clean install" and the corresponding maven pom.xml config snipet:
- Issue:
- mvn config
[slice2java] skipping neti.ice
just means that the generated code is up to date, and the Slice file doesn't need to be recompile.Thx much. Really appreciate it!