-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
66 lines (58 loc) · 1.6 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
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'java'
apply plugin: 'application'
apply from: 'template.properties'
/*
//template.properties example:
ext {
clientId = '0000000'
clientSecret = '00000000000000000000'
clientEmail = '[email protected]'
clientPass = 'password123'
}
*/
mainClassName = "com.vk.api.examples.oauth.user.Application"
repositories {
mavenCentral()
}
dependencies {
compile 'org.apache.logging.log4j:log4j-core:+',
'org.jsoup:jsoup:+',
'com.vk.api:sdk:+',
'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:+'
}
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': mainClassName
)
}
}
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': '1.0',
'Main-Class': mainClassName
}
baseName = "vkstatusdrifter"
//buildDir = new File("~/gradleBuild/" + project.name)
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
task service(type: Copy) {
from fatJar
into "$home/bin"
}
processResources {
eachFile { details ->
if (details.name.endsWith('.properties')) {
details.filter(ReplaceTokens, tokens: [
'client.email': clientEmail,
'client.pass': clientPass,
'client.id': clientId,
'client.secret': clientSecret,
])
}
}
}