Files
Max-Cocos-Demo/extensions/max-studio/source/hotupdate/builder.ts
2025-10-28 21:55:41 +08:00

158 lines
4.1 KiB
TypeScript

/* eslint-disable @typescript-eslint/naming-convention */
import { BuildPlugin } from "@cocos/creator-types/editor/packages/builder/@types/public";
const options = {
hotupdatePluginCheck: {
label: 'i18n:max-framework.hotupdate.hotupdatecheck',
description: "hotupdate checkbox",
default: false,
render: {
ui: 'ui-checkbox',
attributes: {
}
}
},
configInput: {
label: "i18n:max-framework.hotupdate.hotupdatecfg",
description: "hotupdate config file path",
extensions: ['json'],
default: 'project://hotupdate-config.json',
render: {
ui: 'ui-file',
attributes: {
protocols: 'project',
value: 'project://hotupdate-config.json',
}
},
},
outInput: {
label: "i18n:max-framework.hotupdate.outputcfg",
description: "hotupdate output directory",
default: 'project://hotupdate-packages',
render: {
ui: 'ui-file',
attributes: {
protocols: 'project',
type: 'directory',
value: 'project://hotupdate-packages',
}
},
},
// MinIO 配置选项
minioAutoUpload: {
label: 'i18n:max-framework.hotupdate.autoupload',
description: "Enable automatic upload to MinIO after build",
default: false,
render: {
ui: 'ui-checkbox',
attributes: {}
}
},
minioEndpoint: {
label: "i18n:max-framework.hotupdate.endpoint",
description: "MinIO server endpoint",
default: '',
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-input',
attributes: {
placeholder: 'example: minio.example.com or 192.168.1.100:9000'
}
},
},
minioAccessKeyId: {
label: "i18n:max-framework.hotupdate.accesskey",
description: "MinIO access key ID",
default: 'Wh32ZQrSq742n119Ta9m',
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-input',
attributes: {
placeholder: 'Access Key ID'
}
},
},
minioSecretAccessKey: {
label: "i18n:max-framework.hotupdate.secretkey",
description: "MinIO secret access key",
default: 'OCvFbPC9wIzkP7hWywFEn3BhPiNoLjoOWKGZnAn0',
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-input',
attributes: {
placeholder: 'Secret Access Key',
type: 'password'
}
},
},
minioBucketName: {
label: "i18n:max-framework.hotupdate.bucket",
description: "MinIO bucket name",
default: 'hotupdate',
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-input',
attributes: {
placeholder: 'Bucket name'
}
},
},
minioUseSSL: {
label: 'i18n:max-framework.hotupdate.usessl',
description: "Use SSL for MinIO connection",
default: false,
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-checkbox',
attributes: {}
}
},
minioPathPrefix: {
label: "i18n:max-framework.hotupdate.pathprefix",
description: "MinIO path prefix",
default: 'hotupdate',
displayCondition: {
minioAutoUpload: true
},
render: {
ui: 'ui-input',
attributes: {
placeholder: 'Path prefix (optional)'
}
},
},
};
export const configs: BuildPlugin.Configs = {
'*': {
hooks: './hooks',
},
"mac": {
options: options,
},
"ios": {
options: options,
},
"android": {
options: options,
},
"windows": {
options: options,
},
"web-mobile": {
panel: "./panel"
}
};