Skip to Content

build.compiler param to SCAcompiler

Posted in

Hey,

i have to write a target in my ANT script (which is using ant4eclipse, to build trough featureFiles), that uses the CompilerAdapter of Fortify360 (for sourcecode analyzing).

If i change the build.compiler to this adapter, it should intercept every javac command during the build and doing some translations at first, to get later the results of the analyzing process.

Im asking my self, how it is possible to set the build.compiler property for ant4eclipse? because every "normal" javac commands were affected trough this property, except the one from ant4eclipse. and i changed the macrofile to use the javac task instead of jdtCompiler.

I would be happy if you can help me

thanks,
regards

already checked

i have already testet with the compiler attribute for the javac task. Dont have any idea why it's nocht working =/ seems that he is using only ECJ Adapter (When configured), when not, then the "normal" Javac Compiler is used.

Just submit an example of

Just submit an example of your ant script. Otherwise it's hard to tell if we're talking about the same scenario.

Best regards

example

this is how i do in the build.xml:

<target name="buildAllFeatures">		
<ant4eclipse:executeProjectSet workspaceDirectory="${plugin.source.path}" allWorkspaceProjects="true">	
<ant4eclipse:forEachProject filter="(executeProjectSet.org.eclipse.pde.FeatureNature=*)">
 
<buildFeature workspaceDirectory="${plugin.source.path}" featureId="this.is.a.feature" featureVersion="0.0.0" 
targetplatformid="my.target.platform" destination="${plugin.jar.path}" 
cleanPluginBuild="false" clearDestination="false" packagePluginSourcesAsJar="false" useecj="false" />
 
<buildFeature workspaceDirectory="${plugin.source.path}" featureId="this.is.a.feature" featureVersion="0.0.0" 
targetplatformid="my.target.platform" destination="${plugin.jar.path}" 
cleanPluginBuild="false" clearDestination="false" packagePluginSourcesAsJar="false" useecj="false" />
 
</ant4eclipse:forEachProject>
</ant4eclipse:executeProjectSet>
</target>

in the a4e-pde-macros.xml i changed the <jdtCompiler> command to <javac> command, now it's just like this:
<javac
destdir="${buildPlugin.default.output.directory}"
source="1.6"
target="1.6"
compiler="com.fortify.dev.ant.SCACompiler"
>

there are also some <compilerargs> commands in this section of the macro. Because they also have a "compiler" parameter, i tetsted once with my SCACompiler-Adapter and once without specifying the compilerargs, and once with letting them as they are. But with no success..

i hope you understand a little bit better what i exactly need and maybe you have an idea now.

what i would like to see: normally the compilation should throw an error, because this adapter is not available on my machine. I've just to prepare the script. I know that this is not really brainy, but i have to do it.

solved

hey,

i solved it. It was a really stupid problem. Because the class-files were already there, so the ant script wasn't compiling everytime from scratch.

i configured ant now to compile everytime "from scratch", which means deleting the older class files before compiling new ones. and the script is doing well :)

thank you for your time

"compiler" attribute ?

Have you checked for the "compiler" attribute of the 'javac' task ?

See http://www.ant4eclipse.org/node/55 for more info.

Best regards