Compare commits

...

10 commits

Author SHA1 Message Date
749334493b
Add JitPack token 2025-04-18 15:55:57 -07:00
9e49da5d56
Bump Kotlinx Coroutines to version 1.10.2 2025-04-13 13:30:58 -07:00
ef9bbe6e1f
Bump Gson to version 2.13.0 2025-04-13 13:30:30 -07:00
491f451acb
Bump Commons Text to version 1.13.1 2025-04-13 13:30:07 -07:00
82b40a49b2
Update extensions
Bump JaCoCo Reports to version 0.9.10
Bump Generated Version to version 1.0.1
2025-04-13 13:29:32 -07:00
abc33d05f7
Bump JUnit to version 5.12.2 2025-04-13 13:28:38 -07:00
fedebc7ed4
Cleanup compile command 2025-03-26 23:34:14 -07:00
310687cdce
Update to latest extensions snapshots 2025-03-26 23:33:32 -07:00
eed8277ed6
Add API response logging 2025-03-26 23:32:56 -07:00
75ccf1a0ed
Set progressive compiling 2025-03-23 20:02:55 -07:00
8 changed files with 44 additions and 20 deletions

View file

@ -24,7 +24,7 @@ commands:
version: 2.1.10
- run:
name: Download dependencies
command: ./bld download
command: ./bld -Djitpack.token=$JITPACK_TOKEN download
- run:
name: Compile source
command: ./bld compile

View file

@ -41,7 +41,7 @@ jobs:
run: ./bld download
- name: Compile source
run: ./bld compile
run: ./bld -Djitpack.token=${{ secrets.JITPACK_TOKEN }} compile
- name: Run tests
run: ./bld jacoco

View file

@ -19,6 +19,6 @@ before_script:
test:
stage: test
script:
- ./bld download
- ./bld -Djitpack.token=$JITPACK_TOKEN download
- ./bld compile
- ./bld test

View file

@ -15,6 +15,6 @@ pipelines:
- sdk install kotlin
- source "$HOME/.sdkman/bin/sdkman-init.sh"
# Download, compile and test with bld
- ./bld download
- ./bld -Djitpack.token=$JITPACK_TOKEN download
- ./bld compile
- ./bld test

View file

@ -1,9 +1,9 @@
bld.downloadExtensionJavadoc=false
bld.downloadExtensionSources=true
bld.downloadLocation=
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.9
bld.extension-gv=com.uwyn.rife2:bld-generated-version:1.0.0
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.9
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.10-SNAPSHOT
bld.extension-gv=com.uwyn.rife2:bld-generated-version:1.0.1
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.10
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.1.0-SNAPSHOT
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
bld.sourceDirectories=

View file

