zcw-shared 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/namedColors.d.ts +16 -0
- package/dist/constants/namedColors.js +17 -0
- package/dist/constants/namedColors.js.map +1 -0
- package/dist/constants/softwareConfigs.d.ts +14 -0
- package/dist/constants/softwareConfigs.js +156 -0
- package/dist/constants/softwareConfigs.js.map +1 -0
- package/dist/functions/ag-grid/generateLicense.d.ts +3 -0
- package/dist/functions/ag-grid/generateLicense.js +12 -0
- package/dist/functions/ag-grid/generateLicense.js.map +1 -0
- package/dist/functions/android/buildProject.d.ts +12 -0
- package/dist/functions/android/buildProject.js +123 -0
- package/dist/functions/android/buildProject.js.map +1 -0
- package/dist/functions/android/detectAndroidModules.d.ts +2 -0
- package/dist/functions/android/detectAndroidModules.js +21 -0
- package/dist/functions/android/detectAndroidModules.js.map +1 -0
- package/dist/functions/android/modifyGradle.d.ts +17 -0
- package/dist/functions/android/modifyGradle.js +69 -0
- package/dist/functions/android/modifyGradle.js.map +1 -0
- package/dist/functions/android/modifyManifest.d.ts +23 -0
- package/dist/functions/android/modifyManifest.js +201 -0
- package/dist/functions/android/modifyManifest.js.map +1 -0
- package/dist/functions/android/permission.d.ts +30 -0
- package/dist/functions/android/permission.js +65 -0
- package/dist/functions/android/permission.js.map +1 -0
- package/dist/functions/color/colorValidation.d.ts +11 -0
- package/dist/functions/color/colorValidation.js +35 -0
- package/dist/functions/color/colorValidation.js.map +1 -0
- package/dist/functions/color/deduplicateColors.d.ts +4 -0
- package/dist/functions/color/deduplicateColors.js +40 -0
- package/dist/functions/color/deduplicateColors.js.map +1 -0
- package/dist/functions/css/extractCssVariables.d.ts +12 -0
- package/dist/functions/css/extractCssVariables.js +53 -0
- package/dist/functions/css/extractCssVariables.js.map +1 -0
- package/dist/functions/debug/createDebugger.d.ts +21 -0
- package/dist/functions/debug/createDebugger.js +89 -0
- package/dist/functions/debug/createDebugger.js.map +1 -0
- package/dist/functions/dom/detectOverflow.d.ts +8 -0
- package/dist/functions/dom/detectOverflow.js +17 -0
- package/dist/functions/dom/detectOverflow.js.map +1 -0
- package/dist/functions/dom/getElementRect.d.ts +3 -0
- package/dist/functions/dom/getElementRect.js +14 -0
- package/dist/functions/dom/getElementRect.js.map +1 -0
- package/dist/functions/dom/getRelativePosition.d.ts +3 -0
- package/dist/functions/dom/getRelativePosition.js +14 -0
- package/dist/functions/dom/getRelativePosition.js.map +1 -0
- package/dist/functions/dom/getViewportRect.d.ts +3 -0
- package/dist/functions/dom/getViewportRect.js +15 -0
- package/dist/functions/dom/getViewportRect.js.map +1 -0
- package/dist/functions/image/generateMacIcons.d.ts +6 -0
- package/dist/functions/image/generateMacIcons.js +15 -0
- package/dist/functions/image/generateMacIcons.js.map +1 -0
- package/dist/functions/image/generateMacTrayIcon.d.ts +7 -0
- package/dist/functions/image/generateMacTrayIcon.js +15 -0
- package/dist/functions/image/generateMacTrayIcon.js.map +1 -0
- package/dist/functions/image/generatePaddedImage.d.ts +3 -0
- package/dist/functions/image/generatePaddedImage.js +14 -0
- package/dist/functions/image/generatePaddedImage.js.map +1 -0
- package/dist/functions/image/generatePwaIcons.d.ts +6 -0
- package/dist/functions/image/generatePwaIcons.js +15 -0
- package/dist/functions/image/generatePwaIcons.js.map +1 -0
- package/dist/functions/image/generateRoundedImage.d.ts +3 -0
- package/dist/functions/image/generateRoundedImage.js +17 -0
- package/dist/functions/image/generateRoundedImage.js.map +1 -0
- package/dist/functions/ipc/dispatchIpcRequest.d.ts +6 -0
- package/dist/functions/ipc/dispatchIpcRequest.js +10 -0
- package/dist/functions/ipc/dispatchIpcRequest.js.map +1 -0
- package/dist/functions/software/findSoftware.d.ts +13 -0
- package/dist/functions/software/findSoftware.js +41 -0
- package/dist/functions/software/findSoftware.js.map +1 -0
- package/dist/functions/string/base64.d.ts +2 -0
- package/dist/functions/string/base64.js +6 -0
- package/dist/functions/string/base64.js.map +1 -0
- package/dist/functions/string/capitalize.d.ts +1 -0
- package/dist/functions/string/capitalize.js +6 -0
- package/dist/functions/string/capitalize.js.map +1 -0
- package/dist/functions/string/caseConverter.d.ts +19 -0
- package/dist/functions/string/caseConverter.js +94 -0
- package/dist/functions/string/caseConverter.js.map +1 -0
- package/dist/functions/string/desensitize.d.ts +13 -0
- package/dist/functions/string/desensitize.js +107 -0
- package/dist/functions/string/desensitize.js.map +1 -0
- package/dist/functions/string/htmlEscape.d.ts +20 -0
- package/dist/functions/string/htmlEscape.js +80 -0
- package/dist/functions/string/htmlEscape.js.map +1 -0
- package/dist/functions/string/levenshtein.d.ts +1 -0
- package/dist/functions/string/levenshtein.js +27 -0
- package/dist/functions/string/levenshtein.js.map +1 -0
- package/dist/functions/string/normalize.d.ts +8 -0
- package/dist/functions/string/normalize.js +37 -0
- package/dist/functions/string/normalize.js.map +1 -0
- package/dist/functions/string/pad.d.ts +13 -0
- package/dist/functions/string/pad.js +50 -0
- package/dist/functions/string/pad.js.map +1 -0
- package/dist/functions/string/palindrome.d.ts +3 -0
- package/dist/functions/string/palindrome.js +15 -0
- package/dist/functions/string/palindrome.js.map +1 -0
- package/dist/functions/string/similarity.d.ts +1 -0
- package/dist/functions/string/similarity.js +13 -0
- package/dist/functions/string/similarity.js.map +1 -0
- package/dist/functions/string/template.d.ts +4 -0
- package/dist/functions/string/template.js +21 -0
- package/dist/functions/string/template.js.map +1 -0
- package/dist/functions/string/wordCount.d.ts +5 -0
- package/dist/functions/string/wordCount.js +11 -0
- package/dist/functions/string/wordCount.js.map +1 -0
- package/dist/functions/tencent-cloud/getSecret.d.ts +6 -0
- package/dist/functions/tencent-cloud/getSecret.js +18 -0
- package/dist/functions/tencent-cloud/getSecret.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +2 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +245 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -0
- package/dist/functions/uniapp/build.d.ts +20 -0
- package/dist/functions/uniapp/build.js +84 -0
- package/dist/functions/uniapp/build.js.map +1 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.d.ts +7 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js +30 -0
- package/dist/functions/uniapp/detectAndroidProjectStructure.js.map +1 -0
- package/dist/functions/uniapp/detectProjectType.d.ts +16 -0
- package/dist/functions/uniapp/detectProjectType.js +68 -0
- package/dist/functions/uniapp/detectProjectType.js.map +1 -0
- package/dist/functions/uniapp/parseManifest.d.ts +12 -0
- package/dist/functions/uniapp/parseManifest.js +46 -0
- package/dist/functions/uniapp/parseManifest.js.map +1 -0
- package/dist/functions/uniapp/waitForPages.d.ts +3 -0
- package/dist/functions/uniapp/waitForPages.js +20 -0
- package/dist/functions/uniapp/waitForPages.js.map +1 -0
- package/dist/functions/utils/compose.d.ts +1 -0
- package/dist/functions/utils/compose.js +10 -0
- package/dist/functions/utils/compose.js.map +1 -0
- package/dist/functions/utils/cond.d.ts +1 -0
- package/dist/functions/utils/cond.js +15 -0
- package/dist/functions/utils/cond.js.map +1 -0
- package/dist/functions/utils/curry.d.ts +1 -0
- package/dist/functions/utils/curry.js +13 -0
- package/dist/functions/utils/curry.js.map +1 -0
- package/dist/functions/utils/debounce.d.ts +1 -0
- package/dist/functions/utils/debounce.js +13 -0
- package/dist/functions/utils/debounce.js.map +1 -0
- package/dist/functions/utils/evolve.d.ts +3 -0
- package/dist/functions/utils/evolve.js +15 -0
- package/dist/functions/utils/evolve.js.map +1 -0
- package/dist/functions/utils/flow.d.ts +1 -0
- package/dist/functions/utils/flow.js +14 -0
- package/dist/functions/utils/flow.js.map +1 -0
- package/dist/functions/utils/generateExports.d.ts +16 -0
- package/dist/functions/utils/generateExports.js +34 -0
- package/dist/functions/utils/generateExports.js.map +1 -0
- package/dist/functions/utils/isType.d.ts +11 -0
- package/dist/functions/utils/isType.js +30 -0
- package/dist/functions/utils/isType.js.map +1 -0
- package/dist/functions/utils/memoize.d.ts +1 -0
- package/dist/functions/utils/memoize.js +13 -0
- package/dist/functions/utils/memoize.js.map +1 -0
- package/dist/functions/utils/once.d.ts +1 -0
- package/dist/functions/utils/once.js +13 -0
- package/dist/functions/utils/once.js.map +1 -0
- package/dist/functions/utils/partial.d.ts +1 -0
- package/dist/functions/utils/partial.js +13 -0
- package/dist/functions/utils/partial.js.map +1 -0
- package/dist/functions/utils/pipe.d.ts +1 -0
- package/dist/functions/utils/pipe.js +10 -0
- package/dist/functions/utils/pipe.js.map +1 -0
- package/dist/functions/utils/retryWithBackoff.d.ts +9 -0
- package/dist/functions/utils/retryWithBackoff.js +30 -0
- package/dist/functions/utils/retryWithBackoff.js.map +1 -0
- package/dist/functions/utils/tap.d.ts +1 -0
- package/dist/functions/utils/tap.js +14 -0
- package/dist/functions/utils/tap.js.map +1 -0
- package/dist/functions/utils/throttle.d.ts +1 -0
- package/dist/functions/utils/throttle.js +11 -0
- package/dist/functions/utils/throttle.js.map +1 -0
- package/dist/functions/utils/until.d.ts +1 -0
- package/dist/functions/utils/until.js +10 -0
- package/dist/functions/utils/until.js.map +1 -0
- package/dist/functions/utils/validate.d.ts +8 -0
- package/dist/functions/utils/validate.js +45 -0
- package/dist/functions/utils/validate.js.map +1 -0
- package/dist/functions/utils/walk.d.ts +11 -0
- package/dist/functions/utils/walk.js +27 -0
- package/dist/functions/utils/walk.js.map +1 -0
- package/dist/functions/vue/dynamicMount.d.ts +15 -0
- package/dist/functions/vue/dynamicMount.js +25 -0
- package/dist/functions/vue/dynamicMount.js.map +1 -0
- package/dist/functions/vue/filterSections.d.ts +2 -0
- package/dist/functions/vue/filterSections.js +11 -0
- package/dist/functions/vue/filterSections.js.map +1 -0
- package/dist/functions/vue/isVNode.d.ts +2 -0
- package/dist/functions/vue/isVNode.js +6 -0
- package/dist/functions/vue/isVNode.js.map +1 -0
- package/dist/functions/vue/isVueComponent.d.ts +2 -0
- package/dist/functions/vue/isVueComponent.js +6 -0
- package/dist/functions/vue/isVueComponent.js.map +1 -0
- package/dist/functions/vue/parseVueFile.d.ts +2 -0
- package/dist/functions/vue/parseVueFile.js +53 -0
- package/dist/functions/vue/parseVueFile.js.map +1 -0
- package/dist/functions/wechat/miniapp/downloadFile.d.ts +2 -0
- package/dist/functions/wechat/miniapp/downloadFile.js +39 -0
- package/dist/functions/wechat/miniapp/downloadFile.js.map +1 -0
- package/dist/functions/xml/modifyXml.d.ts +17 -0
- package/dist/functions/xml/modifyXml.js +51 -0
- package/dist/functions/xml/modifyXml.js.map +1 -0
- package/dist/hooks/useAltool.d.ts +39 -0
- package/dist/hooks/useAltool.js +350 -0
- package/dist/hooks/useAltool.js.map +1 -0
- package/dist/hooks/useCache.d.ts +18 -0
- package/dist/hooks/useCache.js +82 -0
- package/dist/hooks/useCache.js.map +1 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -0
- package/dist/hooks/useLocalStorage.js +100 -0
- package/dist/hooks/useLocalStorage.js.map +1 -0
- package/dist/hooks/usePluginSystem.d.ts +11 -0
- package/dist/hooks/usePluginSystem.js +34 -0
- package/dist/hooks/usePluginSystem.js.map +1 -0
- package/dist/hooks/useSessionStorage.d.ts +4 -0
- package/dist/hooks/useSessionStorage.js +100 -0
- package/dist/hooks/useSessionStorage.js.map +1 -0
- package/dist/hooks/useStorage.d.ts +10 -0
- package/dist/hooks/useStorage.js +62 -0
- package/dist/hooks/useStorage.js.map +1 -0
- package/dist/hooks/useStorageWithIndexedDB.d.ts +4 -0
- package/dist/hooks/useStorageWithIndexedDB.js +119 -0
- package/dist/hooks/useStorageWithIndexedDB.js.map +1 -0
- package/dist/hooks/useWebWorker.d.ts +25 -0
- package/dist/hooks/useWebWorker.js +209 -0
- package/dist/hooks/useWebWorker.js.map +1 -0
- package/dist/hooks/useWorkerFunction.d.ts +22 -0
- package/dist/hooks/useWorkerFunction.js +191 -0
- package/dist/hooks/useWorkerFunction.js.map +1 -0
- package/dist/hooks/useWorkerPool.d.ts +30 -0
- package/dist/hooks/useWorkerPool.js +242 -0
- package/dist/hooks/useWorkerPool.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const NAMED_COLOR_MAP: {
|
|
2
|
+
red: string;
|
|
3
|
+
green: string;
|
|
4
|
+
blue: string;
|
|
5
|
+
yellow: string;
|
|
6
|
+
orange: string;
|
|
7
|
+
purple: string;
|
|
8
|
+
pink: string;
|
|
9
|
+
brown: string;
|
|
10
|
+
black: string;
|
|
11
|
+
white: string;
|
|
12
|
+
gray: string;
|
|
13
|
+
grey: string;
|
|
14
|
+
cyan: string;
|
|
15
|
+
magenta: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const NAMED_COLOR_MAP = {
|
|
2
|
+
'red': '#ff0000',
|
|
3
|
+
'green': '#00ff00',
|
|
4
|
+
'blue': '#0000ff',
|
|
5
|
+
'yellow': '#ffff00',
|
|
6
|
+
'orange': '#ffa500',
|
|
7
|
+
'purple': '#800080',
|
|
8
|
+
'pink': '#ffc0cb',
|
|
9
|
+
'brown': '#a52a2a',
|
|
10
|
+
'black': '#000000',
|
|
11
|
+
'white': '#ffffff',
|
|
12
|
+
'gray': '#808080',
|
|
13
|
+
'grey': '#808080',
|
|
14
|
+
'cyan': '#00ffff',
|
|
15
|
+
'magenta': '#ff00ff'
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=namedColors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namedColors.js","sourceRoot":"","sources":["../../src/constants/namedColors.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,SAAS;CACrB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PlatformSoftwareConfig {
|
|
2
|
+
executable: string;
|
|
3
|
+
possiblePaths: string[];
|
|
4
|
+
userPaths: string[];
|
|
5
|
+
registryKey?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SoftwareConfigDefinition {
|
|
8
|
+
win32: PlatformSoftwareConfig;
|
|
9
|
+
darwin: PlatformSoftwareConfig;
|
|
10
|
+
linux: PlatformSoftwareConfig;
|
|
11
|
+
envVar: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const SOFTWARE_CONFIGS: Record<string, SoftwareConfigDefinition>;
|
|
14
|
+
export declare const SOFTWARE_NAME_MAP: Record<string, string>;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export const SOFTWARE_CONFIGS = {
|
|
2
|
+
git: {
|
|
3
|
+
win32: {
|
|
4
|
+
executable: 'git.exe',
|
|
5
|
+
possiblePaths: [
|
|
6
|
+
'C:\\Program Files\\Git\\bin',
|
|
7
|
+
'C:\\Program Files (x86)\\Git\\bin'
|
|
8
|
+
],
|
|
9
|
+
userPaths: ['AppData\\Local\\Programs\\Git\\bin'],
|
|
10
|
+
registryKey: 'HKEY_LOCAL_MACHINE\\SOFTWARE\\GitForWindows'
|
|
11
|
+
},
|
|
12
|
+
darwin: {
|
|
13
|
+
executable: 'git',
|
|
14
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin', '/opt/homebrew/bin'],
|
|
15
|
+
userPaths: ['~/.local/bin']
|
|
16
|
+
},
|
|
17
|
+
linux: {
|
|
18
|
+
executable: 'git',
|
|
19
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin'],
|
|
20
|
+
userPaths: ['~/.local/bin']
|
|
21
|
+
},
|
|
22
|
+
envVar: 'GIT_PATH'
|
|
23
|
+
},
|
|
24
|
+
chrome: {
|
|
25
|
+
win32: {
|
|
26
|
+
executable: 'chrome.exe',
|
|
27
|
+
possiblePaths: [
|
|
28
|
+
'C:\\Program Files\\Google\\Chrome\\Application',
|
|
29
|
+
'C:\\Program Files (x86)\\Google\\Chrome\\Application'
|
|
30
|
+
],
|
|
31
|
+
userPaths: ['AppData\\Local\\Google\\Chrome\\Application'],
|
|
32
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\Google\\Chrome'
|
|
33
|
+
},
|
|
34
|
+
darwin: {
|
|
35
|
+
executable: 'Google Chrome',
|
|
36
|
+
possiblePaths: ['/Applications/Google Chrome.app/Contents/MacOS'],
|
|
37
|
+
userPaths: ['~/Applications/Google Chrome.app/Contents/MacOS']
|
|
38
|
+
},
|
|
39
|
+
linux: {
|
|
40
|
+
executable: 'google-chrome',
|
|
41
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin', '/opt/google/chrome'],
|
|
42
|
+
userPaths: ['~/.local/bin']
|
|
43
|
+
},
|
|
44
|
+
envVar: 'CHROME_PATH'
|
|
45
|
+
},
|
|
46
|
+
nodejs: {
|
|
47
|
+
win32: {
|
|
48
|
+
executable: 'node.exe',
|
|
49
|
+
possiblePaths: [
|
|
50
|
+
'C:\\Program Files\\nodejs',
|
|
51
|
+
'C:\\Program Files (x86)\\nodejs'
|
|
52
|
+
],
|
|
53
|
+
userPaths: ['AppData\\Roaming\\npm'],
|
|
54
|
+
registryKey: 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Node.js'
|
|
55
|
+
},
|
|
56
|
+
darwin: {
|
|
57
|
+
executable: 'node',
|
|
58
|
+
possiblePaths: ['/usr/local/bin', '/opt/homebrew/bin', '/usr/bin'],
|
|
59
|
+
userPaths: ['~/.local/bin']
|
|
60
|
+
},
|
|
61
|
+
linux: {
|
|
62
|
+
executable: 'node',
|
|
63
|
+
possiblePaths: ['/usr/bin', '/usr/local/bin'],
|
|
64
|
+
userPaths: ['~/.local/bin']
|
|
65
|
+
},
|
|
66
|
+
envVar: 'NODE_PATH'
|
|
67
|
+
},
|
|
68
|
+
wechat: {
|
|
69
|
+
win32: {
|
|
70
|
+
executable: 'cli.bat',
|
|
71
|
+
possiblePaths: [
|
|
72
|
+
'C:\\Program Files (x86)\\Tencent\\微信web开发者工具',
|
|
73
|
+
'C:\\Program Files\\Tencent\\微信web开发者工具'
|
|
74
|
+
],
|
|
75
|
+
userPaths: [
|
|
76
|
+
'AppData\\Local\\微信web开发者工具',
|
|
77
|
+
'AppData\\Roaming\\微信web开发者工具'
|
|
78
|
+
],
|
|
79
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\Tencent\\微信web开发者工具'
|
|
80
|
+
},
|
|
81
|
+
darwin: {
|
|
82
|
+
executable: 'cli',
|
|
83
|
+
possiblePaths: [
|
|
84
|
+
'/Applications/wechatwebdevtools.app/Contents/MacOS',
|
|
85
|
+
'/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin'
|
|
86
|
+
],
|
|
87
|
+
userPaths: [
|
|
88
|
+
'/Applications/wechatwebdevtools.app/Contents/MacOS',
|
|
89
|
+
'/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin'
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
linux: {
|
|
93
|
+
executable: 'cli',
|
|
94
|
+
possiblePaths: ['/usr/local/bin', '/usr/bin'],
|
|
95
|
+
userPaths: ['.local/bin']
|
|
96
|
+
},
|
|
97
|
+
envVar: 'WECHAT_DEV_TOOLS_PATH'
|
|
98
|
+
},
|
|
99
|
+
hbuilderx: {
|
|
100
|
+
win32: {
|
|
101
|
+
executable: 'HBuilderX.exe',
|
|
102
|
+
possiblePaths: [
|
|
103
|
+
'C:\\Program Files\\HBuilderX',
|
|
104
|
+
'C:\\Program Files (x86)\\HBuilderX'
|
|
105
|
+
],
|
|
106
|
+
userPaths: [
|
|
107
|
+
'AppData\\Local\\HBuilderX',
|
|
108
|
+
'AppData\\Roaming\\HBuilderX'
|
|
109
|
+
],
|
|
110
|
+
registryKey: 'HKEY_CURRENT_USER\\Software\\DCloud\\HBuilderX'
|
|
111
|
+
},
|
|
112
|
+
darwin: {
|
|
113
|
+
executable: 'HBuilderX',
|
|
114
|
+
possiblePaths: ['/Applications/HBuilderX.app/Contents/MacOS'],
|
|
115
|
+
userPaths: ['~/Applications/HBuilderX.app/Contents/MacOS']
|
|
116
|
+
},
|
|
117
|
+
linux: {
|
|
118
|
+
executable: 'HBuilderX',
|
|
119
|
+
possiblePaths: ['/opt/HBuilderX', '/usr/local/HBuilderX'],
|
|
120
|
+
userPaths: ['~/.local/share/HBuilderX', '~/HBuilderX']
|
|
121
|
+
},
|
|
122
|
+
envVar: 'HBUILDERX_PATH'
|
|
123
|
+
},
|
|
124
|
+
altool: {
|
|
125
|
+
win32: {
|
|
126
|
+
executable: 'altool.exe',
|
|
127
|
+
possiblePaths: [],
|
|
128
|
+
userPaths: []
|
|
129
|
+
},
|
|
130
|
+
darwin: {
|
|
131
|
+
executable: 'altool',
|
|
132
|
+
possiblePaths: [
|
|
133
|
+
'/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Versions/A/Support',
|
|
134
|
+
'/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin',
|
|
135
|
+
'/Applications/Xcode.app/Contents/Developer/usr/bin',
|
|
136
|
+
'/usr/local/bin'
|
|
137
|
+
],
|
|
138
|
+
userPaths: ['~/Applications/Xcode.app/Contents/Developer/usr/bin']
|
|
139
|
+
},
|
|
140
|
+
linux: {
|
|
141
|
+
executable: 'altool',
|
|
142
|
+
possiblePaths: [],
|
|
143
|
+
userPaths: []
|
|
144
|
+
},
|
|
145
|
+
envVar: 'ALTOOL_PATH'
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
export const SOFTWARE_NAME_MAP = {
|
|
149
|
+
wechat: 'wechat',
|
|
150
|
+
chrome: 'chrome',
|
|
151
|
+
git: 'git',
|
|
152
|
+
hbuilderx: 'hbuilderx',
|
|
153
|
+
nodejs: 'nodejs',
|
|
154
|
+
node: 'nodejs',
|
|
155
|
+
};
|
|
156
|
+
//# sourceMappingURL=softwareConfigs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"softwareConfigs.js","sourceRoot":"","sources":["../../src/constants/softwareConfigs.ts"],"names":[],"mappings":"AAmCA,MAAM,CAAC,MAAM,gBAAgB,GAA6C;IACxE,GAAG,EAAE;QACH,KAAK,EAAE;YACL,UAAU,EAAE,SAAS;YACrB,aAAa,EAAE;gBACb,6BAA6B;gBAC7B,mCAAmC;aACpC;YACD,SAAS,EAAE,CAAC,oCAAoC,CAAC;YACjD,WAAW,EAAE,6CAA6C;SAC3D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;YAClE,SAAS,EAAE,CAAC,cAAc,CAAC;SAC5B;QACD,KAAK,EAAE;YACL,UAAU,EAAE,KAAK;YACjB,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;YAC7C,SAAS,EAAE,CAAC,cAAc,CAAC;SAC5B;QACD,MAAM,EAAE,UAAU;KACnB;IAED,MAAM,EAAE;QACN,KAAK,EAAE;YACL,UAAU,EAAE,YAAY;YACxB,aAAa,EAAE;gBACb,gDAAgD;gBAChD,sDAAsD;aACvD;YACD,SAAS,EAAE,CAAC,6CAA6C,CAAC;YAC1D,WAAW,EAAE,6CAA6C;SAC3D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,eAAe;YAC3B,aAAa,EAAE,CAAC,gDAAgD,CAAC;YACjE,SAAS,EAAE,CAAC,iDAAiD,CAAC;SAC/D;QACD,KAAK,EAAE;YACL,UAAU,EAAE,eAAe;YAC3B,aAAa,EAAE,CAAC,UAAU,EAAE,gBAAgB,EAAE,oBAAoB,CAAC;YACnE,SAAS,EAAE,CAAC,cAAc,CAAC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gDAAgD;SAC9D;QACD,MAAM,EAAE;YACN,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,CAAC,4CAA4C,CAAC;YAC7D,SAAS,EAAE,CAAC,6CAA6C,CAAC;SAC3D;QACD,KAAK,EAAE;YACL,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;YACzD,SAAS,EAAE,CAAC,0BAA0B,EAAE,aAAa,CAAC;SACvD;QACD,MAAM,EAAE,gBAAgB;KACzB;IAED,MAAM,EAAE;QACN,KAAK,EAAE;YACL,UAAU,EAAE,YAAY;YACxB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;SACd;QACD,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ;YACpB,aAAa,EAAE;gBACb,6IAA6I;gBAC7I,wFAAwF;gBACxF,oDAAoD;gBACpD,gBAAgB;aACjB;YACD,SAAS,EAAE,CAAC,qDAAqD,CAAC;SACnE;QACD,KAAK,EAAE;YACL,UAAU,EAAE,QAAQ;YACpB,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,EAAE;SACd;QACD,MAAM,EAAE,aAAa;KACtB;CACF,CAAA;AAKD,MAAM,CAAC,MAAM,iBAAiB,GAA2B;IACvD,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,QAAQ;CACf,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function generateLicense(crypto, base64Encoder) {
|
|
2
|
+
let expiredDate = new Date();
|
|
3
|
+
expiredDate.setFullYear(expiredDate.getFullYear() + 99);
|
|
4
|
+
const milliSeconds = expiredDate.getTime();
|
|
5
|
+
const expired = base64Encoder.btoa(milliSeconds.toString());
|
|
6
|
+
const license = `[v3][RELEASE][0102]_${expired}`;
|
|
7
|
+
const hashResult = crypto.MD5(license);
|
|
8
|
+
const hash = typeof hashResult === 'string' ? hashResult : hashResult.toString();
|
|
9
|
+
const licenseKey = `${license}${hash}`;
|
|
10
|
+
return licenseKey;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=generateLicense.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateLicense.js","sourceRoot":"","sources":["../../../src/functions/ag-grid/generateLicense.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,eAAe,CAAC,MAAgB,EAAE,aAA4B;IAC5E,IAAI,WAAW,GAAG,IAAI,IAAI,EAAE,CAAA;IAC5B,WAAW,CAAC,WAAW,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAA;IACvD,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,EAAE,CAAA;IAC1C,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,uBAAuB,OAAO,EAAE,CAAA;IAChD,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACtC,MAAM,IAAI,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAA;IAChF,MAAM,UAAU,GAAG,GAAG,OAAO,GAAG,IAAI,EAAE,CAAA;IACtC,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FileSystem, Path, Process } from '../../../references/node.d';
|
|
2
|
+
import type { AndroidBuildOptions, AndroidBuildResult } from '../../../types/android-build.d';
|
|
3
|
+
export interface AndroidBuildDependencies {
|
|
4
|
+
fs: FileSystem;
|
|
5
|
+
path: Path;
|
|
6
|
+
process: Process;
|
|
7
|
+
childProcess: {
|
|
8
|
+
exec: (command: string, callback: (error: any, stdout: string, stderr: string) => void) => any;
|
|
9
|
+
};
|
|
10
|
+
setTimeout: (callback: () => void, ms: number) => any;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildProject(options: AndroidBuildOptions, deps: AndroidBuildDependencies): Promise<AndroidBuildResult>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export async function buildProject(options, deps) {
|
|
2
|
+
const { fs, path, process, childProcess, setTimeout } = deps;
|
|
3
|
+
const { projectPath, outputPath, clean = false, buildVariant = 'debug' } = options;
|
|
4
|
+
const logs = [];
|
|
5
|
+
try {
|
|
6
|
+
logs.push(`开始编译 Android 工程: ${projectPath}`);
|
|
7
|
+
logs.push(`构建变体: ${buildVariant}`);
|
|
8
|
+
if (!fs.existsSync(projectPath)) {
|
|
9
|
+
return {
|
|
10
|
+
success: false,
|
|
11
|
+
error: `工程路径不存在: ${projectPath}`,
|
|
12
|
+
logs
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
const buildGradlePath = path.join(projectPath, 'build.gradle');
|
|
16
|
+
if (!fs.existsSync(buildGradlePath)) {
|
|
17
|
+
return {
|
|
18
|
+
success: false,
|
|
19
|
+
error: `未找到 build.gradle 文件,不是有效的 Android 工程`,
|
|
20
|
+
logs
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const gradlewPath = path.join(projectPath, 'gradlew');
|
|
24
|
+
const gradlewBatPath = path.join(projectPath, 'gradlew.bat');
|
|
25
|
+
const hasGradlew = fs.existsSync(gradlewPath) || fs.existsSync(gradlewBatPath);
|
|
26
|
+
if (!hasGradlew) {
|
|
27
|
+
return {
|
|
28
|
+
success: false,
|
|
29
|
+
error: `未找到 gradlew 脚本,请确保工程已正确初始化`,
|
|
30
|
+
logs
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const gradleCommand = process.platform === 'win32' ? 'gradlew.bat' : './gradlew';
|
|
34
|
+
let buildCommand = `cd "${projectPath}" && ${gradleCommand}`;
|
|
35
|
+
if (clean) {
|
|
36
|
+
buildCommand += ' clean';
|
|
37
|
+
logs.push('执行清理构建');
|
|
38
|
+
}
|
|
39
|
+
buildCommand += ` assemble${buildVariant.charAt(0).toUpperCase() + buildVariant.slice(1)}`;
|
|
40
|
+
logs.push(`执行命令: ${buildCommand}`);
|
|
41
|
+
const result = await new Promise((resolve) => {
|
|
42
|
+
const child = childProcess.exec(buildCommand, (error, stdout, stderr) => {
|
|
43
|
+
if (error) {
|
|
44
|
+
logs.push(`构建错误: ${error.message}`);
|
|
45
|
+
if (stderr)
|
|
46
|
+
logs.push(`错误输出: ${stderr}`);
|
|
47
|
+
resolve({ success: false, error: error.message });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (stdout)
|
|
51
|
+
logs.push(`构建输出: ${stdout}`);
|
|
52
|
+
if (stderr)
|
|
53
|
+
logs.push(`警告信息: ${stderr}`);
|
|
54
|
+
resolve({ success: true });
|
|
55
|
+
});
|
|
56
|
+
setTimeout(() => {
|
|
57
|
+
child.kill();
|
|
58
|
+
resolve({ success: false, error: '构建超时' });
|
|
59
|
+
}, 600000);
|
|
60
|
+
});
|
|
61
|
+
if (!result.success) {
|
|
62
|
+
return {
|
|
63
|
+
success: false,
|
|
64
|
+
error: result.error,
|
|
65
|
+
logs
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const defaultOutputPath = path.join(projectPath, 'app', 'build', 'outputs', 'apk', buildVariant);
|
|
69
|
+
let finalOutputPath = outputPath || defaultOutputPath;
|
|
70
|
+
if (!fs.existsSync(finalOutputPath)) {
|
|
71
|
+
logs.push(`警告: 未找到默认输出目录 ${finalOutputPath}`);
|
|
72
|
+
const possibleModules = [];
|
|
73
|
+
try {
|
|
74
|
+
const projectFiles = fs.readdirSync(projectPath);
|
|
75
|
+
for (const file of projectFiles) {
|
|
76
|
+
const filePath = path.join(projectPath, file);
|
|
77
|
+
if (fs.statSync(filePath).isDirectory()) {
|
|
78
|
+
const buildGradlePath = path.join(filePath, 'build.gradle');
|
|
79
|
+
const buildGradleKtsPath = path.join(filePath, 'build.gradle.kts');
|
|
80
|
+
if (fs.existsSync(buildGradlePath) || fs.existsSync(buildGradleKtsPath)) {
|
|
81
|
+
const moduleOutputPath = path.join(filePath, 'build', 'outputs', 'apk', buildVariant);
|
|
82
|
+
if (fs.existsSync(moduleOutputPath)) {
|
|
83
|
+
possibleModules.push({ module: file, path: moduleOutputPath });
|
|
84
|
+
logs.push(`找到子模块输出: ${file} -> ${moduleOutputPath}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
logs.push(`搜索子模块时出错: ${error instanceof Error ? error.message : String(error)}`);
|
|
92
|
+
}
|
|
93
|
+
if (possibleModules.length > 0) {
|
|
94
|
+
const appModule = possibleModules.find(m => m.module === 'app');
|
|
95
|
+
const selectedModule = appModule || possibleModules[0];
|
|
96
|
+
finalOutputPath = selectedModule.path;
|
|
97
|
+
logs.push(`使用子模块输出目录: ${selectedModule.module} -> ${finalOutputPath}`);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
logs.push(`未找到任何有效的输出目录`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
logs.push(`构建完成,输出目录: ${finalOutputPath}`);
|
|
105
|
+
}
|
|
106
|
+
logs.push(`Android 工程编译成功`);
|
|
107
|
+
return {
|
|
108
|
+
success: true,
|
|
109
|
+
outputPath: finalOutputPath,
|
|
110
|
+
logs
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
115
|
+
logs.push(`编译过程中发生异常: ${errorMessage}`);
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
error: errorMessage,
|
|
119
|
+
logs
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=buildProject.js.map
|
|
@@ -0,0 +1 @@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AC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,cAAc,eAAe,EAAE,CAAC,CAAA;QAC5C,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QAC3B,OAAO;YACL,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,eAAe;YAC3B,IAAI;SACL,CAAA;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAC3E,IAAI,CAAC,IAAI,CAAC,cAAc,YAAY,EAAE,CAAC,CAAA;QAEvC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,YAAY;YACnB,IAAI;SACL,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function detectAllAndroidModules(projectPath, fs, path) {
|
|
2
|
+
const modules = [];
|
|
3
|
+
try {
|
|
4
|
+
const entries = fs.readdirSync(projectPath);
|
|
5
|
+
for (const entry of entries) {
|
|
6
|
+
const entryPath = path.join(projectPath, entry);
|
|
7
|
+
const stat = fs.statSync(entryPath);
|
|
8
|
+
if (stat.isDirectory()) {
|
|
9
|
+
const moduleDir = path.join(projectPath, entry);
|
|
10
|
+
const manifestPath = path.join(moduleDir, 'src', 'main', 'AndroidManifest.xml');
|
|
11
|
+
if (fs.existsSync(manifestPath)) {
|
|
12
|
+
modules.push(entry);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
}
|
|
19
|
+
return modules;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=detectAndroidModules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectAndroidModules.js","sourceRoot":"","sources":["../../../src/functions/android/detectAndroidModules.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,uBAAuB,CACrC,WAAmB,EACnB,EAAc,EACd,IAAU;IAEV,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,IAAI,CAAC;QAEH,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QAE5C,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAChD,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;YAEpC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACvB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;gBAChD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC;gBAGhF,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;oBAChC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACtB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;IAEjB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FileSystem, Path } from '../../../references/node.d';
|
|
2
|
+
export interface GradleModificationOptions {
|
|
3
|
+
applicationId?: string;
|
|
4
|
+
versionName?: string;
|
|
5
|
+
versionCode?: number;
|
|
6
|
+
signing?: {
|
|
7
|
+
keystore: string;
|
|
8
|
+
keystorePassword: string;
|
|
9
|
+
keyAlias: string;
|
|
10
|
+
keyPassword: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare function modifyGradle(buildGradlePath: string, options: GradleModificationOptions, fs: FileSystem, path: Path): Promise<{
|
|
14
|
+
success: boolean;
|
|
15
|
+
message?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export async function modifyGradle(buildGradlePath, options, fs, path) {
|
|
2
|
+
try {
|
|
3
|
+
if (!fs.existsSync(buildGradlePath)) {
|
|
4
|
+
return {
|
|
5
|
+
success: false,
|
|
6
|
+
error: `build.gradle 文件不存在: ${buildGradlePath}`
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
let buildGradleContent = fs.readFileSync(buildGradlePath, 'utf8');
|
|
10
|
+
if (options.applicationId) {
|
|
11
|
+
buildGradleContent = buildGradleContent.replace(/applicationId\s+["'][^"']*["']/, `applicationId "${options.applicationId}"`);
|
|
12
|
+
}
|
|
13
|
+
if (options.versionName) {
|
|
14
|
+
buildGradleContent = buildGradleContent.replace(/versionName\s+["'][^"']*["']/, `versionName "${options.versionName}"`);
|
|
15
|
+
}
|
|
16
|
+
if (options.versionCode !== undefined) {
|
|
17
|
+
buildGradleContent = buildGradleContent.replace(/versionCode\s+\d+/, `versionCode ${options.versionCode}`);
|
|
18
|
+
}
|
|
19
|
+
if (options.signing) {
|
|
20
|
+
const { signing } = options;
|
|
21
|
+
const keystoreFileName = signing.keystore.split('/').pop() || 'keystore.jks';
|
|
22
|
+
const targetKeystorePath = path.join(path.dirname(buildGradlePath), keystoreFileName);
|
|
23
|
+
if (fs.existsSync(signing.keystore)) {
|
|
24
|
+
fs.copyFileSync(signing.keystore, targetKeystorePath);
|
|
25
|
+
}
|
|
26
|
+
const newSigningConfig = `signingConfigs {
|
|
27
|
+
config {
|
|
28
|
+
keyAlias '${signing.keyAlias}'
|
|
29
|
+
keyPassword '${signing.keyPassword}'
|
|
30
|
+
storeFile file('${keystoreFileName}')
|
|
31
|
+
storePassword '${signing.keystorePassword}'
|
|
32
|
+
v1SigningEnabled true
|
|
33
|
+
v2SigningEnabled true
|
|
34
|
+
}
|
|
35
|
+
}`;
|
|
36
|
+
const signingConfigsRegex = /signingConfigs\s*\{[^{}]*(?:\{[^{}]*\}[^{}]*)*\}/;
|
|
37
|
+
if (signingConfigsRegex.test(buildGradleContent)) {
|
|
38
|
+
buildGradleContent = buildGradleContent.replace(signingConfigsRegex, newSigningConfig);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (buildGradleContent.includes('android {')) {
|
|
42
|
+
buildGradleContent = buildGradleContent.replace(/android\s*\{/, `android {
|
|
43
|
+
${newSigningConfig}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
fs.writeFileSync(buildGradlePath, buildGradleContent);
|
|
48
|
+
const modifications = [];
|
|
49
|
+
if (options.applicationId)
|
|
50
|
+
modifications.push(`applicationId=${options.applicationId}`);
|
|
51
|
+
if (options.versionName)
|
|
52
|
+
modifications.push(`versionName=${options.versionName}`);
|
|
53
|
+
if (options.versionCode !== undefined)
|
|
54
|
+
modifications.push(`versionCode=${options.versionCode}`);
|
|
55
|
+
if (options.signing)
|
|
56
|
+
modifications.push('签名配置已添加');
|
|
57
|
+
return {
|
|
58
|
+
success: true,
|
|
59
|
+
message: `build.gradle 修改完成: ${modifications.join(', ')}`
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
return {
|
|
64
|
+
success: false,
|
|
65
|
+
error: `修改 build.gradle 失败: ${error instanceof Error ? error.message : String(error)}`
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=modifyGradle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modifyGradle.js","sourceRoot":"","sources":["../../../src/functions/android/modifyGradle.ts"],"names":[],"mappings":"AAgCA,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,eAAuB,EACvB,OAAkC,EAClC,EAAc,EACd,IAAU;IAEV,IAAI,CAAC;QACH,IAAI,CAAC,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K,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;SACvF,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SystemDependencies } from '../../../types/android-build.d';
|
|
2
|
+
import type { FileSystem } from '../../../references/node.d';
|
|
3
|
+
export interface ManifestModification {
|
|
4
|
+
xpath: string;
|
|
5
|
+
action: 'setAttribute' | 'setTextContent' | 'addElement' | 'removeElement';
|
|
6
|
+
attributeName?: string;
|
|
7
|
+
value?: string;
|
|
8
|
+
elementName?: string;
|
|
9
|
+
attributes?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
export declare function modifyManifest(manifestPath: string, modifications: ManifestModification[], fs: FileSystem, deps: SystemDependencies): Promise<{
|
|
12
|
+
success: boolean;
|
|
13
|
+
error: string;
|
|
14
|
+
message?: undefined;
|
|
15
|
+
data?: undefined;
|
|
16
|
+
} | {
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
data: {
|
|
20
|
+
modificationsApplied: number;
|
|
21
|
+
};
|
|
22
|
+
error?: undefined;
|
|
23
|
+
}>;
|