-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
48 lines (38 loc) · 1.11 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
plugins {
id 'java'
}
apply plugin: "java"
sourceCompatibility = 1.8
sourceSets.main.java.srcDirs = ["src"]
sourceSets.main.resources.srcDirs = ["assets"]
group 'ntt.leet.core.main'
version '1.01'
project.ext.mainClassName = "main.Main"
dependencies{
implementation fileTree(dir: 'libs', include: '*.jar')
}
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'ntt.leet.core.Main'
)
}
compileJava.options.encoding = 'UTF-8'
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}
task buildJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'main.Main'
}
compileJava.options.encoding = 'UTF-8'
baseName = 'soft'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}