forked from CycloneDX/cyclonedx-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
71 lines (57 loc) · 2.17 KB
/
build.gradle.kts
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
import java.util.Properties
plugins {
id("java-gradle-plugin")
id("com.gradle.plugin-publish") version "1.2.1"
id("org.cyclonedx.bom") version "1.8.1"
id("groovy")
}
val organization = "CycloneDX"
group = "org.cyclonedx"
version = "1.8.1"
java.sourceCompatibility = JavaVersion.VERSION_1_8
java.targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
dependencies {
implementation("org.cyclonedx:cyclonedx-core-java:8.0.3") {
exclude(group = "org.apache.logging.log4j", module ="log4j-slf4j-impl")
}
implementation("commons-codec:commons-codec:1.16.0")
implementation("commons-io:commons-io:2.15.1")
implementation("org.apache.maven:maven-core:3.9.6")
testImplementation(gradleTestKit())
testImplementation("org.spockframework:spock-core:2.2-M1-groovy-3.0") {
exclude(module = "groovy-all")
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
tasks.withType<ProcessResources> {
doLast {
val resourcesDirectory = project.layout.buildDirectory.dir("resources/main")
val pluginPropertiesFile = file("${resourcesDirectory.get()}/plugin.properties")
val pluginProperties = Properties()
pluginProperties["name"] = project.name
pluginProperties["vendor"] = organization
pluginProperties["version"] = project.version
pluginProperties.store(pluginPropertiesFile.writer(), "Automatically populated by Gradle build.")
}
}
gradlePlugin {
website.set("https://cyclonedx.org")
vcsUrl.set("https://github.com/CycloneDX/cyclonedx-gradle-plugin.git")
plugins {
create("cycloneDxPlugin") {
id = "org.cyclonedx.bom"
displayName = "CycloneDX BOM Generator"
description = "The CycloneDX Gradle plugin creates an aggregate of all direct and transitive dependencies of a project and creates a valid CycloneDX Software Bill of Materials (SBOM)."
implementationClass = "org.cyclonedx.gradle.CycloneDxPlugin"
tags.set(listOf("cyclonedx", "dependency", "dependencies", "owasp", "inventory", "bom", "sbom"))
}
}
}