Download Fortify SCA User Guide
Transcript
<antcall target="compile">
<!-- Log SCA in separate file -->
<param name="com.fortify.sca.Debug" value="${fortify.debug}" />
<param name="com.fortify.sca.Verbose" value="${fortify.verbose}" />
<param name="com.fortify.sca.LogFile"
value="${code.build}/log/${sourceanalyzer.buildid}-${DSTAMP}${TSTAMP}.log" />
<param name="build.compiler"
value="com.fortify.dev.ant.SCACompiler" />
</antcall>
<!-- capture all configuration files in WEB-INF directory -->
<echo>sourceanalyzer ${web-inf}</echo>
<sourceanalyzer buildid="${sourceanalyzer.buildid}">
<fileset dir="${web-inf}">
<include name="**/*.properties"/>
<include name="**/*.xml"/>
</fileset>
</sourceanalyzer>
<!-- translate all jsp files-->
<echo>sourceanalyzer ${basedir} jsp</echo>
<sourceanalyzer buildid="${sourceanalyzer.buildid}">
<fileset dir="${basedir}">
<include name="**/*.jsp"/>
</fileset>
<classpath refid="jsp.classpath"/>
</sourceanalyzer>
<!-- run analysis -->
<echo>sourceanalyzer scan</echo>
<sourceanalyzer buildid="${sourceanalyzer.buildid}"
scan="true"
resultsfile="issues.fpr"
/ >
</target>
Ant properties
Any Ant property that begins with com.fortify is relayed to the sourceanalyzer task via -D. For example, setting the com.fortify.sca.ProjectRoot property results in Dcom.fortify.sca.ProjectRoot=<value> being passed to the sourceanalyzer task. This is also used for the SCACompiler adapter. These properties can be set either in the build file, using the <property> task for example, or on the Ant command line using the -D<property=<value> syntax. When using the SCACompiler adapter via the build.compiler setting, the sourceanalyzer.build Ant property is equivalent to the buildID attribute of the sourceanalyzer task, and the sourceanalyzer.maxHeap is equivalent to maxHeap. You can use either the command line or your build script to set these properties. Fortify SCA User Guide
44