Skip to content

Commit

Permalink
ci: ✨ 添加快速构建脚本,附带发行版配置
Browse files Browse the repository at this point in the history
现在可通过运行build.bat直接从源码构建「发行版CLI」到dist目录下
  • Loading branch information
ARCJ137442 committed Apr 19, 2024
1 parent 2ce701f commit b787f18
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# 目标文件/可分发文件
/target
/dist

# 可执行文件
# * 🚩【2024-04-07 08:42:13】目前内置被忽略的CIN可执行文件,用于稳定的测试代码编写
Expand Down
31 changes: 31 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions config_public/cin_cxin_js.hjson
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 15 additions & 0 deletions config_public/cin_native_il_1.hjson
Original file line number Diff line number Diff line change
@@ -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
}
20 changes: 20 additions & 0 deletions config_public/cin_ona.hjson
Original file line number Diff line number Diff line change
@@ -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
}
26 changes: 26 additions & 0 deletions config_public/cin_opennars.hjson
Original file line number Diff line number Diff line change
@@ -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
}
26 changes: 26 additions & 0 deletions config_public/cin_opennars_158.hjson
Original file line number Diff line number Diff line change
@@ -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
}
21 changes: 21 additions & 0 deletions config_public/cin_pynars.hjson
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit b787f18

Please sign in to comment.