Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Command system almost-complete rework #84

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
4290c75
Merge remote-tracking branch 'origin/master' into feature/big-rework
LichtHund Aug 6, 2022
b802bc2
Yeet CLI
LichtHund Aug 7, 2022
47cec37
Removed SubCommand interface and made abstract the main one
LichtHund Aug 7, 2022
aca9678
Uh yeah
LichtHund Aug 24, 2022
14b61c6
Merge branch 'master' into feature/big-rework
LichtHund Aug 24, 2022
fc3d892
Uh
LichtHund Aug 25, 2022
16d7372
Uh
LichtHund Aug 26, 2022
2de6063
Merge branch 'master' into feature/big-rework
Sep 12, 2022
b37e6ee
merge conflicts
Sep 17, 2022
c505223
Merge remote-tracking branch 'origin/master' into feature/big-rework
Sep 17, 2022
6e1e9c3
Small rework of commands and subcommands
LichtHund Oct 1, 2022
b4143c9
Merge remote-tracking branch 'origin/master' into feature/big-rework
LichtHund Oct 1, 2022
c039133
uh wtf
LichtHund Oct 2, 2022
b96aaa7
Preparing for processor changes
LichtHund Oct 10, 2022
51ccd5a
Merge remote-tracking branch 'origin/master' into feature/big-rework
LichtHund Oct 10, 2022
6034244
pushing things to continue on the desktop
LichtHund Nov 8, 2022
d5f251a
feature: New command processing
LichtHund Dec 23, 2022
90f5bc1
chore: Make core and simple compilable
LichtHund Dec 23, 2022
6246ec1
feature: Tests are back baby
LichtHund Dec 23, 2022
3c697b0
chore: Refactor
LichtHund Dec 23, 2022
16fa737
chore: Sub command processing start =
LichtHund Dec 23, 2022
140a274
chore: Formatting I guess
LichtHund Dec 23, 2022
bf201ae
chore: More formatting
LichtHund Dec 23, 2022
864c6a7
feature: Checkstyle
LichtHund Dec 24, 2022
e51db1e
feature: Checks CI
LichtHund Dec 24, 2022
bbc1a21
feature: Visiting all classes and method commands
LichtHund Dec 24, 2022
9fa6c32
chore: Yet another round of re-structuring
LichtHund Dec 24, 2022
f67a270
feature: New processing for commands and sender validation feature
LichtHund Dec 25, 2022
4312755
chore: Re-add suggestions
LichtHund Dec 25, 2022
cebdbfd
chore: Re-add command creation
LichtHund Dec 25, 2022
7943e04
chore: Re-add arguments and suggestions
LichtHund Dec 25, 2022
cc5b98c
chore: Extension customization preparation
LichtHund Dec 25, 2022
38ecdf5
feature: Command extensions trial
LichtHund Dec 25, 2022
9571c38
feature: Custom processors
LichtHund Dec 25, 2022
eeeeb22
chore: Custom processors with meta polish
LichtHund Dec 26, 2022
b1fb357
chore: Modifying annotation target structure
LichtHund Dec 26, 2022
6cbbe15
feature: Kotlin suspending commands, new command options, and extensions
LichtHund Dec 27, 2022
ef53409
chore: Make command processor extension available for all types
LichtHund Dec 27, 2022
e347fb0
chore: Reorganizing kotlin modules
LichtHund Dec 27, 2022
2b1442d
chore: Hmm
LichtHund Dec 27, 2022
ab30b59
feature: New flags + argument parser
LichtHund Dec 27, 2022
0a1d9ab
feature: Rewritten flags and named arguments system
LichtHund Dec 28, 2022
26e42f6
feature: Flags registration
LichtHund Dec 28, 2022
b9b75e0
feature: Finalizing named arguments and most of command registration
LichtHund Dec 28, 2022
28df64c
chore: Cleanup and polishing
LichtHund Dec 29, 2022
aefc0d6
feature: Argument-as-subcommand, multi-level sub command declaration
LichtHund Dec 30, 2022
aca41bb
feature: Make annotations documented and some cleanups
LichtHund Dec 30, 2022
a31858d
feature: Goodbye BaseCommand
LichtHund Dec 30, 2022
4a6f4c4
feature: Re-add arguments to commands
LichtHund Dec 30, 2022
3f36b55
chore: Spotless
LichtHund Dec 30, 2022
be6da70
feature: Re-added requirements
LichtHund Dec 30, 2022
6bc26bb
chore: Small rewrite of message context
LichtHund Jan 1, 2023
6606d2a
feature: Draft executor extension
LichtHund Jan 1, 2023
a2b109b
chore: Yeet old code
LichtHund Jan 1, 2023
8b8458c
chore: Remove annotations from type parameters
LichtHund Jan 1, 2023
7c1c2d8
feature: Rework messages again, no with syntax annotation
LichtHund Jan 17, 2023
76e8151
feature: Flag and Named argument internal argument
LichtHund Jan 18, 2023
c42ac51
chore: Yeet unneeded implementation
LichtHund Jan 18, 2023
7fce5e0
chore: License headers
LichtHund Jan 18, 2023
e0d9276
chore: Spotless
LichtHund Jan 18, 2023
f183e05
feature: Improved command requirements
LichtHund Jan 19, 2023
8d763f4
chore: Make mapping not nullable and fix naming
LichtHund Jan 19, 2023
c07ab82
feature: Proper coroutines support, execution
LichtHund Jan 19, 2023
69ff647
chore: Bukkit time baby
LichtHund Jan 19, 2023
325b30b
chore: Refactor to manager factories and option builders
LichtHund Jan 20, 2023
fa5aec4
chore: Make builder public
LichtHund Jan 20, 2023
db9c785
chore: Yeeting old code to re-implement Bukkit
LichtHund Jan 20, 2023
9b945e0
chore: Validation rework
LichtHund Jan 21, 2023
6818368
feature: Bukkit basic execution
LichtHund Jan 21, 2023
d3af9a0
feature: Using Deque for command navigation to simplify executions
LichtHund Jan 23, 2023
81dba29
chore: Feature is getting simpler
LichtHund Jan 23, 2023
62b2586
chore: Yeet ExecutableCommand, since all commands are executable
LichtHund Jan 23, 2023
f9c2315
feature: Full re-implementation of suggestions
LichtHund Jan 24, 2023
3b1bdd5
feature: Suggestion for argument-as-command
LichtHund Jan 24, 2023
49b107c
feature: Improved requirements
LichtHund Jan 28, 2023
22d3a66
feature: Better command manager builder
LichtHund Jan 29, 2023
4fdb6a6
chore: Finalizing Core, Bukkit, and Simple (for now)
LichtHund Jan 29, 2023
c61436e
chore: License
LichtHund Jan 29, 2023
db2a7ec
version: Highly experimental `2.0.0-ALPHA-1`
LichtHund Jan 29, 2023
2e52465
chore: Small fixes
LichtHund Jan 29, 2023
5899484
chore: Hello JDA
LichtHund Jan 29, 2023
85403aa
feature: Re-implement senders for prefixed JDA
LichtHund Jan 29, 2023
a2d543e
chore: Slight work on prefixed but will swap to slash as it's needed
LichtHund Jan 29, 2023
c7cf0ac
feature: JDA registration reimplemented WIP
LichtHund Jan 29, 2023
5133911
feature: We got JDA execution baby
LichtHund Jan 30, 2023
223956a
feature: Basic suggestions
LichtHund Jan 30, 2023
a9af9d7
feature: JDA Choices
LichtHund Jan 30, 2023
704faa4
feature: NSFW Commands for JDA and "finished" slash platform
LichtHund Feb 2, 2023
936fdee
chore: Bump version and fix compile issue
LichtHund Feb 2, 2023
c6f11d6
feature: Suggest lower case enum option
LichtHund Feb 2, 2023
306da17
chore: License format
LichtHund Feb 2, 2023
18d4a6f
chore: Renamed jda slash packages
LichtHund Feb 2, 2023
d6185f2
kord: Kord? Kord!
LichtHund Feb 2, 2023
0196244
feature: Base for Kord support
LichtHund Feb 2, 2023
7fd308b
feature: Barebones Kord support
LichtHund Feb 3, 2023
07e158d
chore: More Kord
LichtHund Feb 13, 2023
0cb390b
chore: Gradle 8
LichtHund Feb 13, 2023
b239650
chore(dep): Bump Kotlin
LichtHund Feb 13, 2023
7785da8
feature: Configurable suggestion resolution method
LichtHund Feb 15, 2023
9b75dfc
feature: Re-adding custom senders
LichtHund Apr 15, 2023
6880068
chore: Bump alpha version
LichtHund Apr 15, 2023
fc9b739
chore: Updated JDA to beta 8
xMrAfonso Apr 27, 2023
f1e991e
chore: Update JDA to beta 13
kazuryyx Sep 13, 2023
d856146
chore: Bump project version to alpha-9
LichtHund Sep 13, 2023
1012e59
fix: Remove optional from example command
LichtHund Sep 17, 2023
3980fb2
chore: Update JDA version to 5.0.0-beta.22
xMrAfonso Apr 9, 2024
7be8b65
chore: Add `@CheckReturnValue` to action-returning methods
Sparky983 Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<module name="TreeWalker">
<!-- Currently only a few rules, will add more -->
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
</module>
</module>
35 changes: 35 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is a basic workflow to help you get started with Actions
name: Checks

