forked from deleet/couchbase-lite-java-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
71 lines (56 loc) · 2.52 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
sourceCompatibility = 1.6
targetCompatibility = 1.6
repositories {
maven { url 'http://files.couchbase.com/maven2/' }
mavenCentral()
mavenLocal()
}
def buildJavascriptWithArtifacts = System.getProperty("buildJavascriptWithArtifacts")
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
// as discovered by trial and error, the build will fail if "compile" is
// used: Error: duplicate files during packaging of APK. I guess it is
// being implicitly included by being in the libs folder, and then "double included"
// because of a "compile" directive to explicitly include the jar.
testCompile fileTree(dir: 'libs', include: 'td_collator_so.jar')
compile 'org.mozilla:rhino:1.7R3'
compile buildJavascriptWithArtifacts == null ?
project(':libraries:couchbase-lite-java-core') :
'com.couchbase.lite:couchbase-lite-java-core:' + System.getenv("MAVEN_UPLOAD_VERSION")
}
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-javascript/" + System.getenv("MAVEN_UPLOAD_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") }
task uploadArchivesWrapper(dependsOn: createMavenDirectory) << {
uploadArchives.execute()
}
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 = System.getenv("MAVEN_UPLOAD_VERSION") != null ? System.getenv("MAVEN_UPLOAD_VERSION") : ''
pom.groupId = 'com.couchbase.lite'
pom.artifactId = 'couchbase-lite-java-javascript'
pom.project {
licenses {
license {
name 'Couchbase Community Edition License Agreement'
url 'http://www.couchbase.com/agreement/community'
distribution 'repo'
}
}
}
}
}
}