Skip to content

Commit 2525cee

Browse files
committed
Restructure gradle setup and reformat
1 parent 7b1036c commit 2525cee

19 files changed

+40
-110
lines changed

build.gradle

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
11
buildscript {
22
apply from: "gradle/versions.gradle"
3+
}
34

4-
repositories {
5-
gradlePluginPortal()
6-
}
7-
8-
dependencies {
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
10-
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
5+
plugins {
6+
id "org.jetbrains.kotlin.jvm"
7+
id "org.jetbrains.kotlin.kapt"
8+
id "org.jetbrains.dokka"
119

12-
classpath "org.jlleitschuh.gradle:ktlint-gradle:$ktlintVersion"
13-
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion"
14-
15-
classpath "gradle.plugin.de.fuerstenau:BuildConfigPlugin:$buildConfigPluginVersion"
16-
classpath "com.github.ben-manes:gradle-versions-plugin:$gradleVersionsPluginVersion"
17-
}
10+
id "com.github.ben-manes.versions"
1811
}
1912

2013
allprojects {
@@ -26,6 +19,12 @@ allprojects {
2619
}
2720
}
2821

22+
tasks.named("dependencyUpdates").configure {
23+
rejectVersionIf {
24+
!(it.candidate.version ==~ /^[0-9,.v-]+(-r)?$/)
25+
}
26+
}
27+
2928
wrapper {
3029
gradleVersion = project.ext.gradleVersion
3130
}

gradle/versions.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ ext {
88
dokkaVersion = "1.4.20"
99

1010
jacocoVersion = "0.8.6"
11-
ktlintVersion = "9.4.1"
11+
ktlintPluginVersion = "9.4.1"
12+
ktlintVersion = "0.40.0"
1213
detektVersion = "1.15.0"
1314

1415
gradleVersionsPluginVersion = "0.36.0"

library/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ plugins {
1010
id "io.gitlab.arturbosch.detekt"
1111
id "org.jlleitschuh.gradle.ktlint"
1212

13-
id "com.github.ben-manes.versions"
1413
id "de.fuerstenau.buildconfig"
15-
16-
id "idea"
1714
}
1815

1916
apply from: "${rootDir}/gradle/dependencies.gradle"
@@ -57,12 +54,6 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
5754
}
5855
}
5956