# Controls when the workflow will run
on:
push:
branches: [ "**" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
gradle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Checkstyle
run: ./gradlew checkstyleMain

- name: Spotless check
run: ./gradlew spotlessCheck

- name: License check
run: ./gradlew license
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ With this, your parameters are the command's arguments!

## Features

- Simplifies how you handle your command arguments, instead of having an array with arguments and handling it one by one, simply add what you want to the parameters of your command method.
- Simplifies how you handle your command arguments, instead of having an array with arguments and handling it one by
one, simply add what you want to the parameters of your command method.
- Small, adds only 32KB to your project.
- All messages are customizable.
- Makes having multiple commands even easier.
Expand All @@ -28,13 +29,14 @@ You can find the documentation [**here**](https://triumphteam.dev/library/triump

## Contributing

Found any issue? Please report it [**here**](https://github.com/TriumphTeam/triumph-cmds/issues).
Found any issue? Please report it [**here**](https://github.com/TriumphTeam/triumph-cmds/issues).
Feel free to PR any changes you'd like to see in it!
The source code can be found [**here**](https://github.com/TriumphTeam/triumph-cmds).

## GUI

**Triumph** also has an additional lib to make easier GUI's in Spigot, you can read more about it [**here**](https://triumphteam.dev/library/triumph-gui/introduction).
**Triumph** also has an additional lib to make easier GUI's in Spigot, you can read more about it [**here
**](https://triumphteam.dev/library/triumph-gui/introduction).

## Other

Expand Down
13 changes: 6 additions & 7 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ plugins {
`kotlin-dsl`
}

repositories {
gradlePluginPortal()
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20")
implementation("gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1")
}
// Hack to allow version catalog inside convention plugins
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))

// Bundled plugins
implementation(libs.bundles.build)
}
15 changes: 15 additions & 0 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rootProject.name = "build-logic"

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
gradlePluginPortal()
mavenCentral()
}

versionCatalogs {
register("libs") {
from(files("../gradle/libs.versions.toml")) // include from parent project
}
}
}
60 changes: 53 additions & 7 deletions build-logic/src/main/kotlin/cmds.base-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
import com.diffplug.gradle.spotless.FormatExtension
import org.gradle.accessors.dm.LibrariesForLibs
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