@ -39,7 +39,6 @@ import rife.bld.extension.DetektOperation;
import rife.bld.extension.GeneratedVersionOperation;
import rife.bld.extension.JacocoReportOperation;
import rife.bld.extension.kotlin.CompileOptions;
import rife.bld.extension.kotlin.JvmOptions;
import rife.bld.operations.exceptions.ExitStatusException;
import rife.bld.publish.PomBuilder;
import rife.tools.FileUtils;
@ -52,6 +51,9 @@ import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.jar.Attributes;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import static rife.bld.dependencies.Repository.*;
import static rife.bld.dependencies.Scope.compile;
@ -65,7 +67,7 @@ public class MobibotBuild extends Project {
pkg = "net.thauvin.erik.mobibot";
name = "mobibot";
version = version(0, 8, 0, "rc+" +
DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()));
DateTimeFormatter.ofPattern("yyyyMMddHHmmss").format(LocalDateTime.now()));
mainClass = pkg + ".Mobibot";
@ -75,7 +77,7 @@ public class MobibotBuild extends Project {
repositories = List.of(
MAVEN_LOCAL,
MAVEN_CENTRAL,
new Repository("https://jitpack.io"),
new Repository("https://jitpack.io").withCredentials(property("jitpack.token"), "."),
SONATYPE_SNAPSHOTS_LEGACY);
var log4j = version(2, 24, 3);
@ -86,18 +88,18 @@ public class MobibotBuild extends Project {
.include(dependency("com.github.pircbotx", "pircbotx", "2.3.1"))
// Commons (mostly for PircBotX)
.include(dependency("org.apache.commons", "commons-lang3", "3.17.0"))
.include(dependency("org.apache.commons", "commons-text", "1.13.0"))
.include(dependency("org.apache.commons", "commons-text", "1.13.1"))
.include(dependency("commons-codec", "commons-codec", "1.18.0"))
.include(dependency("commons-net", "commons-net", "3.11.1"))
// Google
.include(dependency("com.google.code.gson", "gson", "2.12.1"))
.include(dependency("com.google.code.gson", "gson", "2.13.0"))
.include(dependency("com.google.guava", "guava", "33.2.1-jre"))
// Kotlin
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib", kotlin))
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-common", kotlin))
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk7", kotlin))
.include(dependency("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", kotlin))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.10.1"))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.10.2"))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-cli-jvm", "0.3.6"))
// Logging
.include(dependency("org.slf4j", "slf4j-api", "2.0.17"))
@ -124,9 +126,9 @@ public class MobibotBuild extends Project {
scope(test)
.include(dependency("com.willowtreeapps.assertk", "assertk-jvm", version(0, 28, 1)))
.include(dependency("org.jetbrains.kotlin", "kotlin-test-junit5", kotlin))
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 1)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 1)))
.include(dependency("org.junit.platform", "junit-platform-launcher", version(1, 12, 1)));
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 12, 2)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 12, 2)))
.include(dependency("org.junit.platform", "junit-platform-launcher", version(1, 12, 2)));
List<String> jars = new ArrayList<>();
runtimeClasspathJars().forEach(f -> jars.add("./lib/" + f.getName()));
@ -139,6 +141,15 @@ public class MobibotBuild extends Project {
}
public static void main(String[] args) {
var level = Level.ALL;
var logger = Logger.getLogger("rife.bld.extension");
var consoleHandler = new ConsoleHandler();
consoleHandler.setLevel(level);
logger.addHandler(consoleHandler);
logger.setLevel(level);
logger.setUseParentHandlers(false);
new MobibotBuild().start(args);
}
@ -155,10 +166,8 @@ public class MobibotBuild extends Project {
@Override
public void compile() throws Exception {
releaseInfo();
var options = new CompileOptions().verbose(true);
options.jvmOptions().enableNativeAccess(JvmOptions.ALL_UNNAMED);
new CompileKotlinOperation()
.compileOptions(options)
.compileOptions(new CompileOptions().progressive(true).verbose(true))
.fromProject(this)
.execute();
}

View file

@ -52,7 +52,7 @@ class CryptoPrices : AbstractModule() {
/**
* Returns the cryptocurrency market price from
* [Coinbase](https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-prices#get-spot-price).
* [Coinbase](https://docs.cdp.coinbase.com/coinbase-app/docs/api-prices#get-spot-price).
*/
override fun commandResponse(channel: String, cmd: String, args: String, event: GenericMessageEvent) {
if (CURRENCIES.isEmpty()) {

View file

@ -39,6 +39,9 @@ import net.thauvin.erik.crypto.CryptoPrice
import net.thauvin.erik.mobibot.modules.CryptoPrices.Companion.currentPrice
import net.thauvin.erik.mobibot.modules.CryptoPrices.Companion.getCurrencyName
import net.thauvin.erik.mobibot.modules.CryptoPrices.Companion.loadCurrencies
import org.junit.jupiter.api.BeforeAll
import java.util.logging.ConsoleHandler
import java.util.logging.Level
import kotlin.test.Test
class CryptoPricesTest {
@ -69,4 +72,16 @@ class CryptoPricesTest {
assertThat(getCurrencyName("USD"), "USD").isEqualTo("United States Dollar")
assertThat(getCurrencyName("EUR"), "EUR").isEqualTo("Euro")
}
companion object {
@JvmStatic
@BeforeAll
fun beforeAll() {
with(CryptoPrice.logger) {
addHandler(ConsoleHandler().apply { level = Level.FINE })
level = Level.FINE
useParentHandlers = false
}
}
}
}