Skip to content

Commit e26db0e

Browse files
author
Piotr Wittchen
committed
adding travis CI config and preparing to release
1 parent bb4ce10 commit e26db0e

File tree

5 files changed

+158
-18
lines changed

5 files changed

+158
-18
lines changed

.travis.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: android
2+
3+
android:
4+
components:
5+
- build-tools-22.0.1
6+
- android-22
7+
- extra-android-m2repository
8+
- extra-google-m2repository
9+
10+
install:
11+
- true
12+
13+
script:
14+
- ./gradlew clean build

gradle.properties

+14-18
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# Project-wide Gradle settings.
2-
3-
# IDE (e.g. Android Studio) users:
4-
# Gradle settings configured through the IDE *will override*
5-
# any settings specified in this file.
6-
7-
# For more details on how to configure your build environment visit
8-
# http://www.gradle.org/docs/current/userguide/build_environment.html
9-
10-
# Specifies the JVM arguments used for the daemon process.
11-
# The setting is particularly useful for tweaking memory settings.
12-
# Default value: -Xmx10248m -XX:MaxPermSize=256m
13-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14-
15-
# When configured, Gradle will run in incubating parallel mode.
16-
# This option should only be used with decoupled projects. More details, visit
17-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18-
# org.gradle.parallel=true
1+
VERSION_NAME=0.0.1
2+
VERSION_CODE=1
3+
GROUP=com.github.pwittchen
4+
5+
POM_DESCRIPTION=Android library listening network connection state and change of the WiFi signal strength with RxJava Observables
6+
POM_URL=https://github.com/pwittchen/ReactiveNetwork
7+
POM_SCM_URL=https://github.com/pwittchen/ReactiveNetwork
8+
POM_SCM_CONNECTION=scm:[email protected]:pwittchen/ReactiveNetwork.git
9+
POM_SCM_DEV_CONNECTION=scm:[email protected]:pwittchen/ReactiveNetwork.git
10+
POM_LICENCE_NAME=The Apache Software License, Version 2.0
11+
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
12+
POM_LICENCE_DIST=repo
13+
POM_DEVELOPER_ID=pwittchen
14+
POM_DEVELOPER_NAME=Piotr Wittchen

library/build.gradle

+12
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ android {
1111
versionName "1.0"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
}
14+
1415
buildTypes {
1516
release {
1617
minifyEnabled false
1718
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1819
}
1920
}
21+
22+
packagingOptions {
23+
exclude 'LICENSE.txt'
24+
exclude 'META-INF/LICENSE.txt'
25+
}
2026
}
2127

2228
dependencies {
@@ -31,3 +37,9 @@ dependencies {
3137
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0' // required by Mockito
3238
androidTestCompile 'org.mockito:mockito-core:1.9.5'
3339
}
40+
41+
task wrapper(type: Wrapper) {
42+
gradleVersion = '2.2.1'
43+
}
44+
45+
apply from: '../maven_push.gradle'

library/gradle.properties

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
POM_NAME=reactivenetwork
2+
POM_ARTIFACT_ID=reactivenetwork
3+
POM_PACKAGING=aar

maven_push.gradle

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Copyright 2013 Chris Banes
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
apply plugin: 'maven'
18+
apply plugin: 'signing'
19+
20+
def isReleaseBuild() {
21+
return VERSION_NAME.contains("SNAPSHOT") == false
22+
}
23+
24+
def getReleaseRepositoryUrl() {
25+
return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL
26+
: "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
27+
}
28+
29+
def getSnapshotRepositoryUrl() {
30+
return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL
31+
: "https://oss.sonatype.org/content/repositories/snapshots/"
32+
}
33+
34+
def getRepositoryUsername() {
35+
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
36+
}
37+
38+
def getRepositoryPassword() {
39+
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
40+
}
41+
42+
afterEvaluate { project ->
43+
uploadArchives {
44+
repositories {
45+
mavenDeployer {
46+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
47+
48+
pom.groupId = GROUP
49+
pom.artifactId = POM_ARTIFACT_ID
50+
pom.version = VERSION_NAME
51+
52+
repository(url: getReleaseRepositoryUrl()) {
53+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
54+
}
55+
snapshotRepository(url: getSnapshotRepositoryUrl()) {
56+
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
57+
}
58+
59+
pom.project {
60+
name POM_NAME
61+
packaging POM_PACKAGING
62+
description POM_DESCRIPTION
63+
url POM_URL
64+
65+
scm {
66+
url POM_SCM_URL
67+
connection POM_SCM_CONNECTION
68+
developerConnection POM_SCM_DEV_CONNECTION
69+
}
70+
71+
licenses {
72+
license {
73+
name POM_LICENCE_NAME
74+
url POM_LICENCE_URL
75+
distribution POM_LICENCE_DIST
76+
}
77+
}
78+
79+
developers {
80+
developer {
81+
id POM_DEVELOPER_ID
82+
name POM_DEVELOPER_NAME
83+
}
84+
}
85+
}
86+
}
87+
}
88+
}
89+
90+
signing {
91+
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
92+
sign configurations.archives
93+
}
94+
95+
task androidJavadocs(type: Javadoc) {
96+
source = android.sourceSets.main.java.srcDirs
97+
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
98+
failOnError = false
99+
}
100+
101+
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
102+
classifier = 'javadoc'
103+
from androidJavadocs.destinationDir
104+
}
105+
106+
task androidSourcesJar(type: Jar) {
107+
classifier = 'sources'
108+
from android.sourceSets.main.java.sourceFiles
109+
}
110+
111+
artifacts {
112+
archives androidSourcesJar
113+
archives androidJavadocsJar
114+
}
115+
}

0 commit comments

Comments
 (0)