-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add new and modify existing dungeon entities (#1)
- Loading branch information
Showing
30 changed files
with
640 additions
and
61 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation("org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r") | ||
} |
42 changes: 42 additions & 0 deletions
42
buildSrc/src/main/kotlin/cookies-entities-changelog.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import org.eclipse.jgit.api.Git | ||
import kotlin.io.path.readText | ||
|
||
tasks { | ||
val changelogTask = register("createChangelog") | ||
changelogTask.configure { | ||
group = "cookies" | ||
enabled = true | ||
doLast { | ||
val git = Git.open(rootDir) | ||
|
||
val currentTag = git.tagList().call().first() | ||
val previousTag = git.tagList().call().let { | ||
if (it.size > 1) { | ||
it[1].objectId | ||
} else { | ||
git.log().call().first().toObjectId() | ||
} | ||
} | ||
|
||
val gitHistory = git.log().addRange(previousTag, currentTag.objectId).call() | ||
val changeLogBuilder = StringBuilder() | ||
val changeLogHeader = rootDir.toPath().resolve("gradle/CHANGELOG_HEADER.md").readText(Charsets.UTF_8) | ||
|
||
changeLogBuilder.append(applyPlaceholders(changeLogHeader)) | ||
|
||
gitHistory.forEach { | ||
if (it.fullMessage.contains("[SKIP]")) { | ||
return@forEach | ||
} | ||
changeLogBuilder.append("- ").append(it.shortMessage).append(" - @").append(it.committerIdent.name).append("\n") | ||
} | ||
|
||
rootDir.resolve("CHANGELOG.md").writeText(changeLogBuilder.toString()) | ||
} | ||
} | ||
} | ||
|
||
fun applyPlaceholders(text: String): String { | ||
return text.replace("\$VERSION$", "${getRootProject().version}") | ||
.replace("\$projectName$", getRootProject().name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
tasks { | ||
val register = register("version") | ||
register.configure { | ||
group = "cookies" | ||
enabled = true | ||
doLast { | ||
rootDir.resolve("version.txt").writeText("${rootProject.version}") | ||
} | ||
} | ||
} |
Empty file.
13 changes: 13 additions & 0 deletions
13
src/main/java/dev/morazzer/cookies/entities/misc/BackendVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package dev.morazzer.cookies.entities.misc; | ||
|
||
/** | ||
* Information about the current backend version. | ||
*/ | ||
public class BackendVersion { | ||
|
||
public static final int CURRENT_API_VERSION = 1; | ||
public static final int CURRENT_PACKET_VERSION = 2; | ||
|
||
public static final String CURRENT_VERSION_STRING = "v" + CURRENT_API_VERSION; | ||
|
||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/dev/morazzer/cookies/entities/request/AuthRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
package dev.morazzer.cookies.entities.request; | ||
|
||
/** | ||
* Entity to initialize authentication. | ||
* @param sharedSecret The secret created by the client. | ||
* @param username The username of the client. | ||
*/ | ||
public record AuthRequest(String sharedSecret, String username) { | ||
} |
9 changes: 6 additions & 3 deletions
9
src/main/java/dev/morazzer/cookies/entities/response/AuthResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
package dev.morazzer.cookies.entities.response; | ||
|
||
public record AuthResponse(String token) { | ||
|
||
} | ||
/** | ||
* The auth response from the server. | ||
* | ||
* @param token The token of the client. | ||
*/ | ||
public record AuthResponse(String token) {} |
3 changes: 0 additions & 3 deletions
3
src/main/java/dev/morazzer/cookies/entities/websocket/CrossServer.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.