-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
84 lines (66 loc) · 2.57 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import groovy.lang.Closure
plugins {
java
kotlin("jvm") version "1.3.10"
id("com.github.johnrengelman.shadow") version "4.0.3"
}
group = "com.abitofhelp"
version = "1.0.0"
repositories {
mavenCentral()
}
dependencies {
compile(kotlin("stdlib-jdk8"))
testCompile("junit", "junit", "4.12")
}
configure<JavaPluginConvention> {
sourceCompatibility = JavaVersion.VERSION_1_8
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
///////////////////////////////////////////////////////////////////////
// This task must be added to the build.gradle.kts file
// in order to create a shadowjar containing the required information.
///////////////////////////////////////////////////////////////////////
tasks.withType<ShadowJar> {
manifest.attributes.apply {
///////////////////////////////////////////////////////////
// The following attributes apply to the archive/jar file
// that is being created and not the manifest.
///////////////////////////////////////////////////////////
baseName = "simpleshadow"
// A description about the archive/jar being created;
// I couldn't find it being applied to an archive/jar.
description = "A simple app to determine how to configure shadowjar with Kotlin DSL in Gradle."
// The base name of the archive/jar being created
// archiveName = "thearchivename"
// The directory path for the archive/jar being created
// destinationDir = File("")
// The extension part of the archive/jar name
// extension = "JAR"
// The appendix part of the archive/jar name
// appendix = "abc"
// The classifier part of the archive/jar name
classifier = "all"
// The version part of the archive/jar name
version = "1.0.0"
///////////////////////////////////////////////////////////
// The following attributes apply to the mainfest for the
// archive/jar being created.
///////////////////////////////////////////////////////////
manifest {
attributes(
mutableMapOf<String, String>(
"Base-Name" to baseName,
"Main-Class" to "com.abitofhelp.howdy.MainKt",
"Start-Class" to "",
"Implementation-Title" to "I am a title.",
"Implementation-Version" to version
)
)
}
}
}