Skip to content

Commit cce66e4

Browse files
committed
Structured command module
- Configure command module - Move docs into docs/ folder instead of module/docs - Version bump to 1.1-0-SNAPSHOT for common module - Improve docs
1 parent d8652f4 commit cce66e4

164 files changed

Lines changed: 6462 additions & 3 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.

command/build.gradle.kts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import com.jfrog.bintray.gradle.BintrayExtension
2+
import groovy.lang.GroovyObject
3+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
4+
import org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig
5+
import org.jfrog.gradle.plugin.artifactory.dsl.ResolverConfig
6+
7+
plugins {
8+
id("org.jetbrains.dokka") version "0.9.18"
9+
id("com.jfrog.bintray") version "1.8.4"
10+
id("com.jfrog.artifactory") version "4.9.6"
11+
kotlin("jvm") version "1.3.11"
12+
`maven-publish`
13+
java
14+
}
15+
16+
group = "me.schlaubi.regnumutils"
17+
version = "1.0.0-SNAPSHOT"
18+
19+
repositories {
20+
mavenCentral()
21+
jcenter()
22+
}
23+
24+
dependencies {
25+
26+
compile(project(":common"))
27+
28+
}
29+
30+
val sourcesJar by tasks.creating(Jar::class)
31+
val dokkaJar by tasks.creating(Jar::class)
32+
33+
bintray {
34+
user = System.getenv("BINTRAY_USER")
35+
key = System.getenv("BINTRAY_KEY")
36+
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
37+
repo = "maven"
38+
name = "regnum-utils-command"
39+
userOrg = "hawk"
40+
setLicenses("GPL-3.0")
41+
vcsUrl = "https://github.com/HawkDiscord/regnum-utils.git"
42+
version(delegateClosureOf<BintrayExtension.VersionConfig> {
43+
name = project.version as String
44+
})
45+
})
46+
}
47+
48+
artifactory {
49+
setContextUrl("https://oss.jfrog.org/artifactory")
50+
publish(delegateClosureOf<PublisherConfig> {
51+
repository(delegateClosureOf<GroovyObject> {
52+
setProperty("repoKey", "oss-snapshot-local")
53+
setProperty("username", System.getenv("BINTRAY_USER"))
54+
setProperty("password", System.getenv("BINTRAY_KEY"))
55+
setProperty("maven", true)
56+
})
57+
defaults(delegateClosureOf<GroovyObject> {
58+
invokeMethod("publications", "mavenJava")
59+
})
60+
})
61+
resolve(delegateClosureOf<ResolverConfig> {
62+
setProperty("repoKey", "repo")
63+
})
64+
}
65+
66+
publishing {
67+
publications {
68+
create<MavenPublication>("mavenJava") {
69+
from(components["java"])
70+
artifact(sourcesJar)
71+
artifact(dokkaJar)
72+
groupId = project.group as String
73+
artifactId = project.name
74+
version = project.version as String
75+
}
76+
}
77+
}
78+
79+
tasks {
80+
dokka {
81+
moduleName = "common"
82+
outputDirectory = "${project.parent!!.projectDir}/docs"
83+
// Oracle broke it
84+
noJdkLink = true
85+
reportUndocumented = true
86+
impliedPlatforms = mutableListOf("JVM")
87+
linkMapping {
88+
dir = "./"
89+
url = "https://github.com/HawkDiscord/regnum-utils/tree/master"
90+
suffix = "#L"
91+
}
92+
externalDocumentationLink {
93+
url = uri("https://www.slf4j.org/api/").toURL()
94+
}
95+
externalDocumentationLink {
96+
url = uri("http://fasterxml.github.io/jackson-databind/javadoc/2.9/").toURL()
97+
}
98+
externalDocumentationLink {
99+
url = uri("https://pages.hawkbot.cc/shared/").toURL()
100+
}
101+
externalDocumentationLink {
102+
url = uri("https://pages.hawkbot.cc/client/").toURL()
103+
}
104+
externalDocumentationLink {
105+
url = uri("https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/").toURL()
106+
packageListUrl =
107+
uri("https://gist.githubusercontent.com/DRSchlaubi/3d1d0aaa5c01963dcd4d0149c841c896/raw/22141759fbab1e38fd2381c3e4f97616ecb43fc8/package-list").toURL()
108+
}
109+
}
110+
111+
"sourcesJar"(Jar::class) {
112+
archiveClassifier.set("sources")
113+
from(sourceSets["main"].allSource)
114+
}
115+
"dokkaJar"(Jar::class) {
116+
group = JavaBasePlugin.DOCUMENTATION_GROUP
117+
archiveClassifier.set("javadoc")
118+
from(dokka)
119+
}
120+
}
121+
122+
123+
configure<JavaPluginConvention> {
124+
sourceCompatibility = JavaVersion.VERSION_12
125+
}
126+
tasks.withType<KotlinCompile> {
127+
kotlinOptions.jvmTarget = "1.8"
128+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Regnum - A Discord bot clustering system made for Hawk
3+
*
4+
* Copyright (C) 2019 Michael Rittmeister
5+
*
6+
* This program is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation, either version 3 of the License, or
9+
* at your option) any later version.
10+
*
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with this program. If not, see https://www.gnu.org/licenses/.
18+
*/
19+
20+
package me.schlaubi.regnumutils.command
21+
22+
interface CommandClient {
23+
}

