-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
159 lines (141 loc) · 5.28 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
plugins {
id "com.jfrog.bintray" version "1.7"
id "com.github.jruby-gradle.base" version "0.1.5"
id "java"
id "checkstyle"
}
import com.github.jrubygradle.JRubyExec
allprojects {
group = 'org.embulk.input.s3'
version = '0.2.12'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
// bintray
bintray {
// write at your bintray user name and api key to ~/.gradle/gradle.properties file:
user = project.hasProperty('bintray_user') ? bintray_user : ''
key = project.hasProperty('bintray_api_key') ? bintray_api_key : ''
publications = ['mavenJava']
publish = true
pkg {
userOrg = 'embulk-input-s3'
repo = 'maven'
name = project.name
desc = 'S3 file input plugin for Embulk'
websiteUrl = 'https://github.com/embulk/embulk-input-s3'
issueTrackerUrl = 'https://github.com/embulk/embulk-input-s3/issues'
vcsUrl = 'https://github.com/embulk/embulk-input-s3.git'
licenses = ['Apache-2.0']
labels = ['embulk', 'java']
publicDownloadNumbers = true
version {
name = project.version
}
}
}
}
subprojects {
apply plugin: 'maven' // install jar files to the local repo: $ gradle install
apply plugin: 'java'
//apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'com.github.jruby-gradle.base'
repositories {
mavenCentral()
jcenter()
}
configurations {
provided
compile.exclude group: 'commons-logging', module: 'commons-logging' // commons-logging api is provided by jcl-over-slf4j
}
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
compile "org.embulk:embulk-core:0.8.18"
provided "org.embulk:embulk-core:0.8.18"
compile "com.amazonaws:aws-java-sdk-s3:1.11.253"
runtime "org.slf4j:jcl-over-slf4j:1.7.12" // aws-sdk uses Apache Commons Logging and Embulk uses slf4j
testCompile "com.amazonaws:aws-java-sdk-sts:1.11.253"
testCompile "junit:junit:4.+"
testCompile "org.mockito:mockito-core:1.+"
testCompile "org.embulk:embulk-standards:0.8.18"
testCompile "org.embulk:embulk-core:0.8.18:tests"
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" //<< "-Xlint:deprecation"
}
}
task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file('classpath').deleteDir() }
from (configurations.runtime - configurations.provided + files(jar.archivePath))
into 'classpath'
}
clean { delete 'classpath' }
if (![project(":embulk-util-aws-credentials")].contains(project)) {
task gem(type: JRubyExec, dependsOn: ['build', 'gemspec', 'classpath']) {
jrubyArgs '-rrubygems/gem_runner', "-eGem::GemRunner.new.run(ARGV)", 'build'
script "${project.projectDir.absolutePath}/build/gemspec"
doLast { ant.move(file: "${project.name}-${project.version}.gem", todir: "${parent.projectDir}/pkg") }
}
}
if (![project(":embulk-input-riak_cs")].contains(project)) {
// publishing
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact testsJar
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().dependencies.dependency.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
}
// 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
}
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
}
}
task gemPush << {
"gem push pkg/embulk-input-s3-${project.version}.gem".execute().waitFor()
"gem push pkg/embulk-input-riak_cs-${project.version}.gem".execute().waitFor()
}