-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
86 lines (64 loc) · 1.93 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
import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.bmuschko:gradle-docker-plugin:3.0.11'
}
}
allprojects {
apply plugin: 'eclipse'
group = 'com.anjlab'
version = '3.2.8'
}
apply plugin: 'java'
apply plugin: 'maven'
def javaVersion = org.gradle.internal.jvm.Jvm.current().javaVersion
sourceCompatibility = javaVersion.java8Compatible ? javaVersion.name : 1.7
targetCompatibility = sourceCompatibility
println "Building for Java ${targetCompatibility}"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
dependencies {
testCompile 'junit:junit:4.8.2'
testCompile 'org.apache.derby:derby:10.9.1.0'
testCompile 'org.postgresql:postgresql:9.+'
compile 'net.sf.opencsv:opencsv:2.3'
compile 'commons-cli:commons-cli:1.2'
compile 'commons-io:commons-io:2.4'
compile 'com.google.code.gson:gson:2.2.2'
compile 'org.apache.commons:commons-lang3:3.1'
compile 'io.dropwizard.metrics:metrics-core:3.1.2'
compile 'org.apache.commons:commons-compress:1.10'
runtime 'commons-codec:commons-codec:1.10'
runtime 'joda-time:joda-time:2.9.9'
}
repositories {
mavenLocal()
mavenCentral()
}
task downloadJdbcDriver {
doLast {
dependencies {
if (!project.hasProperty("jdbcDriver")) {
ext.jdbcDriver = 'org.postgresql:postgresql:9.+'
}
runtime jdbcDriver
}
}
}
classes.dependsOn downloadJdbcDriver
task copyDeps(type: Copy) {
into "$buildDir/libs/lib"
from configurations.runtime
}
task copyShellScripts(type: Copy) {
into "$buildDir/libs"
from 'src/main/shell'
}
jar { dependsOn copyDeps, copyShellScripts }
apply plugin: 'com.bmuschko.docker-remote-api'
task dockerBuildImage(type: DockerBuildImage) {
inputDir = projectDir
tags = [ 'anjlab/csv2db:latest', 'anjlab/csv2db:' + version ]
}