-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
新增 发布不附带框架的软件包 优化 自动发布逻辑 优化 项目文件排除规则 修复 自动发布的软件包无法使用的问题 修复 英式英语语言文件命名错误的问题 调整 根据警告添加partial关键字 调整 补全菜单图标 调整 暂时禁用裁剪功能 调整 SDK版本 更新 策略配置文件至133.0.2992.0版本 更新 依赖项
- Loading branch information
Showing
33 changed files
with
2,290 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,13 @@ | ||
import fs from 'fs'; | ||
import {XMLParser, XMLBuilder} from 'fast-xml-parser'; | ||
|
||
(async () => { | ||
const {PUBLISH_VERSION, CONFIG} = process.env; | ||
|
||
const csprojPath = './PolicyManager.csproj'; | ||
const csprojData = fs.readFileSync(csprojPath); | ||
const csprojData = fs.readFileSync(csprojPath).toString(); | ||
|
||
// 解析XML | ||
const options = { | ||
ignoreAttributes: false, | ||
attributeNamePrefix: '@', | ||
suppressEmptyNode: true, | ||
format: CONFIG === 'Debug' | ||
}; | ||
|
||
const parser = new XMLParser(options); | ||
const csprojObj = parser.parse(csprojData); | ||
|
||
// 修改版本号 | ||
if (csprojObj.Project?.PropertyGroup) { | ||
const config = csprojObj.Project.PropertyGroup.find((item) => item["Version"]); | ||
if (!config) { | ||
console.log(JSON.stringify(csprojObj.Project.PropertyGroup)); | ||
throw new Error('Cannot find version property.'); | ||
} | ||
config["Version"] = PUBLISH_VERSION; | ||
} else { | ||
console.log(JSON.stringify(csprojObj)); | ||
throw new Error('Cannot find PropertyGroup.'); | ||
} | ||
|
||
// 转换为XML字符串 | ||
const builder = new XMLBuilder(options); | ||
const xml = builder.build(csprojObj); | ||
const xml = csprojData.replace("0.0.0.0", PUBLISH_VERSION); | ||
|
||
// 写回.csproj文件 | ||
fs.writeFileSync(csprojPath, xml); | ||
})(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.