-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
80 lines (66 loc) · 1.97 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
plugins {
id "nebula.ospackage" version "4.4.0"
id "java"
}
version = '1.0.2'
sourceCompatibility = 1.8
sourceSets {
main {
java { srcDir 'src' } resources { srcDir 'resources' }
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.commons:commons-exec:1.3'
compile 'commons-io:commons-io:2.5'
compile 'com.google.code.gson:gson:2.8.0'
compile 'org.twitter4j:twitter4j-core:4.0.6'
compile 'org.slf4j:slf4j-api:1.7.24'
compile 'org.slf4j:slf4j-log4j12:1.7.24'
}
jar {
manifest {
attributes(
'Main-Class': 'de.fortunify.Main',
'Class-Path': configurations.compile.collect { 'libs/' + it.getName() }.join(' ')
)
}
}
task man << {
ant.mkdir(dir: 'build/docs')
ant.gzip(src: 'docs/fortunify.6', destfile: "build/docs/fortunify.6.gz")
}
task deb(type: Deb, dependsOn: ['jar', 'man']) {
maintainer = 'Doreen Seider'
requires('java8-runtime-headless')
requires('fortune-mod')
into '/usr'
from(jar.outputs.files) { into 'share/fortunify' fileMode 0755 }
from(configurations.runtime) { into 'share/fortunify/libs' fileMode 0755 }
def temp = File.createTempFile('fortunify', '')
fileMode = 0755
temp.write '#!/bin/sh'
temp.append System.getProperty('line.separator')
// construct path from variables to make sure it is consistent with paths and files defined above
temp.append 'java -jar /usr/share/fortunify/fortunify-'
temp.append version
temp.append '.jar "$@"'
from(temp.absolutePath) {
into 'games' rename { String fileName ->
fileName.replace(temp.getName(), project.name)
}
}
from(project.buildDir.absolutePath + '/docs') { into 'share/man/man6' }
}
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'de.fortunify.Main'
}
baseName = project.name + '-all'
from {
configurations.compile.collect { zipTree(it) }
}
with jar
}