Compare commits
7 commits
ff98e39b0c
...
700369d7c9
Author | SHA1 | Date | |
---|---|---|---|
700369d7c9 | |||
64bd5c92af | |||
83b4b18be7 | |||
f27501634c | |||
fcbfe63aee | |||
4b908d596e | |||
97e1e5e73b |
10 changed files with 73 additions and 46 deletions
4
.github/workflows/bld.yml
vendored
4
.github/workflows/bld.yml
vendored
|
@ -22,8 +22,8 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [17, 21, 22]
|
||||
kotlin-version: [1.9.24, 2.0.20]
|
||||
java-version: [17, 21, 23]
|
||||
kotlin-version: [1.9.24, 2.0.20, 2.1.0]
|
||||
|
||||
steps:
|
||||
- name: Checkout source repository
|
||||
|
|
16
.idea/kotlinc.xml
generated
Normal file
16
.idea/kotlinc.xml
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Kotlin2JsCompilerArguments">
|
||||
<option name="moduleKind" value="plain" />
|
||||
</component>
|
||||
<component name="Kotlin2JvmCompilerArguments">
|
||||
<option name="jvmTarget" value="17" />
|
||||
</component>
|
||||
<component name="KotlinCommonCompilerArguments">
|
||||
<option name="apiVersion" value="2.0" />
|
||||
<option name="languageVersion" value="2.0" />
|
||||
</component>
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="2.1.0" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,7 +1,7 @@
|
|||
# mobibot
|
||||
|
||||
[](https://opensource.org/licenses/BSD-3-Clause)
|
||||
[](https://kotlinlang.org)
|
||||
[](https://kotlinlang.org)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://sonarcloud.io/summary/new_code?id=ethauvin_mobibot)
|
||||
[](https://github.com/ethauvin/mobibot/actions/workflows/bld.yml)
|
||||
|
|
11
deploy.fish
Executable file
11
deploy.fish
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env fish
|
||||
|
||||
./bld clean jar deploy
|
||||
if test $status -eq 0
|
||||
echo "cd /home/mobibot/mobitopia/mobibot
|
||||
lcd deploy
|
||||
put *.jar
|
||||
cd lib
|
||||
rm *.jar
|
||||
put lib/*.jar" | sftp nix4
|
||||
end
|
11
deploy.sh
11
deploy.sh
|
@ -1,11 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
./bld clean jar deploy
|
||||
[ $? -eq 0 ] && sftp nix4.thauvin.us <<EOF
|
||||
cd /home/mobibot/mobitopia/mobibot
|
||||
lcd deploy
|
||||
put *.jar
|
||||
cd lib
|
||||
rm *.jar
|
||||
put lib/*.jar
|
||||
EOF
|
|
@ -4,7 +4,7 @@ bld.downloadLocation=
|
|||
bld.extension-detekt=com.uwyn.rife2:bld-detekt:0.9.7
|
||||
bld.extension-gv=com.uwyn.rife2:bld-generated-version:0.9.9
|
||||
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.8
|
||||
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.2
|
||||
bld.extension-kotlin=com.uwyn.rife2:bld-kotlin:1.0.3
|
||||
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||
bld.sourceDirectories=
|
||||
bld.version=2.1.0
|
||||
|
|
4
pom.xml
4
pom.xml
|
@ -4,7 +4,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.thauvin.erik.mobibot</groupId>
|
||||
<artifactId>mobibot</artifactId>
|
||||
<version>0.8.0-rc+20240908192921</version>
|
||||
<version>0.8.0-rc+20240918181213</version>
|
||||
<name>mobibot</name>
|
||||
<description></description>
|
||||
<url></url>
|
||||
|
@ -78,7 +78,7 @@
|
|||
<dependency>
|
||||
<groupId>org.jetbrains.kotlinx</groupId>
|
||||
<artifactId>kotlinx-coroutines-core</artifactId>
|
||||
<version>1.8.1</version>
|
||||
<version>1.9.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -45,7 +45,6 @@ import rife.tools.exceptions.FileUtilsErrorException;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
|
@ -77,15 +76,15 @@ public class MobibotBuild extends Project {
|
|||
new Repository("https://jitpack.io"),
|
||||
SONATYPE_SNAPSHOTS_LEGACY);
|
||||
|
||||
var log4j = version(2, 24, 0);
|
||||
var kotlin = version(2, 0, 20);
|
||||
var langchain = version(0, 34, 0);
|
||||
var log4j = version(2, 24, 3);
|
||||
var kotlin = version(2, 1, 0);
|
||||
var langchain = version(0, 36, 2);
|
||||
scope(compile)
|
||||
// PircBotX
|
||||
.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.12.0"))
|
||||
.include(dependency("org.apache.commons", "commons-text", "1.13.0"))
|
||||
.include(dependency("commons-codec", "commons-codec", "1.17.1"))
|
||||
.include(dependency("commons-net", "commons-net", "3.11.1"))
|
||||
// Google
|
||||
|
@ -96,7 +95,7 @@ public class MobibotBuild extends Project {
|
|||
.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.8.1"))
|
||||
.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.16"))
|
||||
|
@ -114,17 +113,17 @@ public class MobibotBuild extends Project {
|
|||
.include(dependency("net.aksingh", "owm-japis", "2.5.3.0"))
|
||||
.include(dependency("net.objecthunter", "exp4j", "0.4.8"))
|
||||
.include(dependency("org.json", "json", "20240303"))
|
||||
.include(dependency("org.jsoup", "jsoup", "1.18.1"))
|
||||
.include(dependency("org.jsoup", "jsoup", "1.18.3"))
|
||||
// Thauvin
|
||||
.include(dependency("net.thauvin.erik", "cryptoprice", "1.0.3-SNAPSHOT"))
|
||||
.include(dependency("net.thauvin.erik", "jokeapi", "0.9.2-SNAPSHOT"))
|
||||
.include(dependency("net.thauvin.erik", "pinboard-poster", "1.1.2-SNAPSHOT"))
|
||||
.include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", "1.5.0"));
|
||||
.include(dependency("net.thauvin.erik.urlencoder", "urlencoder-lib-jvm", "1.6.0"));
|
||||
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, 11, 0)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 0)));
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 11, 4)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 11, 4)));
|
||||
|
||||
List<String> jars = new ArrayList<>();
|
||||
runtimeClasspathJars().forEach(f -> jars.add("./lib/" + f.getName()));
|
||||
|
@ -142,7 +141,10 @@ public class MobibotBuild extends Project {
|
|||
|
||||
@Override
|
||||
public void clean() throws Exception {
|
||||
FileUtils.deleteDirectory(new File("deploy"));
|
||||
var deploy = new File("deploy");
|
||||
if (deploy.exists()) {
|
||||
FileUtils.deleteDirectory(deploy);
|
||||
}
|
||||
super.clean();
|
||||
}
|
||||
|
||||
|
@ -150,9 +152,11 @@ public class MobibotBuild extends Project {
|
|||
@Override
|
||||
public void compile() throws Exception {
|
||||
releaseInfo();
|
||||
new CompileKotlinOperation()
|
||||
.fromProject(this)
|
||||
.execute();
|
||||
var op = new CompileKotlinOperation()
|
||||
.kotlinHome("/opt/kotlinc/")
|
||||
.fromProject(this);
|
||||
op.compileOptions().verbose(true);
|
||||
op.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -201,6 +205,12 @@ public class MobibotBuild extends Project {
|
|||
.execute();
|
||||
}
|
||||
|
||||
@BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
|
||||
public void pomRoot() throws FileUtilsErrorException {
|
||||
PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
|
||||
new File(workDirectory, "pom.xml"));
|
||||
}
|
||||
|
||||
@BuildCommand(value = "release-info", summary = "Generates the ReleaseInfo class")
|
||||
public void releaseInfo() throws Exception {
|
||||
new GeneratedVersionOperation()
|
||||
|
@ -212,10 +222,4 @@ public class MobibotBuild extends Project {
|
|||
.extension(".kt")
|
||||
.execute();
|
||||
}
|
||||
|
||||
@BuildCommand(value = "pom-root", summary = "Generates the POM file in the root directory")
|
||||
public void pomRoot() throws FileUtilsErrorException {
|
||||
PomBuilder.generateInto(publishOperation().fromProject(this).info(), dependencies(),
|
||||
new File(workDirectory, "pom.xml"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -421,14 +421,22 @@ object Utils {
|
|||
@Throws(IOException::class)
|
||||
fun URL.reader(): UrlReaderResponse {
|
||||
val connection = this.openConnection() as HttpURLConnection
|
||||
connection.setRequestProperty(
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
|
||||
)
|
||||
return if (connection.responseCode.isHttpSuccess()) {
|
||||
UrlReaderResponse(connection.responseCode, connection.inputStream.bufferedReader().use { it.readText() })
|
||||
} else {
|
||||
UrlReaderResponse(connection.responseCode, connection.errorStream.bufferedReader().use { it.readText() })
|
||||
try {
|
||||
connection.setRequestProperty(
|
||||
"User-Agent",
|
||||
"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0"
|
||||
)
|
||||
return if (connection.responseCode.isHttpSuccess()) {
|
||||
UrlReaderResponse(
|
||||
connection.responseCode,
|
||||
connection.inputStream.bufferedReader().use { it.readText() })
|
||||
} else {
|
||||
UrlReaderResponse(
|
||||
connection.responseCode,
|
||||
connection.errorStream.bufferedReader().use { it.readText() })
|
||||
}
|
||||
} finally {
|
||||
connection.disconnect()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.slf4j.Logger
|
|||
import org.slf4j.LoggerFactory
|
||||
import java.util.*
|
||||
|
||||
|
||||
class Gemini2 : AbstractModule() {
|
||||
private val logger: Logger = LoggerFactory.getLogger(Gemini2::class.java)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue