Compare commits
10 commits
6173639cdd
...
749334493b
Author | SHA1 | Date | |
---|---|---|---|
749334493b | |||
9e49da5d56 | |||
ef9bbe6e1f | |||
491f451acb | |||
82b40a49b2 | |||
abc33d05f7 | |||
fedebc7ed4 | |||
310687cdce | |||
eed8277ed6 | |||
75ccf1a0ed |
8 changed files with 44 additions and 20 deletions
|
@ -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
|
||||
|
|
2
.github/workflows/bld.yml
vendored
2
.github/workflows/bld.yml
vendored
|
@ -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
|
||||
|
|
|
@ -19,6 +19,6 @@ before_script:
|
|||
test:
|
||||
stage: test
|
||||
script:
|
||||
- ./bld download
|
||||
- ./bld -Djitpack.token=$JITPACK_TOKEN download
|
||||
- ./bld compile
|
||||
- ./bld test
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue