title: How to run HP fortify scan using gradle or Running Fortify from Gradle build on Jenkins
body: <p>I'm using the following code to run fortify using Gradle, but this code takes time to generate reports, I'm not sure how to optimize this script to run faster, it will be great if someone can help me to optimize this script </p>
  
  <pre><code>// Add a new configuration
      configurations {
          fortify { extendsFrom compile }
      }
  
      // pull in the fortify libs for the new configuration
      dependencies {
          fortify fileTree(dir: 'C:/Program Files/Fortify Software/HP Fortify v3.20/Core/lib', include: '*.jar')
      }
  
      task fortifyReport(dependsOn: compileJava) &lt;&lt; {
          ant.properties['build.compiler']='com.fortify.dev.ant.SCACompiler'
          ant.typedef(name: 'sca', classname: 'com.fortify.dev.ant.SourceanalyzerTask',
          classpath: configurations.fortify.asPath)
  
          ant.sca(jdk:"1.6",
          maxHeap:'4096M' ,
          use64bit:true ,
          debug:true ,
          verbose:true ,
          failonerror:true ,
          scan:true ,
          logFile:file("$buildDir/fortify/Fortify.log"),
          resultsFile:file("$buildDir/fortify/abc.fpr")
          ){
             fileset(dir:'com/abc/xyz') {
                include(name:'**/*.java')}
          }
      }
  </code></pre>