-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
70 lines (57 loc) · 1.81 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
plugins {
id 'java'
}
group = 'pl.edu.icm.heap.kite'
version = '1.0'
repositories {
mavenCentral()
}
java {
sourceCompatibility '17'
targetCompatibility '17'
}
dependencies {
implementation 'pl.edu.icm.pcj:pcj:5.3.3'
annotationProcessor 'pl.edu.icm.pcj:pcj:5.3.3'
}
tasks.withType(Jar).configureEach {
manifest {
attributes 'Implementation-Title': project.name
attributes 'Implementation-Version': version
attributes 'Main-Class': 'pl.edu.icm.heap.kite.PcjMain'
}
}
tasks.register('copyDependencies', Copy) {
group 'release'
description 'Copy dependencies into build directory'
from configurations.runtimeClasspath
into layout.buildDirectory.dir('libs')
}
tasks.register('createDependenciesJar', Jar) {
group 'release'
description 'Create jar with all dependencies copied into output directory added into its manifest file'
dependsOn(copyDependencies)
with jar
manifest {
attributes 'Class-Path': configurations.runtimeClasspath.files.collect { it.getName() }.join(' ')
}
}
tasks.register('release', Zip) {
group 'release'
description 'Create zip file with project and all its dependencies'
dependsOn(createDependenciesJar)
from layout.buildDirectory.dir('libs')
include '*.jar'
include '*/*.jar'
archiveFileName = project.name + '-' + version + '.zip'
destinationDirectory = layout.buildDirectory.dir('dist')
}
// alternatively fat/uber jar can be generated
tasks.register('createFatJar', Jar) {
group = 'release'
description 'Create one big (fat, uber) jar with all dependencies extracted into it'
with jar
archiveClassifier = 'fatjar'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
}