// Hack which exposes `libs` to this convention plugin
val libs = the<LibrariesForLibs>()

plugins {
`java-library`
id("com.github.hierynomus.license")
kotlin("jvm")
id("com.github.hierynomus.license")
id("com.diffplug.spotless")
id("net.kyori.indra")
id("net.kyori.indra.checkstyle")
}

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
compileOnly("org.jetbrains:annotations:23.0.0")
compileOnly(libs.annotations)
}

java {
Expand All @@ -22,20 +29,59 @@ java {
withJavadocJar()
}

kotlin {
explicitApi()
}

license {
header = rootProject.file("LICENSE")
encoding = "UTF-8"
mapping("kotlin", "JAVADOC_STYLE")
mapping("java", "JAVADOC_STYLE")
useDefaultMappings = true

include("**/*.kt")
include("**/*.java")
}

indra {
checkstyle()
}

fun FormatExtension.defaults() {
trimTrailingWhitespace()
endWithNewline()
indentWithSpaces(4)
}

spotless {
format("format") {
defaults()

target(
"*.md",
".gitignore",
"*.properties",
)
}

java {
defaults()
formatAnnotations()
}

kotlin {
defaults()
ktlint("0.47.1").editorConfigOverride(
mapOf(
"ktlint_disabled_rules" to "filename,trailing-comma-on-call-site,trailing-comma-on-declaration-site",
)
)
}
}

tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
//options.compilerArgs.add("-Xlint:unchecked")
options.compilerArgs.add("-parameters")
}

withType<KotlinCompile> {
Expand All @@ -44,4 +90,4 @@ tasks {
javaParameters = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ tasks {

developers {
developer {
id.set("matt")
id.set("Matt")
name.set("Mateus Moreira")
}
}
Expand All @@ -57,4 +57,4 @@ tasks {
}
}
}
}
}
19 changes: 19 additions & 0 deletions build-logic/src/main/kotlin/cmds.logger-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import org.gradle.accessors.dm.LibrariesForLibs

// Hack which exposes `libs` to this convention plugin
val libs = the<LibrariesForLibs>()

plugins {
`java-library`
}

repositories {
mavenCentral()
}

dependencies {
implementation(libs.logger.api)
implementation(libs.logger.core)
implementation(libs.logger.impl)
}
26 changes: 0 additions & 26 deletions build-logic/src/main/kotlin/cmds.parent-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,30 +1,4 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
kotlin("jvm")
}

repositories {
mavenCentral()
mavenLocal()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
//options.compilerArgs.add("-Xlint:unchecked")
}

withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
javaParameters = true
}
}
}
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ tasks {
test {
useJUnitPlatform()
}
}
}
Loading
Loading