Compare commits

..

No commits in common. "749334493bca7090c1fcb549a064802995c30e4a" and "6173639cdd9cc2fb3b093aa2fdfa600dafd12899" have entirely different histories.

8 changed files with 20 additions and 44 deletions

View file

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

View file

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

View file

@ -19,6 +19,6 @@ before_script:
test:
stage: test
script:
- ./bld -Djitpack.token=$JITPACK_TOKEN download
- ./bld 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 -Djitpack.token=$JITPACK_TOKEN download
- ./bld 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.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-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-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,6 +39,7 @@ 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;
@ -51,9 +52,6 @@ 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;
@ -67,7 +65,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";
@ -77,7 +75,7 @@ public class MobibotBuild extends Project {
repositories = List.of(
MAVEN_LOCAL,
MAVEN_CENTRAL,
new Repository("https://jitpack.io").withCredentials(property("jitpack.token"), "."),
new Repository("https://jitpack.io"),
SONATYPE_SNAPSHOTS_LEGACY);
var log4j = version(2, 24, 3);
@ -88,18 +86,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.1"))
.include(dependency("org.apache.commons", "commons-text", "1.13.0"))
.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.13.0"))
.include(dependency("com.google.code.gson", "gson", "2.12.1"))
.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.2"))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.10.1"))
.include(dependency("org.jetbrains.kotlinx", "kotlinx-cli-jvm", "0.3.6"))
// Logging
.include(dependency("org.slf4j", "slf4j-api", "2.0.17"))
@ -126,9 +124,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, 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)));
.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)));
List<String> jars = new ArrayList<>();
runtimeClasspathJars().forEach(f -> jars.add("./lib/" + f.getName()));
@ -141,15 +139,6 @@ 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);
}
@ -166,8 +155,10 @@ 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(new CompileOptions().progressive(true).verbose(true))
.compileOptions(options)
.fromProject(this)
.execute();
}

View file

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

View file

@ -39,9 +39,6 @@ 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 {
@ -72,16 +69,4 @@ 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
}
}
}
}