-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
139 lines (117 loc) · 3.68 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
plugins {
id 'java'
id 'scala'
id 'maven-publish'
id "com.jfrog.bintray" version "1.8.4"
id "com.jfrog.artifactory" version "4.9.7"
}
group = "eu.exante"
version = project.properties["release.version"]
def releaseTag = System.getenv("TRAVIS_TAG")
if (releaseTag != null && !releaseTag.isEmpty()) {
if (releaseTag.startsWith("v")) {
releaseTag = releaseTag.substring(1)
}
version = releaseTag
project.properties.put("release.version", releaseTag)
println("Releasing with version " + version)
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = "javadoc"
from javadoc.destinationDir
}
repositories {
jcenter()
}
//bintray {
// user = System.getenv('BINTRAY_USER')
// key = System.getenv('BINTRAY_KEY')
// publications = ["BintrayPublication"]
// pkg {
// repo = "maven-oss"
// name = "rx-scala-wrapper"
// desc = "Straightforward rxjava wrapper for scala"
// userOrg = "lambdas"
// licenses = ["MIT"]
// vcsUrl = "https://github.com/exante/rx-scala-wrapper"
// githubRepo = "exante/rx-scala-wrapper"
// version {
// name = "NEXT-SNAPSHOT"
// }
// }
//}
publishing {
publications {
BintrayPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId "eu.exante"
artifactId "rx-scala-wrapper"
version version
}
}
}
dependencies {
implementation 'org.scala-lang:scala-library:2.12.8'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
}
def releaseMode = ""
if (!System.getenv("TRAVIS_PULL_REQUEST").equals("false")) {
releaseMode = "pr"
} else if (System.getenv("TRAVIS_PULL_REQUEST").equals("false") && System.getenv("TRAVIS_TAG").equals("")) {
releaseMode = "branch"
} else if (System.getenv("TRAVIS_PULL_REQUEST").equals("false") && !System.getenv("TRAVIS_TAG").equals("")) {
releaseMode = "full"
}
if (!"releaseMode".equals("")) {
def bintrayUser = System.getenv('BINTRAY_USER')
def bintrayKey = System.getenv('BINTRAY_KEY')
if ("branch".equals(releaseMode)) {
println("ReleaseMode: " + releaseMode)
artifactory {
contextUrl = "https://oss.jfrog.org"
publish {
repository {
repoKey = "oss-snapshot-local"
username = bintrayUser
password = bintrayKey
}
defaults {
publications ('BintrayPublication')
publishConfigs("archives")
}
}
}
build.finalizedBy(artifactoryPublish)
}
if ("full".equals(releaseMode)) {
def rver = version
println("ReleaseMode: " + releaseMode + " version " + rver)
bintray {
user = bintrayUser
key = bintrayKey
configurations = ["archives"]
publish = true
publications = ['BintrayPublication']
pkg {
repo = "maven-oss"
name = "rx-scala-wrapper"
desc = "Straightforward rxjava wrapper for scala"
userOrg = "exante"
labels = ["rxjava", "reactivex", "scala"]
licenses = ["MIT"]
vcsUrl = "https://github.com/exante/rx-scala-wrapper"
githubRepo = "exante/rx-scala-wrapper"
version {
name = rver
}
}
}
build.finalizedBy(bintrayUpload)
}
}