This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
133 lines (108 loc) · 3.78 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import java.nio.file.Files
plugins {
java
application
id("net.researchgate.release") version "2.8.1"
id("org.cadixdev.licenser") version "0.6.1"
}
java.toolchain.languageVersion.set(JavaLanguageVersion.of(16))
license {
header(rootProject.file("HEADER.txt"))
(this as ExtensionAware).extra.apply {
set("name", rootProject.name)
for (key in listOf("organization", "url")) {
set(key, rootProject.property(key))
}
}
}
repositories {
mavenCentral()
}
dependencies {
constraints {
implementation("io.netty:netty-all:jar") {
version {
require("4.1.65.Final")
}
because("It's the latest right now")
}
}
compileOnly(libs.auto.service.annotations)
compileOnly(libs.auto.value.annotations)
annotationProcessor(libs.auto.service.processor)
annotationProcessor(libs.auto.value.processor)
compileOnly(libs.checkerframework.qual)
implementation(libs.mapdb)
implementation(platform(libs.log4j.bom))
implementation(libs.log4j.api)
runtimeOnly(libs.log4j.core)
runtimeOnly(libs.log4j.slf4jImpl)
implementation(libs.lettar)
implementation(libs.templar.core)
implementation(libs.templar.codec.jackson)
implementation(platform(libs.jackson.bom))
implementation(libs.jackson.databind)
implementation(libs.jackson.annotations)
implementation(libs.jackson.core)
implementation(libs.jackson.datatype.jsr310)
implementation(libs.jackson.datatype.jdk8)
implementation(libs.jackson.datatype.guava)
implementation(libs.velocity)
implementation(libs.guava)
implementation(libs.javafx.base)
listOf("mac", "win", "linux").forEach {
implementation(variantOf(libs.javafx.base) { classifier(it) })
}
implementation(libs.greenishJungle)
testImplementation(platform(libs.junit.bom))
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
}
application.mainClass.set("net.octyl.ytmp3.YoutubeMp3Server")
tasks.run.configure {
environment("YTMP3_HOST", "localhost")
environment("YTMP3_PORT", "9000")
}
// Super exciting! We"re doing ES6 transpilation!
val destDirBase = project.file("$buildDir/transpiled")
val transpileJavascript by tasks.registering {
val sourceDir = file("transpile-source/javascript")
val destinationDir = destDirBase.resolve("javascript")
inputs.files("package.json", ".babelrc")
inputs.dir(sourceDir)
outputs.dir(destinationDir)
doLast {
project.exec {
executable = project.file("./node_modules/.bin/babel").absolutePath
args = listOf("-d", destinationDir, sourceDir).map { it.toString() }
}
}
}
val transpileScss by tasks.registering {
val sourceDir = file("transpile-source/scss")
val destinationDir = destDirBase.resolve("stylesheets")
inputs.files("package.json")
inputs.dir(sourceDir)
outputs.dir(destinationDir)
doLast {
val cssMiddleman = Files.createTempDirectory("yt-mp3-css-middleman").toFile()
project.exec {
executable = project.file("./node_modules/.bin/sass").absolutePath
args = listOf("--style=compressed",
"--no-source-map",
"--update",
"$sourceDir:$cssMiddleman")
}
project.exec {
executable = project.file("./node_modules/.bin/postcss").absolutePath
args = (listOf("--use", "autoprefixer", "--dir", destinationDir) +
project.fileTree(cssMiddleman).files).map { it.toString() }
}
}
}
val transpileResources by tasks.registering {
dependsOn(transpileJavascript, transpileScss)
}
sourceSets.main {
output.dir(mapOf("builtBy" to "transpileResources"), destDirBase)
}