forked from hangga/delvelin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
94 lines (79 loc) · 2.7 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
plugins {
java
kotlin("jvm") version "2.0.21"
id("com.gradle.plugin-publish") version "1.3.0"
}
group = "io.github.hangga"
//version = "0.0.20-beta"
version = project.findProperty("version") as String? ?: ""
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")
// implementation("com.google.guava:guava:31.1-jre")
// implementation("org.hibernate.orm:hibernate-core:7.0.0.Beta1")
// implementation("org.apache.logging.log4j:log4j-core:2.0-beta9")
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(8) // Menetapkan toolchain untuk kompatibilitas Java 8
}
tasks.register<Jar>("fatJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn(tasks.classes)
from(sourceSets.main.get().output) // Tambahkan semua output dari sourceSets
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
artifacts { name }
archiveBaseName.set("delvelin")
archiveClassifier.set("all")
archiveVersion.set(project.version.toString())
}
tasks.named("build") {
dependsOn("fatJar") // Pastikan fat JAR dibuat dalam task build
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
// Publikasikan fat JAR dengan nama khusus
artifact(tasks.named("fatJar").get()) {
classifier = "all" // Sertakan classifier agar nama unik
}
// Metadata publikasi
groupId = project.group.toString()
artifactId = "delvelin"
version = project.version.toString()
}
}
repositories {
maven {
url = uri("https://repo.repsy.io/mvn/hangga/repo")
credentials {
username = project.findProperty("repoUsername") as String? ?: ""
password = project.findProperty("repoPassword") as String? ?: ""
}
}
}
}
gradlePlugin {
website.set("https://github.com/hangga/delvelin")
vcsUrl.set("https://github.com/hangga/delvelin")
plugins {
create("delvelinPlugin") {
id = "io.github.hangga.delvelin"
implementationClass = "io.github.hangga.delvelin.DelvelinScan"
displayName = "Delvelin Plugin"
description = "Java/Kotlin vulnerability analyzer with CWE and CVSS standards."
tags.set(listOf("testing", "Analyzer", "Vulnerability", "delvelin", "CWE", "CVSS"))
}
}
}
tasks.register<JavaExec>("scanDelvelin") {
classpath = sourceSets["main"].runtimeClasspath
mainClass.set("io.github.hangga.delvelin.Delvelin")
// args("format_html")
args("format_json")
}