60-
tasks.named("dependencyUpdates").configure {
61-
rejectVersionIf {
62-
!(it.candidate.version ==~ /^[0-9,.v-]+(-r)?$/)
63-
}
64-
}
65-
6657
kapt {
6758
useBuildCache = true
6859
}
@@ -91,6 +82,7 @@ jacocoTestReport {
9182

9283
ktlint {
9384
disabledRules = ["import-ordering"]
85+
version = ktlintVersion
9486

9587
reporters {
9688
reporter "checkstyle"

library/src/test/kotlin/me/proxer/library/api/forum/TopicEndpointTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,11 @@ class TopicEndpointTest : ProxerTest() {
2424
id = "811256", parentId = "811201", userId = "139597", username = "Miss-Otaku", image = "139597_cKc2zC.png",
2525
date = Date(1513626886L * 1000), signature = "", modifiedById = "123", modifiedByName = "test",
2626
modifiedDate = Date(15135529123L * 1000), modifiedReason = "just a test",
27-
message =
28-
"""
27+
message = """
2928
|Ich versuche, dass ganze im Rahmen zu halten. Meistens sind es so ungefähr 2-3 Folgen und über
3029
| den Tag verteilt. Leider werde ich oft schwach, gerade bei besonders spannenden Anime, dass ich auch
3130
| mehrere Folgen am Stück anschaue.
32-
""".trimMargin().replace(
33-
"\n",
34-
""
35-
),
31+
""".trimMargin().replace("\n", ""),
3632
thankYouAmount = 0
3733
)
3834
)

library/src/test/kotlin/me/proxer/library/api/info/EntryEndpointTest.kt

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ class EntryEndpointTest : ProxerTest() {
3030

3131
private val expectedEntry = Entry(
3232
id = "6174", name = "LuCu LuCu", fskConstraints = setOf(),
33-
description =
34-
"""
33+
description = """
3534
|Humans are a despicable lot, committing sin after sin, filling the endless boundaries of the
3635
| underworld with tortured souls. Now, it would seem, Hell isn't so endless after all, and it has become
3736
| dangerously close to filling, and then overflowing into the human realm. Princess Lucuha sees this
3837
| imminent disaster and has a plan: save Hell by making humans decent again. Of course, the angels can't
3938
| simply allow demons to roam freely on Earth, and they do their best to stop Lucu and her
4039
| dastardly plans.
41-
""".trimMargin().replace(
42-
"\n",
43-
""
44-
),
40+
""".trimMargin().replace("\n", ""),
4541
medium = Medium.MANGASERIES, episodeAmount = 90, state = MediaState.FINISHED, ratingSum = 7, ratingAmount = 1,
4642
clicks = 134, category = Category.MANGA, license = License.NOT_LICENSED,
4743
adaptionInfo = AdaptionInfo(id = "2793", name = "KissXsis", medium = Medium.MANGASERIES),
@@ -90,27 +86,19 @@ class EntryEndpointTest : ProxerTest() {
9086
entryTagId = "175",
9187
date = "2018-03-07 23:17:44".toProxerDateTime(),
9288
name = "Action",
93-
description =
94-
"""
89+
description = """
9590
Dynamische Szenen, spannende Wettkämpfe und beeindruckende Kampfszenen prägen dieses Genre.
96-
""".trimIndent().replace(
97-
"\n",
98-
""
99-
)
91+
""".trimIndent().replace("\n", "")
10092
),
10193
InfoGenre(
10294
id = "120695",
10395
entryTagId = "174",
10496
date = "2018-03-07 23:17:44".toProxerDateTime(),
10597
name = "Adventure",
106-
description =
107-
"""
98+
description = """
10899
|Es handelt sich meist um eine Geschichte über eine Reise oder Suche.
109100
| Kurzum ein Abenteuer, das es zu bestehen gilt.
110-
""".trimMargin().replace(
111-
"\n",
112-
""
113-
)
101+
""".trimMargin().replace("\n", "")
114102
)
115103
)
116104
)

library/src/test/kotlin/me/proxer/library/api/info/RelationsEndpointTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ class RelationsEndpointTest : ProxerTest() {
3030
id = "4167", name = "Sword Art Online",
3131
genres = setOf("Adventure", "Action", "Comedy", "Drama", "Fantasy", "SciFi"),
3232
fskConstraints = setOf(FskConstraint.FSK_12, FskConstraint.BAD_LANGUAGE, FskConstraint.VIOLENCE),
33-
description =
34-
"""
33+
description = """
3534
|Kazuto Kirigaya testet als einer der ersten einen neuen Hightech-Helm, welcher die Psyche
3635
| des Nutzers komplett in die Welt des MMORPGs „Sword Art Online“ transferiert. Als Tester der
3736
| Beta-Version besitzt er bereits einiges an Erfahrung und kämpfte sich mehr als erfolgreich als
@@ -41,10 +40,7 @@ class RelationsEndpointTest : ProxerTest() {
4140
| Möglichkeit wieder in die reale Welt zurückzukehren besteht darin, SAO erfolgreich abzuschließen.
4241
| Doch das ist leichter gesagt als getan, denn der Tod in der Fantasy-Welt bedeutet auch den richtigen
4342
| Tod in der richtigen Welt.
44-
""".trimMargin().replace(
45-
"\n",
46-
""
47-
),
43+
""".trimMargin().replace("\n", ""),
4844
medium = Medium.ANIMESERIES, episodeAmount = 25, state = MediaState.FINISHED, ratingSum = 158782,
4945
ratingAmount = 17935, clicks = 5968, category = Category.ANIME, license = License.LICENSED,
5046
languages = setOf(MediaLanguage.GERMAN_DUB, MediaLanguage.ENGLISH_SUB, MediaLanguage.ENGLISH_DUB),

library/src/test/kotlin/me/proxer/library/api/list/MediaListEndpointTest.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ class MediaListEndpointTest : ProxerTest() {
5454
request.path shouldBeEqualTo """
5555
/api/v1/list/entrylist?kat=anime&medium=animeseries&isH=true&start=abc&
5656
sort=rating&sort_type=ASC&p=0&limit=10
57-
""".trimIndent().replace(
58-
"\n",
59-
""
60-
)
57+
""".trimIndent().replace("\n", "")
6158
}
6259
}

library/src/test/kotlin/me/proxer/library/api/list/MediaSearchEndpointTest.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,7 @@ class MediaSearchEndpointTest : ProxerTest() {
6868
/api/v1/list/entrysearch?name=test&language=en&type=all-manga&fsk=fear&sort=clicks&length=300
6969
&length-limit=down&tags=3%2B7&notags=5%2B20&taggenre=22%2B33&notaggenre=13%2B17&tagratefilter=rate_1
7070
&tagspoilerfilter=spoiler_1&hide_finished=1&p=3&limit=10
71-
""".trimIndent().replace(
72-
"\n",
73-
""
74-
)
71+
""".trimIndent().replace("\n", "")
7572
}
7673

7774
@Test

library/src/test/kotlin/me/proxer/library/api/messenger/CreateConferenceGroupEndpointTest.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ class CreateConferenceGroupEndpointTest : ProxerTest() {
4848

4949
request.body.readUtf8() shouldBeEqualTo """
5050
topic=topic&text=message&users%5B%5D=someUser&users%5B%5D=anotherUser&users%5B%5D=testUser
51-
""".trimIndent().replace(
52-
"\n",
53-
""
54-
)
51+
""".trimIndent().replace("\n", "")
5552
}
5653
}

library/src/test/kotlin/me/proxer/library/api/notifications/NewsEndpointTest.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,10 @@ class NewsEndpointTest : ProxerTest() {
1414

1515
private val expectedNews = NewsArticle(
1616
id = "7709", date = Date(1488654000L * 1000),
17-
description =
18-
"""
17+
description = """
1918
|In der diesjährigen 14. Ausgabe von Shueishas Weekly Shounen Jump-Magazin soll angekündigt werden,
2019
| dass der Manga To Love-Ru Trouble Darkness eine neue OVA erhält.
21-
""".trimMargin().replace(
22-
"\n",
23-
""
24-
),
20+
""".trimMargin().replace("\n", ""),
2521
image = "723465714977",
2622
subject = "To Love-Ru Trouble " + "Darkness – OVA zum zehnjährigen Jubiläum angekündigt", hits = 549,
2723
threadId = "381362", authorId = "101731", author = "SilentGray", commentAmount = 1, categoryId = "56",

0 commit comments

Comments
 (0)