-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle.kts
96 lines (76 loc) · 2.68 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
95
96
plugins {
java
alias(libs.plugins.download)
}
private val netbeansVersion = libs.versions.netbeans.ide.get()
java {
toolchain {
languageVersion = JavaLanguageVersion.of(libs.versions.java.get())
}
}
subprojects {
apply(plugin = "java")
repositories {
mavenCentral()
maven {
url = uri("https://netbeans.apidesign.org/maven2")
}
}
dependencies {
//implementation(platform(rootProject.libs.netbeans.cluster.platform))
//implementation(platform(rootProject.libs.netbeans.cluster.harness))
//
//runtimeOnly(libs.netbeans.cluster.platform)
//implementation(libs.netbeans.api.core.multitabs)
runtimeOnly(rootProject.libs.netbeans.modules.projectapi.nb)
runtimeOnly(rootProject.libs.netbeans.modules.core.multitabs.project)
runtimeOnly(rootProject.libs.netbeans.modules.core.windows)
testImplementation(rootProject.libs.junit.jupiter)
testImplementation(rootProject.libs.junit4)
testRuntimeOnly(rootProject.libs.junit.vintage.engine)
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
tasks.withType<Jar>().configureEach {
manifest {
from("${project.projectDir}/manifest.mf")
}
}
}
tasks {
val downloadNetBeans = register("downloadNetBeans") {
description = "Ensures netbeans-$netbeansVersion-bin.zip has been downloaded to the build directory"
group = "prepare"
doLast {
download.run {
src("https://archive.apache.org/dist/netbeans/netbeans/$netbeansVersion/netbeans-$netbeansVersion-bin.zip")
dest(layout.buildDirectory)
overwrite(true)
onlyIfModified(true)
}
}
}
register<Copy>("unpackNetBeans") {
description =
"Ensures the required netbeans-$netbeansVersion modules have been extracted to the netbeans-plat directory"
group = "prepare"
val netbeansZip = zipTree(file(layout.buildDirectory).resolve("netbeans-$netbeansVersion-bin.zip"))
val netbeansDir = file("./netbeans-plat/$netbeansVersion/").also {
it.mkdirs()
}
from(netbeansZip)
into(netbeansDir)
eachFile {
relativePath = RelativePath(true, *relativePath.segments.drop(1).toTypedArray())
}
include("netbeans/platform/**", "netbeans/harness/**", "netbeans/ide/**")
exclude("netbeans/platform/docs/**")
inputs.files(downloadNetBeans)
outputs.dir(netbeansDir)
includeEmptyDirs = false
doFirst {
file(layout.buildDirectory).mkdirs()
}
}
}