common/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
}
1515

1616
group = "me.schlaubi.regnumutils"
17-
version = "1.0.1-SNAPSHOT"
17+
version = "1.1.0-SNAPSHOT"
1818

1919
repositories {
2020
mavenCentral()
@@ -88,7 +88,7 @@ publishing {
8888
tasks {
8989
dokka {
9090
moduleName = "common"
91-
outputDirectory = "$projectDir/docs"
91+
outputDirectory = "${project.parent!!.projectDir}/docs"
9292
// Oracle broke it
9393
noJdkLink = true
9494
reportUndocumented = true

common/src/main/kotlin/me/schlaubi/regnumutils/common/cache/MemoryMessageCache.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ package me.schlaubi.regnumutils.common.cache
2121

2222
import net.dv8tion.jda.api.entities.Message
2323

24+
/**
25+
* @see MessageCache.activate
26+
*/
2427
class MemoryMessageCache private constructor() : MessageCache {
2528

2629
private val storage = mutableMapOf<Long, Message>()

common/src/test/kotlin/EntityResolverTest.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class EntityResolverTest {
4141
private lateinit var jda: JDA
4242
private lateinit var guild: Guild
4343

44-
@Rule fun rule(): MockitoRule = MockitoJUnit.rule()
44+
@Suppress("unused")
45+
val rule: MockitoRule = MockitoJUnit.rule()
46+
@Rule get() = field
4547

4648
/**
4749
* Initializes the mocks.

docs/common/alltypes/index.html

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<HTML>
2+
<HEAD>
3+
<meta charset="UTF-8">
4+
<title>alltypes - common</title>
5+
<link rel="stylesheet" href="../../style.css">
6+
</HEAD>
7+
<BODY>
8+
<h3>All Types</h3>
9+
<table>
10+
<tbody>
11+
<tr>
12+
<td>
13+
<a href="../me.schlaubi.regnumutils.common.event/-annotated-event-manager/index.html">me.schlaubi.regnumutils.common.event.AnnotatedEventManager</a></td>
14+
<td>
15+
<p>Implementation of <a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/hooks/IEventManager.html">IEventManager</a> based on <a href="https://pages.hawkbot.cc/client/cc.hawkbot.regnum.client.event.impl/-annotated-event-manger/index.html">AnnotatedEventManger</a>.</p>
16+
</td>
17+
</tr>
18+
<tr>
19+
<td>
20+
<a href="../me.schlaubi.regnumutils.common.constants/-colors/index.html">me.schlaubi.regnumutils.common.constants.Colors</a></td>
21+
<td>
22+
<p>Wrapper for <a href="https://discordapp.com/branding">https://discordapp.com/branding</a> colors and some other colors</p>
23+
</td>
24+
</tr>
25+
<tr>
26+
<td>
27+
<a href="../me.schlaubi.regnumutils.common.messaging/-embed-util/index.html">me.schlaubi.regnumutils.common.messaging.EmbedUtil</a></td>
28+
<td>
29+
<p>Some presets for embeds.</p>
30+
</td>
31+
</tr>
32+
<tr>
33+
<td>
34+
<a href="../me.schlaubi.regnumutils.common.constants/-emotes/index.html">me.schlaubi.regnumutils.common.constants.Emotes</a></td>
35+
<td>
36+
<p>Useful collection of Discord emotes. </p>
37+
</td>
38+
</tr>
39+
<tr>
40+
<td>
41+
<a href="../me.schlaubi.regnumutils.common.parsing/-entity-resolver/index.html">me.schlaubi.regnumutils.common.parsing.EntityResolver</a></td>
42+
<td>
43+
<p>Useful tool to parse a text-message for EntityResolvable.</p>
44+
</td>
45+
</tr>
46+
<tr>
47+
<td>
48+
<a href="../me.schlaubi.regnumutils.common.formatting/-format-util/index.html">me.schlaubi.regnumutils.common.formatting.FormatUtil</a></td>
49+
<td>
50+
<p>Some useful formatting helpers.</p>
51+
</td>
52+
</tr>
53+
<tr>
54+
<td>
55+
<a href="../me.schlaubi.regnumutils.common.jda/cc.hawkbot.regnum.client.core.discord.-game-animator.-game/index.html">cc.hawkbot.regnum.client.core.discord.GameAnimator.Game</a> (extensions in package me.schlaubi.regnumutils.common.jda)</td>
56+
<td>
57+
</td>
58+
</tr>
59+
<tr>
60+
<td>
61+
<a href="../me.schlaubi.regnumutils.common/-game-animator/index.html">me.schlaubi.regnumutils.common.GameAnimator</a></td>
62+
<td>
63+
<p>Animates the bots presence according to the specified <a href="#">interval</a> and <a href="#">TimeUnit</a>.</p>
64+
</td>
65+
</tr>
66+
<tr>
67+
<td>
68+
<a href="../me.schlaubi.regnumutils.common.builder/-game-animator-builder/index.html">me.schlaubi.regnumutils.common.builder.GameAnimatorBuilder</a></td>
69+
<td>
70+
<p>Builder for <code><a href="../me.schlaubi.regnumutils.common/-game-animator/index.html">GameAnimator</a></code>.</p>
71+
</td>
72+
</tr>
73+
<tr>
74+
<td>
75+
<a href="../me.schlaubi.regnumutils.common.events/-generic-message-cache-event/index.html">me.schlaubi.regnumutils.common.events.GenericMessageCacheEvent</a></td>
76+
<td>
77+
<p>Base class for events fired by the <a href="../me.schlaubi.regnumutils.common.cache/-message-cache/index.html">me.schlaubi.regnumutils.common.cache.MessageCache</a>.</p>
78+
</td>
79+
</tr>
80+
<tr>
81+
<td>
82+
<a href="../me.schlaubi.regnumutils.common.events/-guild-message-delete-event/index.html">me.schlaubi.regnumutils.common.events.GuildMessageDeleteEvent</a></td>
83+
<td>
84+
<p>Event that represents a message deletion on a guild.</p>
85+
</td>
86+
</tr>
87+
<tr>
88+
<td>
89+
<a href="../me.schlaubi.regnumutils.common.events/-guild-message-update-event/index.html">me.schlaubi.regnumutils.common.events.GuildMessageUpdateEvent</a></td>
90+
<td>
91+
<p>Event that represents a message edit on a guild.</p>
92+
</td>
93+
</tr>
94+
<tr>
95+
<td>
96+
<a href="../me.schlaubi.regnumutils.common.event/-interfaced-event-manager/index.html">me.schlaubi.regnumutils.common.event.InterfacedEventManager</a></td>
97+
<td>
98+
<p>Implementation of <a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/hooks/IEventManager.html">IEventManager</a> based on <a href="https://pages.hawkbot.cc/client/cc.hawkbot.regnum.client.event.impl/-interfaced-event-manager/index.html">InterfacedEventManager</a>.</p>
99+
</td>
100+
</tr>
101+
<tr>
102+
<td>
103+
<a href="../me.schlaubi.regnumutils.common.jda/net.dv8tion.jda.api.-j-d-a/index.html">net.dv8tion.jda.api.JDA</a> (extensions in package me.schlaubi.regnumutils.common.jda)</td>
104+
<td>
105+
</td>
106+
</tr>
107+
<tr>
108+
<td>
109+
<a href="../me.schlaubi.regnumutils.common.event/-j-d-a-event-manager-adapter/index.html">me.schlaubi.regnumutils.common.event.JDAEventManagerAdapter</a></td>
110+
<td>
111+
<p>Adapter for <a href="https://pages.hawkbot.cc/client/cc.hawkbot.regnum.client.event/-event-manager/index.html">EventManager</a> to <a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/hooks/IEventManager.html">IEventManager</a>.</p>
112+
</td>
113+
</tr>
114+
<tr>
115+
<td>
116+
<a href="../me.schlaubi.regnumutils.common.jda/-j-d-a-extensions/index.html">me.schlaubi.regnumutils.common.jda.JDAExtensions</a></td>
117+
<td>
118+
<p>Wrapper for extension functions.</p>
119+
</td>
120+
</tr>
121+
<tr>
122+
<td>
123+
<a href="../me.schlaubi.regnumutils.common.event/-j-d-a-listener-adapter/index.html">me.schlaubi.regnumutils.common.event.JDAListenerAdapter</a></td>
124+
<td>
125+
<p>Port of <a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/hooks/ListenerAdapter.html">net.dv8tion.jda.api.hooks.ListenerAdapter</a> to <a href="https://pages.hawkbot.cc/client/cc.hawkbot.regnum.client.event.impl/-event-listener/index.html">cc.hawkbot.regnum.client.event.impl.EventListener</a>.</p>
126+
</td>
127+
</tr>
128+
<tr>
129+
<td>
130+
<a href="../me.schlaubi.regnumutils.common.cache/-memory-message-cache/index.html">me.schlaubi.regnumutils.common.cache.MemoryMessageCache</a></td>
131+
<td>
132+
</td>
133+
</tr>
134+
<tr>
135+
<td>
136+
<a href="../me.schlaubi.regnumutils.common.cache/-message-cache/index.html">me.schlaubi.regnumutils.common.cache.MessageCache</a></td>
137+
<td>
138+
<p>Cache for <a href="#">messages</a> in order to get the old content in <code>MESSAGE_UPDATE</code> and <code>MESSAGE_DELETE</code> events.</p>
139+
</td>
140+
</tr>
141+
<tr>
142+
<td>
143+
<a href="../me.schlaubi.regnumutils.common/-misc/index.html">me.schlaubi.regnumutils.common.Misc</a></td>
144+
<td>
145+
<p>Some tools.</p>
146+
</td>
147+
</tr>
148+
<tr>
149+
<td>
150+
<a href="../me.schlaubi.regnumutils.common.event/-regnum-listener-adapter/index.html">me.schlaubi.regnumutils.common.event.RegnumListenerAdapter</a></td>
151+
<td>
152+
<p>Port of <a href="https://pages.hawkbot.cc/client/cc.hawkbot.regnum.client.event/-listener-adapter/index.html">ListenerAdapter</a> to <a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/hooks/EventListener.html">EventListener</a>.</p>
153+
</td>
154+
</tr>
155+
<tr>
156+
<td>
157+
<a href="../me.schlaubi.regnumutils.common.constants/-regnum-utils/index.html">me.schlaubi.regnumutils.common.constants.RegnumUtils</a></td>
158+
<td>
159+
<p>Some information about the Regnum utils library.</p>
160+
</td>
161+
</tr>
162+
<tr>
163+
<td>
164+
<a href="../me.schlaubi.regnumutils.common.messaging/-safe-message/index.html">me.schlaubi.regnumutils.common.messaging.SafeMessage</a></td>
165+
<td>
166+
<p>Util to send messages safely without risking <code><a href="https://ci.dv8tion.net/job/JDA4-Alpha/javadoc/net/dv8tion/jda/api/exceptions/InsufficientPermissionException.html">InsufficientPermissionException</a></code>s</p>
167+
</td>
168+
</tr>
169+
<tr>
170+
<td>
171+
<a href="../me.schlaubi.regnumutils.common.jda/cc.hawkbot.regnum.client.core.discord.-shard-manager/index.html">cc.hawkbot.regnum.client.core.discord.ShardManager</a> (extensions in package me.schlaubi.regnumutils.common.jda)</td>
172+
<td>
173+
</td>
174+
</tr>
175+
<tr>
176+
<td>
177+
<a href="../me.schlaubi.regnumutils.common.jda/net.dv8tion.jda.api.sharding.-shard-manager/index.html">net.dv8tion.jda.api.sharding.ShardManager</a> (extensions in package me.schlaubi.regnumutils.common.jda)</td>
178+
<td>
179+
</td>
180+
</tr>
181+
</tbody>
182+
</table>
183+
</BODY>
184+
</HTML>

0 commit comments

Comments
 (0)