File: build.gradle

package info (click to toggle)
rx-java 3.0.7%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 20,744 kB
  • sloc: java: 310,776; xml: 235; makefile: 8
file content (196 lines) | stat: -rw-r--r-- 5,467 bytes parent folder | download
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
buildscript {

  // Dependency versions
  // ---------------------------------------
  
  ext.reactiveStreamsVersion = "1.0.3"
  ext.junitVersion = "4.13"
  ext.testNgVersion = "7.3.0"
  ext.mockitoVersion = "3.5.13"
  ext.jmhLibVersion = "1.21"
  ext.jmhGradleVersion = "0.5.2"
  ext.guavaVersion = "29.0-jre"
  ext.jacocoVersion = "0.8.4"
  ext.animalSnifferVersion = "1.5.1"
  ext.licenseVersion = "0.15.0"
  ext.bintrayVersion = "1.8.5"
  ext.jfrogExtractorVersion = "4.17.2"
  ext.bndVersion = "5.1.2"
  ext.checkstyleVersion = "8.26"

  // --------------------------------------

  repositories { 
    jcenter()
    mavenCentral()
    maven {
        url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:$bndVersion"
  }
}

group = "io.reactivex.rxjava3"
ext.githubProjectName = "rxjava"

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);
}

description = "RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM."

apply plugin: "java-library"
apply plugin: "maven"

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
  mavenCentral()
}

dependencies {

    api "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"

}

tasks.withType(JavaCompile) {
    options.compilerArgs << "-parameters";
}

artifacts {
    archives jar
}

apply plugin: 'biz.aQute.bnd.builder'

jar {
    bnd ('Bundle-Name': 'rxjava',
            'Bundle-Vendor': 'RxJava Contributors',
            'Bundle-Description': 'Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.',
            'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
            'Bundle-DocURL': 'https://github.com/ReactiveX/RxJava',
            'Eclipse-ExtensibleAPI': 'true',
            'Automatic-Module-Name': 'io.reactivex.rxjava3',
            'Export-Package': '!io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*'
    )
}

apply plugin: "maven-publish"

install {
    repositories.mavenInstaller.pom.project {
        name "RxJava"
        description "Reactive Extensions for Java"
        url "https://github.com/ReactiveX/RxJava"
        licenses {
            license {
                name "The Apache Software License, Version 2.0"
                url "http://www.apache.org/licenses/LICENSE-2.0.txt"
                distribution "repo"
            }
        }
        developers {
            developer {
                id "akarnokd"
                name "David Karnok"
                email "akarnokd@gmail.com"
            }
        }
        scm {
            connection "scm:git:git@github.com:ReactiveX/RxJava.git"
            url "scm:git:git@github.com:ReactiveX/RxJava.git"
            developerConnection "scm:git:git@github.com:ReactiveX/RxJava.git"
        }
        issueManagement {
            system "github"
            url "https://github.com/ReactiveX/RxJava/issues"
        }
    }
}

// Reactive-Streams as compile dependency
publishing.publications.all {
  pom.withXml {
    asNode().dependencies."*".findAll() {
      it.scope.text() == "runtime" && project.configurations.compile.allDependencies.find { dep ->
        dep.name == it.artifactId.text()
      }
    }.each { it.scope*.value = "compile"}
  }
}

if (rootProject.hasProperty("releaseMode")) {

  if ("branch".equals(rootProject.releaseMode)) {
    // From https://github.com/ReactiveX/RxAndroid/blob/2.x/rxandroid/build.gradle#L94
  
    println("ReleaseMode: " + rootProject.releaseMode);
    artifactory {
        contextUrl = "https://oss.jfrog.org"
    
        publish {
            repository {
                repoKey = "oss-snapshot-local"
    
                username = rootProject.bintrayUser
                password = rootProject.bintrayKey
            }
    
            defaults {
                publishConfigs("archives")
            }
        }
    }
    
    build.finalizedBy(artifactoryPublish)
  }

   if ("full".equals(rootProject.releaseMode)) {
      // based on https://github.com/bintray/gradle-bintray-plugin
      def rver = version;

      println("ReleaseMode: " + rootProject.releaseMode + " version " + rver);

      bintray {
         user = rootProject.bintrayUser
         key = rootProject.bintrayKey
         configurations = ["archives"]
         publish = true
         pkg {
           repo = "RxJava"
           name = "RxJava"
           userOrg = "reactivex"
           labels = ["rxjava", "reactivex"]
           licenses = ["Apache-2.0"]
           vcsUrl = "https://github.com/ReactiveX/RxJava.git"
           version {
             name = rver
             gpg {
                sign = true
             }
             mavenCentralSync {
               sync = true 
               user = rootProject.sonatypeUsername
               password = rootProject.sonatypePassword
               close = "1"
             }
           }
         }
      }
      
      build.finalizedBy(bintrayUpload)
   }
}