-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
85 lines (70 loc) · 2.25 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
78
79
80
81
82
83
84
85
plugins {
id 'java'
id 'application'
id 'com.gradleup.shadow' version "$shadowPluginVersion"
}
group = 'net.brlns'
version = '1.1.1'
def author = 'Gabriel D @hstr0100'
def lowercaseName = 'livecaptionslogger'
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
modularity.inferModulePath = false
}
repositories {
mavenCentral()
gradlePluginPortal()
}
application {
mainClass = 'net.brlns.livecaptions.LiveCaptionsLogger'
mainModule = 'net.brlns.livecaptions'
}
dependencies {
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "net.sourceforge.tess4j:tess4j:$tess4jVersion"
implementation "org.apache.commons:commons-text:$commonsTextVersion"
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "ch.qos.logback:logback-classic:$logbackVersion"
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += ['-Xlint:all,-serial,-processing,-requires-automatic']
}
jar {
archiveBaseName.set("${lowercaseName}-java")
manifest {
attributes(
'Implementation-Title': 'LiveCaptionsLogger',
'Implementation-Version': version,
'Implementation-Vendor': author,
'Main-Class': application.mainClass.get()
)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
shadowJar {
archiveBaseName.set("${lowercaseName}-java")
mergeServiceFiles()
}
//Replace java.exe with javaw.exe to disable console output
task replaceJavaExeInBatchFiles {
doLast {
def scriptsDir = file("${buildDir}/scriptsShadow")
if (scriptsDir.exists()) {
scriptsDir.eachFileMatch(~/.*\.bat/) { file ->
def text = file.text
text = text.replaceAll("java.exe", "javaw.exe")
text = text.replaceAll("\"%JAVA_EXE%\" %", "start /b \"\" \"%JAVA_EXE%\" %")
file.write(text)
}
}
}
}
tasks.named('startShadowScripts') {
finalizedBy(replaceJavaExeInBatchFiles)
}