@ alcops/ core (韩语)
自动检测商务中心的目标框架Moniker(TFM)并下载匹配的代码分析文件. 使用右侧分析器构建 AL 扩展, 不进行手动版本拼接 。 为CI/CD管道所设计.
特征
- 从四个不同来源检测出TFM:
- BC 工艺品 URL (例如沙盒或OnPrem文物)
- VS 市场 (AL语言扩展名)
- NuGet 开发工具 (微软的 AL 开发工具包)
- 本地编译器路径 (包含 AL 编译器 DLLs 的目录)
- 下载和提取 ALCops 分析器 DLLs 检测到的 TFM
- JSON 输出在 stdout, 日志在 stderr (方便管道)
- 需要零配置
- 可用作CLI或节点.js库
安装
# Install globally
npm install -g @alcops/core
# Or run directly with npx
npx @alcops/core detect-tfm marketplace
所需资源
- 节点.js 20
CLI 使用量
alcops <command> [args]
Commands:
detect-tfm bc-artifact <url> Detect TFM from a BC artifact URL
detect-tfm marketplace [channel|version] Detect TFM from VS Marketplace (default: current)
detect-tfm nuget-devtools [version|channel] Detect TFM from NuGet DevTools (default: latest)
detect-tfm compiler-path <dir> Detect TFM from a local compiler directory
download --output <dir> Download and extract ALCops analyzers
Download options:
--output <dir> Required. Directory to extract analyzer DLLs into
--detect-using <input> TFM detection input (URL, path, channel, or version)
--tfm <tfm> Explicit TFM (skips auto-detection)
--version <ver> ALCops package version (default: latest)
--detect-from <source> Force detection source (bc-artifact, marketplace,
nuget-devtools, compiler-path)
Global options:
--verbose Enable debug-level logging
--help Show this help message
实例
从VS市场检测(最常见的):
alcops detect-tfm marketplace
从特定的 NuGet DevTools 版本检测 :
alcops detect-tfm nuget-devtools 26.0.12345
从 BC 文物 URL 中检测到 :
alcops detect-tfm bc-artifact "https://bcartifacts.azureedge.net/sandbox/26.0.12345.0/us"
从本地编译器目录中检测 :
alcops detect-tfm compiler-path ./path/to/compiler
下载命令
这个 download 命令将 TFM 检测与分析器提取合并为一个步骤.
从 NuGet DevTools 自动检测到的 TFM 下载分析器 :
alcops download --detect-using latest --output ./analyzers
使用 BC 文物 URL 自动检测的 TFM 下载分析器 :
alcops download --detect-using "https://bcartifacts.azureedge.net/sandbox/26.0.12345.0/us" --output ./analyzers
从本地编译器目录下载自动检测的 TFM 分析器 :
alcops download --detect-using ./path/to/compiler --output ./analyzers
带有明确的 TFM( skips 检测) 的下载分析器 :
alcops download --tfm net8.0 --output ./analyzers
下载特定的ALCops版本 :
alcops download --detect-using latest --output ./analyzers --version 1.0.0
强制检测源 --detect-from (覆盖智能路由):
alcops download --detect-using 18.0.2293710 --detect-from marketplace --output ./analyzers
启用调试的动词记录 :
alcops download --detect-using latest --output ./analyzers --verbose
下载输出
{
"version": "1.0.0",
"tfm": "net8.0",
"outputDir": "/absolute/path/to/analyzers",
"files": [
"/absolute/path/to/analyzers/ALCops.Analyzers.dll"
]
}
产出
所有命令都写出 JSON 命令 :
{
"tfm": "net8.0",
"source": "marketplace",
"details": "AL Language extension v14.0.12345"
}
日志输入 stderr , 这样您就可以安全控制结果 :
TFM=$(alcops detect-tfm marketplace | jq -r '.tfm')
echo "Building with TFM: $TFM"
CI/CD 示例(GitHub 动作)
- name: Detect TFM
id: tfm
run: |
result=$(npx @alcops/core detect-tfm marketplace)
echo "tfm=$(echo "$result" | jq -r '.tfm')" >> "$GITHUB_OUTPUT"
- name: Use TFM
run: echo "Target framework is ${{ steps.tfm.outputs.tfm }}"
或者用那个 download 命令,用于单步解决方案 :
- name: Download ALCops Analyzers
run: npx @alcops/core download --detect-using latest --output ./analyzers --verbose
AL 18/BC 29号注解
- AL Language 18 VSIX将它的编译二进制平放于
extension/bin/(无)Analyzers/, (中文(简体) ),win32/, (中文(简体) ),linux/或者说darwin/文件夹). 探测器首先探测平面布局并倒回了后遗症路径,因此AL 18+和AL QQ 17的工作都没有改变. - 那些二进制目标 净额10.0 并依赖框架:与 AL 18 工具集相编译需要.NET 10运行时间在机器或代理上.
- 微软DevTools NuGet软件包两艘
net8.0财务报告和审定财务报表net10.0集会。 检测更喜欢最新的TFM,所以nuget-devtools报告net10.0。 。 。 . - 如果你的建筑运行
net8.0工具盘,用鼠标检测--detect-from compiler-path或完全跳过检测--tfm net8.0。 。 。 .
程序化 API
软件包导出所有检测功能用作库 :
import { detectFromMarketplace, createConsoleLogger } from '@alcops/core';
const logger = createConsoleLogger();
const result = await detectFromMarketplace('current', logger);
console.log(result.tfm); // e.g. "net8.0"
见 导出 API 表面 用于完整列出可用的函数和类型.
捐款
见 捐款额 (c) 促进发展的设置和贡献准则.