Skip to content

Instantly share code, notes, and snippets.

@astellingwerf
Forked from ran488/build.gradle
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astellingwerf/91dd9bcc690f9a3adafa to your computer and use it in GitHub Desktop.
Save astellingwerf/91dd9bcc690f9a3adafa to your computer and use it in GitHub Desktop.
// Add a new configuration
configurations {
fortify { extendsFrom compile }
}
// pull in the fortify libs for the new configuration
dependencies {
// fortify 'com.fortify:sourceanalyzer:3.90' // Ideally
fortify files('/home/astellin/fortify/HP_Fortify_SCA_and_Apps_4.10/Core/lib/sourceanalyzer.jar') // For now
}
// the 2 new tasks
task fortifyReport << {
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.7",
debug: true,
verbose: true,
failonerror: true,
scan: true,
logFile: file("$buildDir/reports/fortify/Fortify.log"),
resultsFile: file("$buildDir/reports/fortify/${project.name}.fpr"),
classpath: configurations.compile.asPath
) {
fileset(dir: 'src/java') {
include(name: '**/*.java')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment