Skip to content

Commit

Permalink
Move quotes and thread pings, organize libs in catalogue
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Aug 28, 2024
1 parent e97d956 commit 09ea9bd
Show file tree
Hide file tree
Showing 30 changed files with 738 additions and 613 deletions.
60 changes: 23 additions & 37 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,57 +82,44 @@ configurations {
dependencies {
implementation project(':config')

api group: 'com.github.matyrobbrt', name: 'JDA-Chewtils', version: "${project.jda_chewtils_version}"
api group: 'net.dv8tion', name: 'JDA', version: "${project.jda_version}"
implementation group: 'com.google.guava', name: 'guava', version: "${project.guava_version}"
implementation group: 'com.google.code.gson', name: 'gson', version: "${project.gson_version}"
implementation group: 'ch.qos.logback', name: 'logback-classic', version: "${project.logback_version}"
api libs.chewtils
api libs.jda
implementation libs.trove4j

implementation group: 'org.flywaydb', name: 'flyway-core', version: project.flyway_version
implementation libs.bundles.jdbi
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: project.sqlite_version
implementation libs.guava
implementation libs.logback

implementation libs.bundles.database

// YML parsing and generation
implementation libs.bundles.jackson

// GitHub API interaction library
implementation group: 'org.kohsuke', name: 'github-api', version: project.ghapi_version
implementation libs.githubapi
// GitHub api JWT generation
implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: project.jjwt_version
implementation group: 'io.jsonwebtoken', name: 'jjwt-impl', version: project.jjwt_version
implementation group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: project.jjwt_version
implementation libs.bundles.jjwt
// Converting private keys for GitHub auth
implementation group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version: project.bcpkix_version

// JDA runtime dependency that we use for custom snowflake views
implementation group: 'net.sf.trove4j', name: 'trove4j', version: project.trove4j_version

// implementation group: 'club.minnced', name: 'discord-webhooks', version: project.discord_webhooks_version
implementation group: 'net.sf.jopt-simple', name: 'jopt-simple', version: project.jopt_version // Used by tricks
implementation libs.bcpkix

implementation group: 'org.graalvm.js', name: 'js', version: project.graal_version
implementation group: 'org.graalvm.js', name: 'js-scriptengine', version: project.graal_version
implementation group: 'args4j', name: 'args4j', version: project.arg4j_version
implementation group: 'com.google.re2j', name: 're2j', version: project.re2j_version
implementation group: 'it.unimi.dsi', name: 'fastutil', version: project.fastutil_version
implementation libs.bundles.graal
implementation libs.args4j
implementation libs.re2j
implementation libs.fastutil

implementation group: 'com.matyrobbrt', name: 'semver-graaljs', version: project.semver_version
implementation group: 'org.apache.maven', name: 'maven-artifact', version: project.maven_artifact_version
implementation("io.javalin:javalin:${project.javalin_version}") {
implementation libs.semver
implementation libs.mavenartifact
implementation(libs.javalin.get()) {
exclude module: 'slf4j-api'
}
implementation("com.j2html:j2html:${project.j2html_version}")
implementation("org.eclipse.angus:angus-mail:${project.angus_mail_version}")
implementation "org.json:json:${project.json_version}"
implementation libs.j2html
implementation libs.angusmail
implementation libs.json

compileOnly group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
compileOnly(annotationProcessor(libs.autoservice.get()))

compileOnly 'org.jetbrains:annotations:24.0.1'
compileOnlyApi(libs.annotations)

testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_version")
testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit_version")
testImplementation('org.assertj:assertj-core:3.25.1')
testImplementation(libs.bundles.testing)

project(':modules').subprojects.each {
library(project(path: it.path, configuration: 'library'))
Expand All @@ -154,7 +141,6 @@ jar {
'Implementation-Vendor': 'NeoForged',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Built-On-Java': "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On': "${project.jda_version}-${project.jda_chewtils_version}",
'Main-Class': 'net.neoforged.camelot.BotMain'
])
}
Expand Down
8 changes: 3 additions & 5 deletions buildSrc/src/main/groovy/camelot-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ dependencies {
"configOut"(compileOnly(sourceSets.config.output))
"configOutSrc"(sourceSets.config.allSource)

compileOnly group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
compileOnly(annotationProcessor(libs.autoservice.get()))

implementation(project(':'))
}
Expand Down Expand Up @@ -85,13 +84,12 @@ tasks.register('createDBFolder') {
}

private static void writeOrMove(File file, File source, String txt) {
file.delete()
file.parentFile.mkdirs()
if (source?.exists()) {
file.delete()
file << source.text
source.delete()
} else {
file.delete()
file.parentFile.mkdirs()
file << txt
}
}
5 changes: 2 additions & 3 deletions config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ tasks.register('groovydocJar', Jar) {
}

dependencies {
api "org.apache.groovy:groovy:${project.groovy_version}"
api "org.apache.groovy:groovy-contracts:${project.groovy_version}"
api group: 'org.kohsuke', name: 'github-api', version: project.ghapi_version
api libs.bundles.groovy
api libs.githubapi

sampleCompileOnly(sourceSets.main.output)

Expand Down
28 changes: 0 additions & 28 deletions gradle.properties

This file was deleted.

68 changes: 68 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[versions]
graal = "22.2.0"
groovy = "4.0.21"
jdbi = "3.32.0"
jackson = "2.13.3"
jjwt = "0.10.5"
junit = "5.10.0"

[libraries]

angusmail = { module = "org.eclipse.angus:angus-mail", version = "2.0.1" }
annotations = { module = "org.jetbrains:annotations", version = "24.0.1" }
args4j = { module = "args4j:args4j", version = "2.33" }
assertj = { module = "org.assertj:assertj-core", version = "3.25.1" }
autoservice = { module = "com.google.auto.service:auto-service", version = "1.0.1" }

bcpkix = { module = "org.bouncycastle:bcpkix-jdk15on", version = "1.58" }

chewtils = { module = "com.github.matyrobbrt:JDA-Chewtils", version = "cea80c2" }

fastutil = { module = "it.unimi.dsi:fastutil", version = "8.5.12" }
flyway = { module = "org.flywaydb:flyway-core", version = "8.5.13" }

githubapi = { module = "org.kohsuke:github-api", version = "1.313" }
graal-js = { module = "org.graalvm.js:js", version.ref = "graal" }
graal-js-scriptengine = { module = "org.graalvm.js:js-scriptengine", version.ref = "graal" }

groovy = { module = "org.apache.groovy:groovy", version.ref = "groovy" }
groovy-contracts = { module = "org.apache.groovy:groovy-contracts", version.ref = "groovy" }

guava = { module = "com.google.guava:guava", version = "30.1.1-jre" }

jda = { module = "net.dv8tion:JDA", version = "5.0.1" }

jdbi-core = { module = "org.jdbi:jdbi3-core", version.ref = "jdbi" }
jdbi-sqlobject = { module = "org.jdbi:jdbi3-sqlobject", version.ref = "jdbi" }

j2html = { module = "com.j2html:j2html", version = "1.6.0" }

jackson-yaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" }
javalin = { module = "io.javalin:javalin", version = "5.6.1" }

jjwt-api = { module = "io.jsonwebtoken:jjwt-api", version.ref = "jjwt" }
jjwt-impl = { module = "io.jsonwebtoken:jjwt-impl", version.ref = "jjwt" }
jjwt-jackson = { module = "io.jsonwebtoken:jjwt-jackson", version.ref = "jjwt" }

json = { module = "org.json:json", version = "20231013" }
junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }
junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }

logback = { module = "ch.qos.logback:logback-classic", version = "1.5.6" }

mavenartifact = { module = "org.apache.maven:maven-artifact", version = "3.9.1" }

re2j = { module = "com.google.re2j:re2j", version = "1.7" }

semver = { module = "com.matyrobbrt:semver-graaljs", version = "1.1.0" }
sqlitejdbc = { module = "org.xerial:sqlite-jdbc", version = "3.40.0.0" }

trove4j = { module = "net.sf.trove4j:trove4j", version = "3.0.3" }

[bundles]
graal = ["graal-js", "graal-js-scriptengine"]
groovy = ["groovy", "groovy-contracts"]
database = ["jdbi-core", "jdbi-sqlobject", "flyway", "sqlitejdbc"]
jackson = ["jackson-yaml"]
jjwt = ["jjwt-api", "jjwt-impl", "jjwt-jackson"]
testing = ["assertj", "junit-api", "junit-engine"]
2 changes: 1 addition & 1 deletion modules/info-channels/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ camelotModule {
}

dependencies {
library(libs.bundles.jdbi)
library(libs.bundles.database)
library(libs.bundles.jackson)
}
11 changes: 11 additions & 0 deletions modules/quotes/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
plugins {
id 'camelot-module'
}

camelotModule {
id = 'quotes'
}

dependencies {
library(libs.bundles.database)
}
Loading

0 comments on commit 09ea9bd

Please sign in to comment.