Skip to content

Commit 12177fd

Browse files
committed
Require Java 8 and update dependencies
This is possible as Android now supports Java 8.
1 parent aeb209d commit 12177fd

3 files changed

Lines changed: 12 additions & 28 deletions

File tree

build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ ext {
22
version = '3.0.0'
33
group = 'com.github.proxer'
44

5-
sourceCompatibility = 1.7
6-
targetCompatibility = 1.7
5+
sourceCompatibility = 1.8
6+
targetCompatibility = 1.8
77
}
88

9-
def jetbrainsAnnotationsVersion = '13.0'
9+
def jetbrainsAnnotationsVersion = '15.0'
1010

1111
def retrofitVersion = '2.3.0'
1212
def okHttpVersion = '3.8.0'
@@ -15,7 +15,7 @@ def moshiVersion = '1.5.0'
1515
def lombokVersion = '1.16.16'
1616

1717
def junitVersion = '4.12'
18-
def assertjVersion = '3.7.0'
18+
def assertjVersion = '3.8.0'
1919

2020
def privateConstructorVersion = '1.2.0'
2121

@@ -38,9 +38,7 @@ ext.deps = [
3838

3939
buildscript {
4040
repositories {
41-
maven {
42-
url "https://plugins.gradle.org/m2/"
43-
}
41+
maven { url "https://plugins.gradle.org/m2/" }
4442
}
4543

4644
dependencies {

library/build.gradle

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@ apply plugin: 'de.fuerstenau.buildconfig'
77
apply plugin: "jacoco"
88
apply plugin: "io.freefair.javadoc-links"
99

10-
tasks.matching { it instanceof JavaCompile && it.name != "compileTestJava" }.all {
11-
sourceCompatibility = rootProject.ext.sourceCompatibility
12-
targetCompatibility = rootProject.ext.targetCompatibility
13-
14-
if (System.getenv('CIRCLECI')) {
15-
options.bootClasspath = "/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar"
16-
}
17-
}
18-
1910
dependencies {
20-
api deps.jetbrainsAnnotations
11+
apiElements deps.jetbrainsAnnotations
2112

2213
api deps.retrofit
2314
api deps.retrofitMoshi
@@ -26,6 +17,8 @@ dependencies {
2617

2718
compileOnly deps.lombok
2819

20+
testImplementation deps.jetbrainsAnnotations
21+
2922
testImplementation deps.junit
3023
testImplementation deps.assertj
3124

@@ -49,6 +42,7 @@ task delombok {
4942
doLast {
5043
ant.taskdef(name: 'delombok', classname: 'lombok.delombok.ant.Tasks$Delombok',
5144
classpath: configurations.compileOnly.asPath)
45+
5246
ant.delombok(encoding: 'UTF-8', from: srcPath, to: delombokPath,
5347
classpath: configurations.compileClasspath.asPath)
5448
}
@@ -94,7 +88,7 @@ publishing {
9488

9589
jacocoTestReport {
9690
reports {
97-
xml.enabled true
98-
html.enabled false
91+
xml.enabled = true
92+
html.enabled = false
9993
}
10094
}

library/src/main/java/me/proxer/library/api/EnumRetrofitConverterFactory.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import retrofit2.Converter;
55
import retrofit2.Retrofit;
66

7-
import java.io.IOException;
87
import java.lang.annotation.Annotation;
98
import java.lang.reflect.Type;
109

@@ -17,16 +16,9 @@ final class EnumRetrofitConverterFactory extends Converter.Factory {
1716
public Converter<?, String> stringConverter(final Type type, final Annotation[] annotations,
1817
final Retrofit retrofit) {
1918
if (((Class<?>) type).isEnum()) {
20-
return new EnumConverter();
19+
return (Converter<Enum<?>, String>) ProxerUtils::getApiEnumName;
2120
}
2221

2322
return null;
2423
}
25-
26-
private static final class EnumConverter implements Converter<Enum<?>, String> {
27-
@Override
28-
public String convert(final Enum<?> e) throws IOException {
29-
return ProxerUtils.getApiEnumName(e);
30-
}
31-
}
3224
}

0 commit comments

Comments
 (0)