From b787f18de9db8f9ab7ffff47f673025c1e31fc57 Mon Sep 17 00:00:00 2001 From: ARCJ137442 <61109168+ARCJ137442@users.noreply.github.com> Date: Fri, 19 Apr 2024 23:41:16 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20:sparkles:=20=E6=B7=BB=E5=8A=A0=E5=BF=AB?= =?UTF-8?q?=E9=80=9F=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=EF=BC=8C=E9=99=84?= =?UTF-8?q?=E5=B8=A6=E5=8F=91=E8=A1=8C=E7=89=88=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 现在可通过运行build.bat直接从源码构建「发行版CLI」到dist目录下 --- .gitignore | 2 ++ build.bat | 31 ++++++++++++++++++++++++++++ config_public/cin_cxin_js.hjson | 24 +++++++++++++++++++++ config_public/cin_native_il_1.hjson | 15 ++++++++++++++ config_public/cin_ona.hjson | 20 ++++++++++++++++++ config_public/cin_opennars.hjson | 26 +++++++++++++++++++++++ config_public/cin_opennars_158.hjson | 26 +++++++++++++++++++++++ config_public/cin_pynars.hjson | 21 +++++++++++++++++++ 8 files changed, 165 insertions(+) create mode 100644 build.bat create mode 100644 config_public/cin_cxin_js.hjson create mode 100644 config_public/cin_native_il_1.hjson create mode 100644 config_public/cin_ona.hjson create mode 100644 config_public/cin_opennars.hjson create mode 100644 config_public/cin_opennars_158.hjson create mode 100644 config_public/cin_pynars.hjson diff --git a/.gitignore b/.gitignore index 1720687..92fa8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ +# 目标文件/可分发文件 /target +/dist # 可执行文件 # * 🚩【2024-04-07 08:42:13】目前内置被忽略的CIN可执行文件,用于稳定的测试代码编写 diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..c59d83b --- /dev/null +++ b/build.bat @@ -0,0 +1,31 @@ +@REM BabelNAR CLI 轻量级发行版 +@REM * 将BabelNAR CLI、预设好的可执行文件和指定CIN集成在一个目录下 +@REM * 可实现「一次打包,到处解压,双击运行」 +@echo off + +@REM 构建BabelNAR CLI(基于cargo) +cargo b -r --bin babelnar_cli + +@REM 重置dist文件夹 +rm -rf dist +mkdir .\dist + +@REM ==拷贝各个文件到指定目录== REM@ + +@REM 公共配置 +xcopy /E /I .\config_public .\dist\nars_config + +@REM 拷贝BabelNAR CLI +copy .\target\release\babelnar_cli.exe .\dist + +@REM 拷贝指定的可执行文件 +xcopy /E /I .\executables\PyNARS .\dist\executables\PyNARS +copy .\executables\cxin-nars-shell.js .\dist\executables\cxin-nars-shell.js +copy .\executables\native-IL-1.exe .\dist\executables\native-IL-1.exe +copy .\executables\ONA.exe .\dist\executables\ONA.exe +copy .\executables\opennars-158-shell.jar .\dist\executables\opennars-158-shell.jar +copy .\executables\opennars-304-T-modified.jar .\dist\executables\opennars-304-T-modified.jar +copy .\executables\opennars-matriangle-test.log.json .\dist\executables\opennars-matriangle-test.log.json + +echo "Build Successfull!" +sleep 1 diff --git a/config_public/cin_cxin_js.hjson b/config_public/cin_cxin_js.hjson new file mode 100644 index 0000000..d68a7ca --- /dev/null +++ b/config_public/cin_cxin_js.hjson @@ -0,0 +1,24 @@ +#hjson +// CXin JS +// * 🎯配置启动CXinNARS +// * @Author 孙常新 +// * ⚠️需要Node.js启动 +// * 🔗中文官网:https://nodejs.org/zh-cn +{ + description: "CXinNARS(基于Node.js运行时,从源码启动)" + // 输入输出转译器 + translators: "cxin_js" + // 启动命令 + command: { + // * ⚠️必须前缀`./`以指定是「启动当前工作目录下的exe文件」 + cmd: node + cmdArgs: [ + cxin-nars-shell.js + shell + ] + // 启动目录 + currentDir: ./../executables + } + // 自动重启 + autoRestart: true +} \ No newline at end of file diff --git a/config_public/cin_native_il_1.hjson b/config_public/cin_native_il_1.hjson new file mode 100644 index 0000000..e1753f1 --- /dev/null +++ b/config_public/cin_native_il_1.hjson @@ -0,0 +1,15 @@ +#hjson +// * 🎯用于测试原生「IL-1」运行时 +// * ✨基于NAVM,纯Rust编写 +{ + description: Native IL-1(基于NAVM的独立exe,使用纯Rust编写) + translators: native + command: { + // * ⚠️必须前缀`./`以指定是「启动当前工作目录下的exe文件」 + cmd: ./native-IL-1.exe + cmdArgs: [] + // 启动目录 + currentDir: ./../executables + } + autoRestart: true +} \ No newline at end of file diff --git a/config_public/cin_ona.hjson b/config_public/cin_ona.hjson new file mode 100644 index 0000000..c484571 --- /dev/null +++ b/config_public/cin_ona.hjson @@ -0,0 +1,20 @@ +#hjson +// ONA +// * 🎯配置启动ONA +// * 🔗官网:https://github.com/opennars/OpenNARS-for-Applications +// * ⚠️启动需要cygwin +// * 🔗中文官网: http://www.cygwin.cn/ +{ + description: ONA (OpenNARS for Applications)(独立exe,需要cygwin) + translators: ona + command: { + // * ⚠️必须前缀`./`以指定是「启动当前工作目录下的exe文件」 + cmd: ./ONA.exe + cmdArgs: [ + shell + ] + // 启动目录 + currentDir: ./../executables + } + autoRestart: true +} \ No newline at end of file diff --git a/config_public/cin_opennars.hjson b/config_public/cin_opennars.hjson new file mode 100644 index 0000000..efc604d --- /dev/null +++ b/config_public/cin_opennars.hjson @@ -0,0 +1,26 @@ +#hjson +// OpenNARS +// * 🎯配置启动OpenNARS +// * 🔗官网:http://www.opennars.org/ +// * ⚠️需要Java启动 +// * 🔗中文官网:https://www.java.com/zh_CN/ +{ + description: "OpenNARS(jar文件,需要Java运行时JRE)" + // 转译器 + translators: "opennars" + // 启动命令 + command: { + // 命令:启动java运行时 + cmd: "java" + // 传入的命令参数 + cmdArgs: [ + // 启动jar包 + -jar + ./opennars-304-T-modified.jar + ] + // 启动目录 + currentDir: ./../executables + } + // 自动重启 + autoRestart: true +} \ No newline at end of file diff --git a/config_public/cin_opennars_158.hjson b/config_public/cin_opennars_158.hjson new file mode 100644 index 0000000..58cc720 --- /dev/null +++ b/config_public/cin_opennars_158.hjson @@ -0,0 +1,26 @@ +#hjson +// OpenNARS +// * 🎯配置启动OpenNARS +// * 🔗官网:https://github.com/patham9/opennars_declarative_core +// * ⚠️需要Java启动 +// * 🔗中文官网:https://www.java.com/zh_CN/ +{ + description: "OpenNARS 1.5.8(jar文件,需要Java运行时JRE)" + // 转译器 + translators: "opennars" + // 启动命令 + command: { + // 命令:启动java运行时 + cmd: "java" + // 传入的命令参数 + cmdArgs: [ + // 启动jar包 + -jar + ./opennars-158-shell.jar + ] + // 启动目录 + currentDir: ./../executables + } + // 自动重启 + autoRestart: true +} \ No newline at end of file diff --git a/config_public/cin_pynars.hjson b/config_public/cin_pynars.hjson new file mode 100644 index 0000000..b0a7380 --- /dev/null +++ b/config_public/cin_pynars.hjson @@ -0,0 +1,21 @@ +// PyNARS +// * 🎯配置启动PyNARS +// * 🔗官网:https://github.com/bowen-xu/PyNARS +// * ⚠️需要Python(从源码)启动 +// * 🔗官网:http://python.org/ +// * ℹ️推荐版本:3.10+ +{ + description: PyNARS(基于Python运行时,从源码启动) + translators: pynars + command: { + cmd: python + cmdArgs: [ + "-m" + // * 🚩【2024-04-07 14:41:20】使用扩展了「附加指令」的「高级控制台」 + pynars.ConsolePlus + ] + // 启动目录 + currentDir: ./../executables/PyNARS + } + autoRestart: true +} \ No newline at end of file