How to run HP fortify scan using gradle or Running Fortify from Gradle build on Jenkins

偶尔善良 提交于 2019-12-24 04:56:31

问题


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

// 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) << {
        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')}
        }
    }

来源:https://stackoverflow.com/questions/29473016/how-to-run-hp-fortify-scan-using-gradle-or-running-fortify-from-gradle-build-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!