-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (82 loc) · 2.73 KB
/
build.gradle
File metadata and controls
99 lines (82 loc) · 2.73 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
apply plugin: 'java'
apply plugin: 'application'
repositories {
jcenter()
}
mainClassName = 'io.tenmax.cqlkit.CQL2CSV'
project.version = '0.3.3'
def impVersion = project.version
if (project.hasProperty('projVersion')) {
project.version = project.projVersion
if (project.projVersion == 'latest') {
impVersion += '-SNAPSHOT'
}
}
jar {
manifest {
attributes 'Implementation-Title': 'cqlkit',
'Implementation-Version': impVersion
}
}
task createAllStartScripts() {
def scripts = ['cql2csv' : 'io.tenmax.cqlkit.CQL2CSV',
'cql2json': 'io.tenmax.cqlkit.CQL2JSON',
'cql2cql' : 'io.tenmax.cqlkit.CQL2CQL'
]
scripts.each() { scriptName, className ->
def t = tasks.create(name: scriptName + 'StartScript', type: CreateStartScripts) {
mainClassName = className
applicationName = scriptName
outputDir = new File(project.buildDir, 'scripts')
classpath = jar.outputs.files + project.configurations.runtimeClasspath
}
applicationDistribution.into("bin") {
duplicatesStrategy = 'exclude'
from(t)
fileMode = 0755
}
}
}
distZip {
archiveFileName = archiveBaseName.get() + '.' + archiveExtension.get()
def noVersionFile = archiveFile.get().asFile
doLast {
archiveFileName = archiveBaseName.get() + '-' + archiveVersion.get() + '.' + archiveExtension.get()
def versionFile = archiveFile.get().asFile
noVersionFile.renameTo(versionFile)
}
}
distTar {
archiveFileName = archiveBaseName.get() + '.' + archiveExtension.get()
def noVersionFile = archiveFile.get().asFile
doLast {
archiveFileName = archiveBaseName.get() + '-' + archiveVersion.get() + '.' + archiveExtension.get()
def versionFile = archiveFile.get().asFile
noVersionFile.renameTo(versionFile)
}
}
task fpm(type: Exec, dependsOn: distTar, group: 'distribution') {
commandLine './build-rpm-deb.sh', project.version
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
dependencies {
// Cassandra Driver
implementation 'com.datastax.cassandra:cassandra-driver-core:3.4.0'
// Json
implementation 'com.google.code.gson:gson:2.8.6'
// CSV
implementation 'org.apache.commons:commons-csv:1.1'
// CLI
implementation 'commons-cli:commons-cli:1.3.1'
// Log
implementation 'org.slf4j:slf4j-api:1.7.12'
implementation 'org.slf4j:slf4j-nop:1.7.12'
// Configure
implementation 'commons-configuration:commons-configuration:1.10'
///////////////////////////////////////////////
testImplementation 'junit:junit:4.12'
}