6.7.0 - Alpha6 - 重构 scrapers 工具并增加中英双语注释内容
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// scrape-android-studio-agp_version_maps.mjs
|
||||
|
||||
import { compareVersionStrings } from './utils/versioning.mjs';
|
||||
import { fetchStudioAgpTable } from './fetch-and-parse-android-studio-agp-compatibility-table.mjs';
|
||||
import { readPropertiesSync } from './utils/properties.mjs';
|
||||
import { compareVersionStrings } from './utils/versioning.mjs';
|
||||
import { updateAnchoredMapInFile } from './utils/anchors.mjs';
|
||||
|
||||
const props = readPropertiesSync();
|
||||
@@ -18,14 +18,11 @@ const version = {
|
||||
const agpMap = {};
|
||||
|
||||
for (const { studioVersion, agpRange } of agpTable) {
|
||||
const [ _, targetAgpVersion ] = agpRange.split('-');
|
||||
const targetStudioVersion = studioVersion.match(/\d{2,}\.\d+\.\d/)?.[0];
|
||||
const targetStudioVersion = studioVersion.match(/\d{2,}\.\d+\.\d+/)?.[0];
|
||||
if (!targetStudioVersion) continue;
|
||||
if (targetStudioVersion in agpMap) {
|
||||
if (compareVersionStrings(targetAgpVersion, agpMap[targetStudioVersion]) < 0) {
|
||||
agpMap[targetStudioVersion] = targetAgpVersion;
|
||||
}
|
||||
} else {
|
||||
|
||||
const [ _, targetAgpVersion ] = agpRange.split('-');
|
||||
if (!(targetStudioVersion in agpMap) || compareVersionStrings(agpMap[targetStudioVersion], targetAgpVersion) > 0) {
|
||||
agpMap[targetStudioVersion] = targetAgpVersion;
|
||||
}
|
||||
if (compareVersionStrings(targetStudioVersion, version.MIN_IDE) <= 0) break;
|
||||
@@ -36,9 +33,9 @@ const version = {
|
||||
anchorTag: 'ANDROID_STUDIO_AGP_VERSION_MAP',
|
||||
mapName: 'agpVersionMap',
|
||||
lines: Object.entries(agpMap).map(([ studioVer, agpVer ]) => `"${studioVer}" to "${agpVer}",`),
|
||||
updatedLabel: 'AGP 版本映射',
|
||||
updatedLabel: 'AGP version map',
|
||||
});
|
||||
})().catch(err => {
|
||||
console.error(err);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user