forked from couchbase/couchbase-lite-java-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (79 loc) · 2.78 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
apply plugin: 'java'
apply plugin: 'maven'
version = System.getenv("MAVEN_UPLOAD_VERSION")
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
repositories {
mavenLocal()
maven { url 'http://files.couchbase.com/maven2/' }
mavenCentral()
}
sourceSets {
main {
java.srcDirs = [
'src/main/java',
'vendor/sqlite/src/java'
]
resources {
srcDir 'src/resources'
}
}
}
dependencies {
compile 'com.squareup.okhttp3:okhttp:3.3.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.0'
compile 'com.github.oxo42:stateless4j:2.4.0'
}
task createMavenDirectory(type: Exec) {
ext {
uploadUser = System.getenv("MAVEN_UPLOAD_USERNAME") + ":" + System.getenv("MAVEN_UPLOAD_PASSWORD")
mkcolPath = System.getenv("MAVEN_UPLOAD_REPO_URL") + "com/couchbase/lite/couchbase-lite-java-core/" + version + "/"
}
commandLine "curl", "--user", uploadUser, "-X", "MKCOL", mkcolPath
}
// this hack is only needed for apache mod_dav based Maven repo's like file.couchbase.com. otherwise, skip it
createMavenDirectory.onlyIf { System.getenv("MAVEN_UPLOAD_REPO_URL").contains("files") }
// first create the directory, then do the upload
task uploadArchivesWrapper(dependsOn: createMavenDirectory) << {
uploadArchives.execute()
}
// this will upload, but will not first create a directory (which is needed on some servers)
uploadArchives {
repositories {
mavenDeployer {
repository(url: System.getenv("MAVEN_UPLOAD_REPO_URL")) {
authentication(userName: System.getenv("MAVEN_UPLOAD_USERNAME"), password: System.getenv("MAVEN_UPLOAD_PASSWORD"))
}
pom.version = version
pom.groupId = 'com.couchbase.lite'
pom.artifactId = 'couchbase-lite-java-core'
pom.project {
licenses {
license {
name 'Couchbase Community Edition License Agreement'
url 'http://www.couchbase.com/agreement/community'
distribution 'repo'
}
}
}
}
}
}
task generateJavadocs(type: Javadoc) {
source = sourceSets.main.java.srcDirs
List<File> pathList = new ArrayList<File>();
pathList.add(file('extra/doclet/doclet.jar'))
options.docletpath = pathList
options.doclet = "ExcludeDoclet"
options.showFromPublic()
exclude "org/apache/http/**"
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
}