-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
190 lines (147 loc) · 5.45 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
plugins {
// id "net.ltgt.apt" version "0.10"
id "net.ltgt.apt-idea" version "0.13"
id "application"
id "groovy"
// generates coverage data
// see homepage: http://eclemma.org/jacoco/
// see plugin: https://docs.gradle.org/current/userguide/jacoco_plugin.html
id "jacoco"
// builds a dashboard for all reports
// see plugin: https://docs.gradle.org/current/userguide/buildDashboard_plugin.html
id 'build-dashboard'
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'pl.allegro.tech.build.axion-release' version '1.9.0'
id "nebula.ospackage" version "4.8.0"
}
group = 'com.github.davidecavestro.jdbsee'
project.version = scmVersion.version
mainClassName = 'com.github.davidecavestro.jdbsee.jdbcli.CliApplication'
description = 'A minimalistic CLI for jdbc operations'
repositories {
mavenCentral()
maven {url = 'https://repo.adobe.com/nexus/content/repositories/public'}
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
compileGroovy {
groovyOptions.optimizationOptions.indy = true
}
configurations{
drivers
}
dependencies {
apt 'com.google.dagger:dagger-compiler:2.14.1'
compile 'com.google.dagger:dagger:2.14.1'
compile('com.google.guava:guava:24.0-jre')
compile 'org.codehaus.groovy:groovy-all:2.4.13:indy'
compile 'org.apache.ivy:ivy:2.4.0'
compile 'org.reflections:reflections:0.9.11'
compile 'info.picocli:picocli:2.2.1'
compile 'de.vandermeer:asciitable:0.3.2'
compile 'de.vandermeer:skb-interfaces:0.0.2'
compile 'org.jdbi:jdbi3-core:3.0.1'
compile 'org.jdbi:jdbi3-sqlobject:3.0.1'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.9.4'
compile 'org.slf4j:jul-to-slf4j:1.7.25'
runtime 'org.slf4j:slf4j-api:1.7.25'
compile "org.slf4j:log4j-over-slf4j:1.7.25"
runtime 'ch.qos.logback:logback-classic:1.2.3'
compile "org.flywaydb:flyway-core:5.0.7"
runtime 'org.hsqldb:hsqldb:2.4.0'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:3.1.3'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi:3.1.3'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:3.1.3'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven:3.1.3'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:3.1.3'
compile 'org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-archive:3.1.3'
compile 'org.jline:jline:3.6.2'
testCompile "org.spockframework:spock-core:1.1-groovy-2.4"
// optional dependencies for using Spock
testCompile "org.hamcrest:hamcrest-core:1.3" // only necessary if Hamcrest matchers are used
testRuntime "net.bytebuddy:byte-buddy:1.6.5" // allows mocking of classes (in addition to interfaces)
testRuntime "org.objenesis:objenesis:2.5.1" // allows mocking of classes without default constructor (together with CGLIB)
testCompile 'junit:junit:4.12'
testCompile 'commons-io:commons-io:2.6'
//drivers distribution
drivers 'org.hsqldb:hsqldb:2.4.0'
drivers 'com.h2database:h2:1.4.196'
drivers 'mysql:mysql-connector-java:8.0.8-dmr'
drivers 'org.postgresql:postgresql:42.2.1'
drivers 'com.microsoft.sqlserver:mssql-jdbc:6.3.6.jre8-preview'
drivers 'net.sf.jt400:jt400:9.4'
drivers 'oracle:ojdbc:1.4'
}
configurations.all {
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "log4j", module: "log4j"
}
distributions {
full {
contents {
with project.distributions.main.getContents()
into ('dropins') {
from {
configurations.drivers
}
}
}
}
}
//needed to allow hsql use absolute paths
applicationDefaultJvmArgs = ["-Dtextdb.allow_full_path=true"]
def generatedResources = "$buildDir/generated-resources/main"
sourceSets {
main {
//register an output folder on the main SourceSet:
output.dir(generatedResources, builtBy: 'generateVersionTxt')
//it is now a part of the 'main' classpath and will be a part of the jar
}
}
//a task that generates the resources:
task generateVersionTxt {
description 'Creates a version.txt file with build info that is added to the root of the jar'
doLast {
new File(generatedResources).mkdirs()
def generated = new File(generatedResources, "version.txt")
generated.text = """
Version: $rootProject.version
Buildtime: ${new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())}
Application-name: $rootProject.name
"""
// Application-name: $rootProject.name $project.name
}
}
CreateStartScripts startScripts = project.startScripts
startScripts.with {
doLast {
unixScript.text = unixScript.text.replaceFirst('DEFAULT_JVM_OPTS=""',
'DEFAULT_JVM_OPTS="-D\\$\\{APP_NAME}.home=\\$\\{APP_HOME}"')
windowsScript.text = windowsScript.text.replaceFirst('(?<=DEFAULT_JVM_OPTS=)(.*)(?=\r\n)',
'$1 "-Dtcproxy.config.url=file:%~dp0../conf/proxy.properties"')
}
}
//FIXME set files owner
ospackage {
group = "Distribution"
description = "Jdbsee CLI is a command line tool for databases operations over JDBC"
packageName = 'jdbsee'
release = 1
into '/usr/share/jdbsee'
with project.distributions.main.getContents()
link('/usr/bin/jdbsee', '/usr/share/jdbsee/bin/jdbsee')
}
buildRpm {
arch = 'NOARCH'
os = 'LINUX'
type = 'BINARY'
}
tasks.buildDeb.dependsOn 'assembleDist'
tasks.buildRpm.dependsOn 'assembleDist'
tasks.build.dependsOn 'buildDeb', 'buildRpm'
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}