forked from filestack/filestack-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (132 loc) · 4.03 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
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
mavenCentral()
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
}
}
plugins {
id 'com.github.kt3k.coveralls' version '2.6.3'
id 'java'
id 'maven-publish'
id 'signing'
}
apply plugin: 'checkstyle'
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'java-library'
apply plugin: 'de.fuerstenau.buildconfig'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java'
apply plugin: 'signing'
group = 'org.filestack'
sourceCompatibility = 1.7
version = file(new File('VERSION')).text.trim() // Get version string from VERSION text file
dependencies {
compile 'com.squareup.okhttp3:okhttp:3.11.0'
compile 'com.google.code.gson:gson:2.8.5'
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.19.0'
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'com.squareup.okhttp3:mockwebserver:3.11.0'
testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-RC2'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
}
// Add generated build-config directories to the main source set, so that the
// IDE doesn't complain when the app references BuildConfig classes
sourceSets.main.java {
srcDir new File(buildDir, 'gen/buildconfig')
}
buildConfig {
version = project.version // sets value of VERSION field,
clsName = 'FilestackBuildConfig'
packageName = project.group
}
javadoc {
destinationDir new File("./docs")
options.optionFiles(new File('./config/javadoc/javadoc.txt'))
}
repositories {
jcenter()
}
// Create javadoc artifact jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// Create source artifact jar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.withType(Test) { // Put unit and integration test reports in separate directories
reports.html.destination = file("${reporting.baseDir}/${name}")
}
checkstyle {
toolVersion '8.1'
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
publishing {
publications {
filestackJava(MavenPublication) {
groupId = 'org.filestack'
artifactId = 'filestack-java'
version = file(new File('VERSION')).text.trim()
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'filestack-java'
description = 'filestack-java'
url = 'https://github.com/filestack/filestack-java'
inceptionYear = '2017'
licenses {
license {
name = 'Apache-2.0'
url = 'https://opensource.org/license/apache-2-0'
}
}
developers {
developer {
id = 'filestack'
name = 'Filestack'
email = 'dev@filestack.com'
}
}
scm {
connection = 'scm:git:git:github.com/filestack/filestack-java.git'
developerConnection = 'scm:git:ssh://github.com/filestack/filestack-java.git'
url = 'https://github.com/filestack/filestack-java'
}
}
}
}
repositories {
maven {
url = layout.projectDirectory.dir('releases')
}
}
}
signing {
useGpgCmd()
sign publishing.publications.filestackJava
}