Skip to content

Commit 060dba7

Browse files
committed
Splitting the util module
1 parent 6ee858e commit 060dba7

File tree

9 files changed

+62
-8
lines changed

9 files changed

+62
-8
lines changed

.idea/gradle.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
}
44

55
dependencies {
6+
implementation project(":utils")
67
implementation "com.squareup.okhttp3:okhttp:${rootProject.ext.okhttpVersion}"
78
testImplementation "com.squareup.okhttp3:mockwebserver:${rootProject.ext.okhttpVersion}"
89
implementation "com.google.code.gson:gson:${rootProject.ext.gsonVersion}"

core/src/main/java/ru/funpay4j/client/jsoup/JsoupFunPayParser.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
import com.google.gson.JsonParser;
1818
import lombok.NonNull;
1919
import okhttp3.*;
20-
import org.jetbrains.annotations.Nullable;
2120
import org.jsoup.Jsoup;
2221
import org.jsoup.nodes.Document;
2322
import org.jsoup.nodes.Element;
23+
import ru.funpay4j.utils.FunPayUserUtil;
2424
import ru.funpay4j.client.FunPayParser;
2525
import ru.funpay4j.core.exceptions.FunPayApiException;
2626
import ru.funpay4j.core.exceptions.offer.OfferNotFoundException;
@@ -34,7 +34,6 @@
3434
import ru.funpay4j.core.objects.offer.Offer;
3535
import ru.funpay4j.core.objects.offer.PreviewOffer;
3636
import ru.funpay4j.core.objects.user.*;
37-
import ru.funpay4j.util.FunPayUserUtil;
3837

3938
import java.io.IOException;
4039
import java.text.ParseException;

examples/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
}
44

55
dependencies {
6-
implementation project(":funpay4j-core")
6+
implementation project(":core")
77
}
88

99
java {

settings.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_1_8)) {
1414
}
1515

1616
include 'core'
17-
project(":core").name = 'funpay4j-core'
17+
project(":core").name = 'core'
1818

1919
include 'examples'
20-
project(":examples").name = 'funpay4j-examples'
20+
project(":examples").name = 'examples'
21+
22+
include 'utils'
23+
project(":utils").name = 'utils'
24+

utils/build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
dependencies {
6+
annotationProcessor "org.projectlombok:lombok:${rootProject.ext.lombokVersion}"
7+
testImplementation platform('org.junit:junit-bom:5.9.1')
8+
testImplementation 'org.junit.jupiter:junit-jupiter'
9+
}
10+
11+
configurations {
12+
compileOnly {
13+
extendsFrom annotationProcessor
14+
}
15+
}
16+
17+
java {
18+
toolchain {
19+
languageVersion = JavaLanguageVersion.of(8)
20+
}
21+
}
22+
23+
tasks.withType(Javadoc).configureEach {
24+
failOnError = true
25+
options.addStringOption('Xdoclint:all', '-quiet')
26+
options.addBooleanOption('Xwerror', true)
27+
}
28+
29+
tasks.named("build") {
30+
dependsOn(javadoc)
31+
}
32+
33+
test {
34+
useJUnitPlatform()
35+
}

core/src/main/java/ru/funpay4j/util/FunPayUserUtil.java renamed to utils/src/main/java/ru/funpay4j/utils/FunPayUserUtil.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,21 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.util;
15+
/*
16+
* Licensed under the Apache License, Version 2.0 (the "License");
17+
* you may not use this file except in compliance with the License.
18+
* You may obtain a copy of the License at
19+
*
20+
* http://www.apache.org/licenses/LICENSE-2.0
21+
*
22+
* Unless required by applicable law or agreed to in writing, software
23+
* distributed under the License is distributed on an "AS IS" BASIS,
24+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25+
* See the License for the specific language governing permissions and
26+
* limitations under the License.
27+
*/
28+
29+
package ru.funpay4j.utils;
1630

1731
import lombok.NonNull;
1832

core/src/test/java/ru/funpay4j/util/FunPayUserUtilLastSeenAtConverterTest.java renamed to utils/src/test/java/ru/funpay4j/utils/FunPayUserUtilLastSeenAtConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.util;
15+
package ru.funpay4j.utils;
1616

1717
import org.junit.jupiter.api.Test;
1818

core/src/test/java/ru/funpay4j/util/FunPayUserUtilRegisterDateConverterTest.java renamed to utils/src/test/java/ru/funpay4j/utils/FunPayUserUtilRegisterDateConverterTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* limitations under the License.
1313
*/
1414

15-
package ru.funpay4j.util;
15+
package ru.funpay4j.utils;
1616

1717
import org.junit.jupiter.api.Test;
1818

0 commit comments

Comments
 (0)