Skip to content

Commit 82b327a

Browse files
committed
Improve gradle config and use jsr305 as compileOnly instead of jetbrains
1 parent df7d143 commit 82b327a

111 files changed

Lines changed: 816 additions & 787 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ As this project uses [Lombok](https://projectlombok.org/), you will also need th
277277
## Dependencies
278278

279279
This library highly relies on [Retrofit](https://github.com/square/retrofit) and [OkHttp](http://square.github.io/okhttp/) by [Square](https://github.com/square) for the network communication.<br>
280-
Moreover it uses [Moshi](https://github.com/square/moshi) for response parsing and the [Jetbrains Annotations](https://www.jetbrains.com/help/idea/2017.1/nullable-and-notnull-annotations.html) to improve code style and provide IDE support.
280+
Moreover it uses [Moshi](https://github.com/square/moshi) for response parsing.
281281

282282
## Contributions and contributors
283283

build.gradle

Lines changed: 37 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,57 @@
1-
ext {
2-
version = '3.0.3'
3-
group = 'com.github.proxer'
4-
5-
sourceCompatibility = 1.8
6-
targetCompatibility = 1.8
7-
}
8-
9-
def jetbrainsAnnotationsVersion = '15.0'
10-
11-
def retrofitVersion = '2.3.0'
12-
def okHttpVersion = '3.8.1'
13-
def moshiVersion = '1.5.0'
14-
15-
def lombokVersion = '1.16.18'
16-
17-
def junitVersion = '4.12'
18-
def assertjVersion = '3.8.0'
19-
20-
def privateConstructorVersion = '1.2.0'
21-
22-
ext.deps = [
23-
jetbrainsAnnotations: "org.jetbrains:annotations:$jetbrainsAnnotationsVersion",
24-
25-
retrofit : "com.squareup.retrofit2:retrofit:$retrofitVersion",
26-
retrofitMoshi : "com.squareup.retrofit2:converter-moshi:$retrofitVersion",
27-
okHttp : "com.squareup.okhttp3:okhttp:$okHttpVersion",
28-
moshi : "com.squareup.moshi:moshi:$moshiVersion",
29-
30-
lombok : "org.projectlombok:lombok:$lombokVersion",
31-
32-
junit : "junit:junit:$junitVersion",
33-
assertj : "org.assertj:assertj-core:$assertjVersion",
34-
35-
mockwebserver : "com.squareup.okhttp3:mockwebserver:$okHttpVersion",
36-
privateConstructor : "com.pushtorefresh.java-private-constructor-checker:checker:$privateConstructorVersion"
37-
]
38-
391
buildscript {
2+
ext {
3+
version = '3.0.3'
4+
group = 'com.github.proxer'
5+
6+
buildConfigPluginVersion = '1.1.8'
7+
freefairPluginsVersion = '1.0.0'
8+
9+
lombokVersion = '1.16.18'
10+
jsr305Version = '3.0.2'
11+
12+
retrofitVersion = '2.3.0'
13+
okHttpVersion = '3.8.1'
14+
moshiVersion = '1.5.0'
15+
16+
junitVersion = '4.12'
17+
assertjVersion = '3.8.0'
18+
privateConstructorVersion = '1.2.0'
19+
20+
deps = [
21+
lombok : "org.projectlombok:lombok:$lombokVersion",
22+
jsr305 : "com.google.code.findbugs:jsr305:$jsr305Version",
23+
24+
retrofit : "com.squareup.retrofit2:retrofit:$retrofitVersion",
25+
retrofitMoshi : "com.squareup.retrofit2:converter-moshi:$retrofitVersion",
26+
okHttp : "com.squareup.okhttp3:okhttp:$okHttpVersion",
27+
moshi : "com.squareup.moshi:moshi:$moshiVersion",
28+
29+
junit : "junit:junit:$junitVersion",
30+
assertj : "org.assertj:assertj-core:$assertjVersion",
31+
mockwebserver : "com.squareup.okhttp3:mockwebserver:$okHttpVersion",
32+
privateConstructor: "com.pushtorefresh.java-private-constructor-checker:checker:$privateConstructorVersion"
33+
]
34+
}
35+
4036
repositories {
4137
maven { url 'https://plugins.gradle.org/m2/' }
4238
}
4339

4440
dependencies {
45-
classpath 'gradle.plugin.de.fuerstenau:BuildConfigPlugin:1.1.8'
46-
classpath 'io.freefair.gradle:gradle-plugins:0.10.1'
41+
classpath "gradle.plugin.de.fuerstenau:BuildConfigPlugin:$buildConfigPluginVersion"
42+
classpath "io.freefair.gradle:gradle-plugins:$freefairPluginsVersion"
4743
}
4844
}
4945

5046
allprojects {
5147
version = rootProject.ext.version
5248
group = rootProject.ext.group
5349

54-
tasks.withType(JavaCompile) {
55-
options.encoding = 'UTF-8'
56-
}
57-
5850
repositories {
5951
jcenter()
6052
}
6153
}
6254

6355
task wrapper(type: Wrapper) {
64-
gradleVersion = '4.1-milestone-1'
56+
gradleVersion = '4.1-rc-1'
6557
}

gradle/wrapper/gradle-wrapper.jar

14 Bytes
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Sun Jul 02 22:48:39 CEST 2017
1+
#Thu Jul 27 02:05:24 CEST 2017
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-milestone-1-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-rc-1-bin.zip

library/build.gradle

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,41 @@
11
apply plugin: 'java-library'
22
apply plugin: 'maven-publish'
3-
apply plugin: 'de.fuerstenau.buildconfig'
43

5-
apply plugin: "jacoco"
6-
apply plugin: "io.freefair.javadoc-links"
4+
apply plugin: 'jacoco'
5+
apply plugin: 'de.fuerstenau.buildconfig'
6+
apply plugin: 'io.freefair.javadoc-links'
77

88
apply plugin: 'idea'
99

10+
sourceCompatibility = JavaVersion.VERSION_1_8
11+
targetCompatibility = JavaVersion.VERSION_1_8
12+
1013
dependencies {
11-
api deps.jetbrainsAnnotations
14+
compileOnly deps.lombok
15+
compileOnly deps.jsr305
1216

1317
api deps.retrofit
1418
api deps.retrofitMoshi
1519
api deps.okHttp
1620
api deps.moshi
1721

18-
compileOnly deps.lombok
19-
20-
testImplementation deps.jetbrainsAnnotations
22+
testCompileOnly deps.lombok
23+
testCompileOnly deps.jsr305
2124

2225
testImplementation deps.junit
2326
testImplementation deps.assertj
24-
2527
testImplementation deps.mockwebserver
2628
testImplementation deps.privateConstructor
27-
28-
testCompileOnly deps.lombok
2929
}
3030

31-
task delombok {
32-
dependsOn compileJava
33-
34-
def srcPath = 'src/main/java'
35-
def delombokPath = 'build/delombok'
36-
37-
inputs.files file(srcPath)
38-
outputs.dir file(delombokPath)
39-
40-
ext.outputDir = delombokPath
31+
task delombok(dependsOn: compileJava) {
32+
ext.outputDir = 'build/delombok'
4133

4234
doLast {
4335
ant.taskdef(name: 'delombok', classname: 'lombok.delombok.ant.Tasks$Delombok',
4436
classpath: configurations.compileOnly.asPath)
4537

46-
ant.delombok(encoding: 'UTF-8', from: srcPath, to: delombokPath,
38+
ant.delombok(encoding: 'UTF-8', from: 'src/main/java', to: ext.outputDir,
4739
classpath: configurations.compileClasspath.asPath)
4840
}
4941
}
@@ -62,7 +54,14 @@ javadoc {
6254
failOnError = false
6355
}
6456

65-
task sourceJar(type: Jar, dependsOn: classes) {
57+
jacocoTestReport {
58+
reports {
59+
xml.enabled = true
60+
html.enabled = false
61+
}
62+
}
63+
64+
task sourceJar(type: Jar, dependsOn: delombok) {
6665
from delombok.outputDir
6766
}
6867

@@ -85,10 +84,3 @@ publishing {
8584
}
8685
}
8786
}
88-
89-
jacocoTestReport {
90-
reports {
91-
xml.enabled = true
92-
html.enabled = false
93-
}
94-
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import lombok.AccessLevel;
66
import lombok.Getter;
77
import me.proxer.library.entitiy.messenger.Conference;
8-
import org.jetbrains.annotations.NotNull;
98

9+
import javax.annotation.Nonnull;
1010
import java.util.Date;
1111

1212
/**
@@ -57,7 +57,7 @@ static class IntermediateConference {
5757
@Json(name = "image")
5858
String image;
5959

60-
@NotNull
60+
@Nonnull
6161
String getImage() {
6262
final int delimiterIndex = image.indexOf(IMAGE_DELIMITER);
6363

@@ -68,7 +68,7 @@ String getImage() {
6868
}
6969
}
7070

71-
@NotNull
71+
@Nonnull
7272
String getImageType() {
7373
final int delimiterIndex = image.indexOf(IMAGE_DELIMITER);
7474

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package me.proxer.library.api;
22

3-
import org.jetbrains.annotations.Nullable;
3+
import javax.annotation.Nullable;
44

55
/**
66
* @author Ruben Gees

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import me.proxer.library.enums.Genre;
66
import me.proxer.library.enums.MediaLanguage;
77
import me.proxer.library.util.ProxerUtils;
8-
import org.jetbrains.annotations.NotNull;
98

9+
import javax.annotation.Nonnull;
1010
import java.io.IOException;
1111
import java.lang.annotation.Annotation;
1212
import java.lang.reflect.Field;
@@ -48,7 +48,7 @@ private static class DelimitedEnumSetAdapter<T extends Enum<T>> extends JsonAdap
4848
private final Class<T> enumType;
4949
private final String delimiter;
5050

51-
DelimitedEnumSetAdapter(@NotNull final Class<T> enumType, @NotNull final String delimiter) {
51+
DelimitedEnumSetAdapter(@Nonnull final Class<T> enumType, @Nonnull final String delimiter) {
5252
this.enumType = enumType;
5353
this.delimiter = delimiter;
5454
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package me.proxer.library.api;
22

3-
import org.jetbrains.annotations.NotNull;
3+
import javax.annotation.Nonnull;
44

55
/**
66
* Interface for all endpoints.
@@ -13,6 +13,6 @@ public interface Endpoint<T> {
1313
/**
1414
* Builds the call for this endpoint.
1515
*/
16-
@NotNull
16+
@Nonnull
1717
ProxerCall<T> build();
1818
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import okhttp3.Interceptor;
55
import okhttp3.Request;
66
import okhttp3.Response;
7-
import org.jetbrains.annotations.NotNull;
8-
import org.jetbrains.annotations.Nullable;
97

8+
import javax.annotation.Nonnull;
9+
import javax.annotation.Nullable;
1010
import java.io.IOException;
1111

1212
/**
@@ -20,7 +20,7 @@ final class HeaderInterceptor implements Interceptor {
2020
private final String apiKey;
2121
private final String userAgent;
2222

23-
HeaderInterceptor(@NotNull final String apiKey, @Nullable final String userAgent) {
23+
HeaderInterceptor(@Nonnull final String apiKey, @Nullable final String userAgent) {
2424
this.apiKey = apiKey;
2525
this.userAgent = userAgent;
2626
}

0 commit comments

Comments
 (0)