-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
77 lines (72 loc) · 2.43 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
plugins {
id "io.freefair.lombok" version "8.3" apply false
id 'com.github.jk1.dependency-license-report' version '2.5' apply false
id "org.kordamp.gradle.markdown" version "2.2.0" apply false
}
group 'com.fortify.ssc.parser.generic.cyclonedx'
ext.getVersion = {
def result = project.findProperty('version');
return !result || result=='unspecified' ? new Date().format('0.yyyyMMdd.HHmmss') : result;
}
version = ext.getVersion();
configurations.all {
// Don't cache modules that may change (i.e. snapshots)
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
subprojects {
apply plugin: 'java'
apply plugin: 'io.freefair.lombok'
apply plugin: 'org.kordamp.gradle.markdown'
apply plugin: 'com.github.jk1.dependency-license-report'
version = rootProject.version;
sourceCompatibility = 1.8
ext {
gradleHelpersLocation = "https://raw.githubusercontent.com/fortify-ps/gradle-helpers/1.8"
thirdPartyBaseName = "${project.name}-${project.version}"
}
apply from: "${gradleHelpersLocation}/repo-helper.gradle"
ext.sscParserPluginVersion = project.version
apply from: "${gradleHelpersLocation}/ssc-parser-plugin-helper.gradle"
apply from: "${gradleHelpersLocation}/markdown2html.gradle"
apply from: "${gradleHelpersLocation}/thirdparty-helper.gradle"
dependencies {
implementationExport('com.fortify.ssc.parser.util:fortify-ssc-parser-util-cyclonedx:2.0.0.RELEASE') {
// Make sure that we don't bundle Fortify plugin API and SLF4J in the plugin jar
exclude group: 'com.fortify.plugin'
exclude group: 'org.slf4j'
}
}
task copyMarkdown(type: Copy) {
from("${rootProject.projectDir}") {
include "USAGE.md"
}
into "${m2hSourceDir}"
}
task dist(type: Zip) {
dependsOn 'build', 'markdownToHtml'
archiveFileName = "${project.name}-${project.version}.zip"
destinationDirectory = file("${rootProject.buildDir}/dist")
from("${buildDir}/${libsDirName}") {
include "${project.name}-${project.version}.jar"
}
from("${rootProject.projectDir}/sampleData") {
into "sampleData"
}
from "${m2hOutputDir}"
from("${rootProject.projectDir}") {
include "LICENSE.txt"
}
}
task copyThirdParty(type: Copy) {
from("${buildDir}/dist") {
include "*-thirdparty.zip"
}
into "${rootProject.buildDir}/dist"
}
distThirdParty.finalizedBy copyThirdParty
}
// For some reason Gradle doesn't clean the root project, so we define a clean task here
task clean(type: Delete) {
delete "${buildDir}"
followSymlinks = true
}