Skip to content

Commit 2835724

Browse files
committed
Dependency updates (gradle etc.).
Improved build process (fixed leaking dependencies). Removed extra dependency on appcompat.
1 parent 62024b3 commit 2835724

File tree

9 files changed

+112
-26
lines changed

9 files changed

+112
-26
lines changed

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22
def versionMajor = 1
33
def versionMinor = 0
4-
def versionPatch = 5
4+
def versionPatch = 6
55

66
ext.versions = [
77
'versionCode' : versionMajor * 10000 + versionMinor * 100 + versionPatch,
@@ -12,7 +12,7 @@ buildscript {
1212
'sourceCompatibility': JavaVersion.VERSION_1_8,
1313
'targetCompatibility': JavaVersion.VERSION_1_8,
1414
'supportLibrary' : '27.1.1',
15-
'buildTools' : '27.0.1'
15+
'buildTools' : '27.0.3'
1616
]
1717

1818
def credentialsFile = new File(System.properties['user.home'], ".bintray/bintray.properties")
@@ -50,9 +50,9 @@ buildscript {
5050
'annotations': "com.android.support:support-annotations:${versions.supportLibrary}",
5151
'appcompat' : "com.android.support:appcompat-v7:${versions.supportLibrary}"
5252
],
53-
androidPlugin: 'com.android.tools.build:gradle:3.0.1',
54-
timber : "com.jakewharton.timber:timber:4.6.1",
55-
rxJava : "io.reactivex.rxjava2:rxjava:2.1.6",
53+
androidPlugin: 'com.android.tools.build:gradle:3.1.2',
54+
timber : "com.jakewharton.timber:timber:4.7.0",
55+
rxJava : "io.reactivex.rxjava2:rxjava:2.1.12",
5656
rxJavaReplay : "com.jakewharton.rx2:replaying-share:2.0.1",
5757
jUnit : "junit:junit:4.12",
5858
mockito : "org.mockito:mockito-core:2.8.9",
@@ -65,8 +65,8 @@ buildscript {
6565
jcenter()
6666
}
6767
dependencies {
68-
classpath 'com.android.tools.build:gradle:3.0.1'
69-
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
68+
classpath 'com.android.tools.build:gradle:3.1.2'
69+
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
7070
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
7171
//noinspection GradleDependency
7272
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'

core/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ afterEvaluate {
2828
})
2929
}
3030
dependencies {
31-
api deps.support.annotations
32-
api deps.support.appcompat
31+
implementation deps.support.annotations
3332

34-
api deps.timber
33+
implementation deps.timber
3534

36-
implementation deps.rxJava
37-
implementation deps.rxJava
35+
api deps.rxJava
3836
api deps.rxJavaReplay
3937

4038
testImplementation deps.jUnit

core/src/main/java/eu/darken/rxshell/cmd/RxCmdShell.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package eu.darken.rxshell.cmd;
22

3-
import android.support.v4.util.Pair;
4-
53
import java.io.IOException;
64
import java.util.ArrayList;
75
import java.util.Collection;
@@ -11,6 +9,7 @@
119
import java.util.Map;
1210

1311
import eu.darken.rxshell.extra.HasEnvironmentVariables;
12+
import eu.darken.rxshell.extra.Pair;
1413
import eu.darken.rxshell.extra.RXSDebug;
1514
import eu.darken.rxshell.process.DefaultProcessFactory;
1615
import eu.darken.rxshell.process.ProcessFactory;

core/src/main/java/eu/darken/rxshell/extra/HasEnvironmentVariables.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package eu.darken.rxshell.extra;
22

3-
4-
import android.support.v4.util.Pair;
5-
63
import java.util.Collection;
74

85
public interface HasEnvironmentVariables {
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Copyright (C) 2009 The Android Open Source Project
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+
package eu.darken.rxshell.extra;
18+
19+
import android.support.annotation.NonNull;
20+
import android.support.annotation.Nullable;
21+
22+
/**
23+
* Container to ease passing around a tuple of two objects. This object provides a sensible
24+
* implementation of equals(), returning true if equals() is true on each of the contained
25+
* objects.
26+
*/
27+
public class Pair<F, S> {
28+
public final @Nullable F first;
29+
public final @Nullable S second;
30+
31+
/**
32+
* Constructor for a Pair.
33+
*
34+
* @param first the first object in the Pair
35+
* @param second the second object in the pair
36+
*/
37+
public Pair(@Nullable F first, @Nullable S second) {
38+
this.first = first;
39+
this.second = second;
40+
}
41+
42+
/**
43+
* Checks the two objects for equality by delegating to their respective
44+
* {@link Object#equals(Object)} methods.
45+
*
46+
* @param o the {@link Pair} to which this one is to be checked for equality
47+
* @return true if the underlying objects of the Pair are both considered
48+
* equal
49+
*/
50+
@Override
51+
public boolean equals(Object o) {
52+
if (!(o instanceof Pair)) return false;
53+
54+
Pair<?, ?> p = (Pair<?, ?>) o;
55+
return objectsEqual(p.first, first) && objectsEqual(p.second, second);
56+
}
57+
58+
private static boolean objectsEqual(Object a, Object b) {
59+
return a == b || (a != null && a.equals(b));
60+
}
61+
62+
/**
63+
* Compute a hash code using the hash codes of the underlying objects
64+
*
65+
* @return a hashcode of the Pair
66+
*/
67+
@Override
68+
public int hashCode() {
69+
return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
70+
}
71+
72+
@Override
73+
public String toString() {
74+
return "Pair{" + String.valueOf(first) + " " + String.valueOf(second) + "}";
75+
}
76+
77+
/**
78+
* Convenience method for creating an appropriately typed pair.
79+
*
80+
* @param a the first object in the Pair
81+
* @param b the second object in the pair
82+
* @return a Pair that is templatized with the types of a and b
83+
*/
84+
@NonNull
85+
public static <A, B> Pair<A, B> create(@Nullable A a, @Nullable B b) {
86+
return new Pair<>(a, b);
87+
}
88+
}

example/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ dependencies {
3333
implementation project(':core')
3434
implementation project(':root')
3535

36-
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
36+
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
3737
implementation deps.support.appcompat
3838

3939
implementation 'com.jakewharton:butterknife:8.8.1'
4040
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
4141

42+
implementation 'com.jakewharton.timber:timber:4.7.0'
43+
44+
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
45+
4246
testImplementation deps.jUnit
43-
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
4447
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Nov 06 20:03:29 CET 2017
1+
#Fri Apr 27 02:03:03 CEST 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

publish-to-bintray.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
apply plugin: 'com.github.dcendents.android-maven'
2+
23
group = bintrayConfig.publishedGroupId
4+
version = bintrayConfig.libraryVersion
5+
36
install {
47
repositories.mavenInstaller {
58
pom.project {
@@ -50,7 +53,6 @@ artifacts {
5053
archives javadocJar
5154
archives sourcesJar
5255
}
53-
version = bintrayConfig.libraryVersion
5456

5557
// https://github.com/bintray/gradle-bintray-plugin#buildgradle
5658
bintray {

root/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ android {
2626
dependencies {
2727
implementation project(':core')
2828

29-
api deps.support.annotations
29+
implementation deps.support.annotations
30+
implementation deps.timber
3031

31-
api deps.timber
32-
33-
implementation deps.rxJava
32+
api deps.rxJava
3433

3534
testImplementation deps.jUnit
3635
testImplementation deps.mockito

0 commit comments

Comments
 (0)