forked from embulk/embulk-output-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
185 lines (159 loc) · 5.63 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id "com.jfrog.bintray" version "1.8.4" apply false
id 'java'
id "maven-publish"
id 'checkstyle'
id "org.embulk.embulk-plugins" version "0.4.2" apply false
}
def bintrayReleaseProjects = [
project(":embulk-output-jdbc"),
]
allprojects {
group = 'org.embulk.output.jdbc'
version = "0.9.0"
description = "Inserts or updates records to a table."
}
subprojects {
apply plugin: 'java'
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
apply plugin: "org.embulk.embulk-plugins"
//apply plugin: 'jacoco'
repositories {
mavenCentral()
jcenter()
maven {
url "https://dl.bintray.com/embulk-input-s3/maven"
}
}
configurations {
defaultJdbcDriver
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compileOnly "org.embulk:embulk-core:0.9.23"
compile "org.embulk:embulk-util-timestamp:0.2.1"
testCompile "org.embulk:embulk-core:0.9.23"
testCompile "org.embulk:embulk-test:0.9.23"
testCompile "org.embulk:embulk-standards:0.9.23"
testCompile "org.embulk:embulk-deps-buffer:0.9.23"
testCompile "org.embulk:embulk-deps-config:0.9.23"
}
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
options.encoding = 'UTF-8'
}
test {
}
javadoc {
options {
locale = 'en_US'
encoding = 'UTF-8'
}
}
checkstyle {
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
toolVersion = '6.14.1'
}
checkstyleMain {
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
ignoreFailures = true
}
checkstyleTest {
configFile = file("${project.rootDir}/config/checkstyle/default.xml")
ignoreFailures = true
}
task checkstyle(type: Checkstyle) {
classpath = sourceSets.main.output + sourceSets.test.output
source = sourceSets.main.allJava + sourceSets.test.allJava
}
gem {
authors = [ "Sadayuki Furuhashi" ]
email = [ "frsyuki@gmail.com" ]
summary = "JDBC output plugin for Embulk"
homepage = "https://github.com/embulk/embulk-output-jdbc"
licenses = [ "Apache-2.0" ]
into("default_jdbc_driver") {
from configurations.defaultJdbcDriver
}
}
gemPush {
host = "https://rubygems.org"
}
// add tests/javadoc/source jar tasks as artifacts to be released
task testsJar(type: Jar, dependsOn: classes) {
classifier = 'tests'
from sourceSets.test.output
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives testsJar, sourcesJar, javadocJar
}
publishing {
publications {
embulkPluginMaven(MavenPublication) { // Publish it with "publishEmbulkPluginMavenPublicationTo???Repository".
from components.java // Must be "components.java". The dependency modification works only for it.
artifact testsJar
artifact sourcesJar
artifact javadocJar
}
}
repositories {
// TODO: Configure some public Maven repo(s).
}
}
bintray {
// write at your bintray user name and api key to ~/.gradle/gradle.properties file:
// bintray_user=frsyuki
// bintray_api_key=xxxxxxxxxxx
user = project.hasProperty('bintray_user') ? bintray_user : ''
key = project.hasProperty('bintray_api_key') ? bintray_api_key : ''
publications = [ "embulkPluginMaven" ]
dryRun = !bintrayReleaseProjects.contains(project)
publish = true
pkg {
userOrg = 'embulk-output-jdbc'
repo = 'maven'
name = project.name
desc = 'MySQL, PostgreSQL, Redshift and generic JDBC output plugins for Embulk'
websiteUrl = 'https://github.com/embulk/embulk-output-jdbc'
issueTrackerUrl = 'https://github.com/embulk/embulk-output-jdbc/issues'
vcsUrl = 'https://github.com/embulk/embulk-output-jdbc.git'
licenses = ['Apache-2.0']
labels = ['embulk', 'java']
publicDownloadNumbers = true
version {
name = project.version
}
}
}
tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.SKIPPED
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
}