-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
51 lines (43 loc) · 1.18 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
plugins {
id 'java'
}
repositories {
jcenter()
}
dependencies {
implementation 'pl.edu.icm.pcj:pcj:5.1.0'
annotationProcessor 'pl.edu.icm.pcj:pcj:5.1.0'
implementation('org.apache.hadoop:hadoop-common:3.2.1') {
// transitive = false
}
implementation('org.apache.hadoop:hadoop-hdfs:3.2.1') {
// transitive = false
}
}
if (!hasProperty('mainClass')) {
ext.mainClass = 'pl.umk.mat.faramir.terasort.App'
}
tasks.withType(Jar) {
destinationDirectory = file("${buildDir}/dist")
}
task copyToLib(type: Copy) {
into "${buildDir}/dist/libs"
from configurations.runtimeClasspath
}
jar.dependsOn(copyToLib)
jar {
manifest {
attributes 'Implementation-Title': project.name,
'Main-Class': project.ext.mainClass,
'Class-Path': configurations.runtimeClasspath.collect { "libs/$it.name" }.join(' ')
}
}
task makeFatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': project.name,
'Main-Class': project.ext.mainClass
}
archiveBaseName = project.name + '-fatjar'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}