@saltcorn/mobile-builder 1.1.0-beta.10 → 1.1.0-beta.12
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/mobile-builder.d.ts.map +1 -1
- package/dist/mobile-builder.js +60 -54
- package/dist/mobile-builder.js.map +1 -1
- package/dist/utils/capacitor-helper.d.ts +37 -0
- package/dist/utils/capacitor-helper.d.ts.map +1 -0
- package/dist/utils/capacitor-helper.js +202 -0
- package/dist/utils/capacitor-helper.js.map +1 -0
- package/dist/utils/common-build-utils.d.ts +11 -0
- package/dist/utils/common-build-utils.d.ts.map +1 -1
- package/dist/utils/common-build-utils.js +291 -19
- package/dist/utils/common-build-utils.js.map +1 -1
- package/dist/utils/package-bundle-utils.d.ts +1 -6
- package/dist/utils/package-bundle-utils.d.ts.map +1 -1
- package/dist/utils/package-bundle-utils.js +23 -32
- package/dist/utils/package-bundle-utils.js.map +1 -1
- package/docker/Dockerfile +20 -24
- package/docker/entry.bash +63 -23
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-builder.d.ts","sourceRoot":"","sources":["../mobile-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobile-builder.d.ts","sourceRoot":"","sources":["../mobile-builder.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAqBlD,OAAO,IAAI,MAAM,4BAA4B,CAAC;AAI9C,aAAK,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAItC,aAAK,mBAAmB,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS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IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,GAAG,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,SAA0B;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B;;;OAGG;gBACS,GAAG,EAAE,mBAAmB;IAoCpC;;OAEG;IACG,KAAK;CA+EZ"}
|
package/dist/mobile-builder.js
CHANGED
|
@@ -3,12 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MobileBuilder = void 0;
|
|
4
4
|
const { PluginManager } = require("live-plugin-manager");
|
|
5
5
|
const { loadAllPlugins } = require("@saltcorn/server/load_plugins");
|
|
6
|
-
const { features } = require("@saltcorn/data/db/state");
|
|
7
6
|
const path_1 = require("path");
|
|
8
7
|
const fs_extra_1 = require("fs-extra");
|
|
9
8
|
const common_build_utils_1 = require("./utils/common-build-utils");
|
|
10
9
|
const package_bundle_utils_1 = require("./utils/package-bundle-utils");
|
|
11
|
-
const
|
|
10
|
+
const capacitor_helper_1 = require("./utils/capacitor-helper");
|
|
12
11
|
const utils_1 = require("@saltcorn/data/utils");
|
|
13
12
|
const appIdDefault = "saltcorn.mobile.app";
|
|
14
13
|
const appNameDefault = "SaltcornMobileApp";
|
|
@@ -62,60 +61,67 @@ class MobileBuilder {
|
|
|
62
61
|
*
|
|
63
62
|
*/
|
|
64
63
|
async build() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
try {
|
|
65
|
+
(0, common_build_utils_1.prepareBuildDir)(this.buildDir, this.templateDir);
|
|
66
|
+
(0, common_build_utils_1.writeCapacitorConfig)(this.buildDir, {
|
|
67
|
+
appName: this.appName,
|
|
68
|
+
appId: this.appId !== appIdDefault ? this.appId : undefined,
|
|
69
|
+
appVersion: this.appVersion,
|
|
70
|
+
unsecureNetwork: this.serverURL.startsWith("http://") || !this.serverURL,
|
|
71
|
+
});
|
|
72
|
+
if (this.appIcon)
|
|
73
|
+
(0, common_build_utils_1.prepAppIcon)(this.buildDir, this.appIcon);
|
|
74
|
+
let iosParams = null;
|
|
75
|
+
if (this.platforms.includes("ios")) {
|
|
76
|
+
iosParams = await (0, common_build_utils_1.decodeProvisioningProfile)(this.buildDir, this.provisioningProfile);
|
|
77
|
+
(0, common_build_utils_1.prepareExportOptionsPlist)(this.buildDir, this.appId, iosParams.guuid);
|
|
78
|
+
}
|
|
79
|
+
(0, common_build_utils_1.copyServerFiles)(this.buildDir);
|
|
80
|
+
(0, common_build_utils_1.copySbadmin2Deps)(this.buildDir);
|
|
81
|
+
await (0, common_build_utils_1.copySiteLogo)(this.buildDir);
|
|
82
|
+
(0, common_build_utils_1.copyTranslationFiles)(this.buildDir);
|
|
83
|
+
(0, common_build_utils_1.writeCfgFile)({
|
|
84
|
+
buildDir: this.buildDir,
|
|
85
|
+
entryPoint: this.entryPoint,
|
|
86
|
+
entryPointType: this.entryPointType,
|
|
87
|
+
serverPath: this.serverURL ? this.serverURL : "http://10.0.2.2:3000",
|
|
88
|
+
localUserTables: this.localUserTables,
|
|
89
|
+
synchedTables: this.synchedTables,
|
|
90
|
+
tenantAppName: this.tenantAppName,
|
|
91
|
+
autoPublicLogin: this.autoPublicLogin,
|
|
92
|
+
allowOfflineMode: this.allowOfflineMode,
|
|
93
|
+
});
|
|
94
|
+
let resultCode = await (0, package_bundle_utils_1.bundlePackagesAndPlugins)(this.buildDir, this.plugins);
|
|
95
|
+
if (resultCode !== 0)
|
|
96
|
+
return resultCode;
|
|
97
|
+
resultCode = (0, package_bundle_utils_1.bundleMobileAppCode)(this.buildDir);
|
|
98
|
+
if (resultCode !== 0)
|
|
99
|
+
return resultCode;
|
|
100
|
+
await loadAllPlugins();
|
|
101
|
+
await (0, package_bundle_utils_1.copyPublicDirs)(this.buildDir);
|
|
102
|
+
await (0, common_build_utils_1.buildTablesFile)(this.buildDir, this.includedPlugins);
|
|
103
|
+
if (this.splashPage)
|
|
104
|
+
await (0, common_build_utils_1.prepareSplashPage)(this.buildDir, this.splashPage, this.serverURL, this.tenantAppName, this.user);
|
|
105
|
+
resultCode = await (0, common_build_utils_1.createSqliteDb)(this.buildDir);
|
|
106
|
+
if (resultCode !== 0)
|
|
107
|
+
return resultCode;
|
|
108
|
+
if (this.keyStorePath)
|
|
109
|
+
(0, fs_extra_1.copySync)(this.keyStorePath, (0, path_1.join)(this.buildDir, (0, path_1.basename)(this.keyStorePath)));
|
|
110
|
+
const capacitorHelper = new capacitor_helper_1.CapacitorHelper({
|
|
111
|
+
...this,
|
|
112
|
+
appleTeamId: iosParams?.teamId,
|
|
113
|
+
provisioningGUUID: iosParams?.guuid,
|
|
114
|
+
});
|
|
115
|
+
await capacitorHelper.buildApp();
|
|
116
|
+
if (resultCode === 0 && this.copyTargetDir) {
|
|
117
|
+
capacitorHelper.tryCopyAppFiles(this.copyTargetDir, this.user, this.appName);
|
|
118
|
+
}
|
|
119
|
+
return 0;
|
|
74
120
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(0, common_build_utils_1.prepareExportOptionsPlist)(this.buildDir, this.appId, iosParams.guuid);
|
|
121
|
+
catch (e) {
|
|
122
|
+
console.error(e);
|
|
123
|
+
return 1;
|
|
79
124
|
}
|
|
80
|
-
(0, common_build_utils_1.copyServerFiles)(this.buildDir);
|
|
81
|
-
(0, common_build_utils_1.copySbadmin2Deps)(this.buildDir);
|
|
82
|
-
await (0, common_build_utils_1.copySiteLogo)(this.buildDir);
|
|
83
|
-
(0, common_build_utils_1.copyTranslationFiles)(this.buildDir);
|
|
84
|
-
(0, common_build_utils_1.writeCfgFile)({
|
|
85
|
-
buildDir: this.buildDir,
|
|
86
|
-
entryPoint: this.entryPoint,
|
|
87
|
-
entryPointType: this.entryPointType,
|
|
88
|
-
serverPath: this.serverURL ? this.serverURL : "http://10.0.2.2:3000",
|
|
89
|
-
localUserTables: this.localUserTables,
|
|
90
|
-
synchedTables: this.synchedTables,
|
|
91
|
-
tenantAppName: this.tenantAppName,
|
|
92
|
-
autoPublicLogin: this.autoPublicLogin,
|
|
93
|
-
allowOfflineMode: this.allowOfflineMode,
|
|
94
|
-
});
|
|
95
|
-
let resultCode = await (0, package_bundle_utils_1.bundlePackagesAndPlugins)(this.buildDir, this.plugins);
|
|
96
|
-
if (resultCode !== 0)
|
|
97
|
-
return resultCode;
|
|
98
|
-
features.version_plugin_serve_path = false;
|
|
99
|
-
await loadAllPlugins();
|
|
100
|
-
await (0, package_bundle_utils_1.copyPublicDirs)(this.buildDir);
|
|
101
|
-
await (0, package_bundle_utils_1.installNpmPackages)(this.buildDir, this.pluginManager);
|
|
102
|
-
await (0, common_build_utils_1.buildTablesFile)(this.buildDir, this.includedPlugins);
|
|
103
|
-
if (this.splashPage)
|
|
104
|
-
await (0, common_build_utils_1.prepareSplashPage)(this.buildDir, this.splashPage, this.serverURL, this.tenantAppName, this.user);
|
|
105
|
-
resultCode = await (0, common_build_utils_1.createSqliteDb)(this.buildDir);
|
|
106
|
-
if (resultCode !== 0)
|
|
107
|
-
return resultCode;
|
|
108
|
-
if (this.keyStorePath)
|
|
109
|
-
(0, fs_extra_1.copySync)(this.keyStorePath, (0, path_1.join)(this.buildDir, (0, path_1.basename)(this.keyStorePath)));
|
|
110
|
-
const cordovaHelper = new cordova_helper_1.CordovaHelper({
|
|
111
|
-
...this,
|
|
112
|
-
appleTeamId: iosParams?.teamId,
|
|
113
|
-
provisioningGUUID: iosParams?.guuid,
|
|
114
|
-
});
|
|
115
|
-
resultCode = cordovaHelper.buildApp();
|
|
116
|
-
if (resultCode === 0 && this.copyTargetDir)
|
|
117
|
-
await cordovaHelper.tryCopyAppFiles(this.copyTargetDir, this.user, this.appName);
|
|
118
|
-
return resultCode;
|
|
119
125
|
}
|
|
120
126
|
}
|
|
121
127
|
exports.MobileBuilder = MobileBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobile-builder.js","sourceRoot":"","sources":["../mobile-builder.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACzD,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AACpE
|
|
1
|
+
{"version":3,"file":"mobile-builder.js","sourceRoot":"","sources":["../mobile-builder.ts"],"names":[],"mappings":";;;AAAA,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACzD,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAC;AACpE,+BAAsC;AACtC,uCAAoC;AAEpC,mEAcoC;AACpC,uEAIsC;AAEtC,+DAA2D;AAC3D,gDAA0D;AAG1D,MAAM,YAAY,GAAG,qBAAqB,CAAC;AAC3C,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAiC3C;;GAEG;AACH,MAAa,aAAa;IAgCxB;;;OAGG;IACH,YAAY,GAAwB;QAfpC,gBAAW,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAgBnC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,cAAc,CA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AC,OAAO,CACb,CAAC;aACH;YACD,OAAO,CAAC,CAAC;SACV;QAAC,OAAO,CAAM,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC;SACV;IACH,CAAC;CACF;AA1JD,sCA0JC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type User from "@saltcorn/data/models/user";
|
|
2
|
+
export declare type CapacitorCfg = {
|
|
3
|
+
buildDir: string;
|
|
4
|
+
platforms: string[];
|
|
5
|
+
buildType: "debug" | "release";
|
|
6
|
+
appName: string;
|
|
7
|
+
useDocker?: boolean;
|
|
8
|
+
keyStorePath?: string;
|
|
9
|
+
keyStoreAlias?: string;
|
|
10
|
+
keyStorePassword?: string;
|
|
11
|
+
appleTeamId?: string;
|
|
12
|
+
provisioningGUUID?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare class CapacitorHelper {
|
|
15
|
+
buildDir: string;
|
|
16
|
+
platforms: string[];
|
|
17
|
+
buildType: "debug" | "release";
|
|
18
|
+
appName: string;
|
|
19
|
+
useDocker?: boolean;
|
|
20
|
+
keyStoreFile?: string;
|
|
21
|
+
keyStoreAlias?: string;
|
|
22
|
+
keyStorePassword?: string;
|
|
23
|
+
appleTeamId?: string;
|
|
24
|
+
provisioningGUUID?: string;
|
|
25
|
+
isAndroid: boolean;
|
|
26
|
+
isIOS: boolean;
|
|
27
|
+
constructor(cfg: CapacitorCfg);
|
|
28
|
+
buildApp(): Promise<void>;
|
|
29
|
+
tryCopyAppFiles(copyDir: string, user: User, appName?: string): void;
|
|
30
|
+
private addPlatforms;
|
|
31
|
+
private generateAssets;
|
|
32
|
+
private gradleBuild;
|
|
33
|
+
private buildWithDocker;
|
|
34
|
+
private xCodeBuild;
|
|
35
|
+
private capSync;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=capacitor-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacitor-helper.d.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OAAO;CAgBhB"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CapacitorHelper = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const fs_extra_1 = require("fs-extra");
|
|
11
|
+
const utils = require("@saltcorn/data/utils");
|
|
12
|
+
const { fileWithEnding, safeEnding } = utils;
|
|
13
|
+
const file_1 = __importDefault(require("@saltcorn/data/models/file"));
|
|
14
|
+
const common_build_utils_1 = require("./common-build-utils");
|
|
15
|
+
class CapacitorHelper {
|
|
16
|
+
constructor(cfg) {
|
|
17
|
+
this.buildDir = cfg.buildDir;
|
|
18
|
+
this.platforms = cfg.platforms;
|
|
19
|
+
this.buildType = cfg.buildType || "debug";
|
|
20
|
+
this.appName = cfg.appName;
|
|
21
|
+
this.useDocker = cfg.useDocker;
|
|
22
|
+
this.keyStoreFile = cfg.keyStorePath
|
|
23
|
+
? (0, path_1.basename)(cfg.keyStorePath)
|
|
24
|
+
: undefined;
|
|
25
|
+
this.keyStoreAlias = cfg.keyStoreAlias;
|
|
26
|
+
this.keyStorePassword = cfg.keyStorePassword;
|
|
27
|
+
this.appleTeamId = cfg.appleTeamId;
|
|
28
|
+
this.provisioningGUUID = cfg.provisioningGUUID;
|
|
29
|
+
this.isAndroid = this.platforms.includes("android");
|
|
30
|
+
this.isIOS = this.platforms.includes("ios");
|
|
31
|
+
}
|
|
32
|
+
async buildApp() {
|
|
33
|
+
if (!this.useDocker) {
|
|
34
|
+
this.addPlatforms();
|
|
35
|
+
this.generateAssets();
|
|
36
|
+
this.capSync();
|
|
37
|
+
(0, common_build_utils_1.copyPrepopulatedDb)(this.buildDir, this.platforms);
|
|
38
|
+
if (this.isAndroid) {
|
|
39
|
+
await (0, common_build_utils_1.modifyAndroidManifest)(this.buildDir);
|
|
40
|
+
(0, common_build_utils_1.writeDataExtractionRules)(this.buildDir);
|
|
41
|
+
(0, common_build_utils_1.writeNetworkSecurityConfig)(this.buildDir);
|
|
42
|
+
if (this.keyStoreFile && this.keyStoreAlias && this.keyStorePassword)
|
|
43
|
+
(0, common_build_utils_1.modifyGradleConfig)(this.buildDir, this.keyStoreFile, this.keyStoreAlias, this.keyStorePassword);
|
|
44
|
+
this.gradleBuild();
|
|
45
|
+
}
|
|
46
|
+
if (this.isIOS) {
|
|
47
|
+
(0, common_build_utils_1.writePodfile)(this.buildDir);
|
|
48
|
+
await (0, common_build_utils_1.modifyInfoPlist)(this.buildDir);
|
|
49
|
+
(0, common_build_utils_1.writePrivacyInfo)(this.buildDir);
|
|
50
|
+
this.xCodeBuild();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
else
|
|
54
|
+
this.buildWithDocker();
|
|
55
|
+
}
|
|
56
|
+
tryCopyAppFiles(copyDir, user, appName) {
|
|
57
|
+
const copyHelper = async (ending, apkBuildDir) => {
|
|
58
|
+
const appFile = fileWithEnding(apkBuildDir, `.${ending}`);
|
|
59
|
+
if (appFile) {
|
|
60
|
+
const dstFile = appName
|
|
61
|
+
? safeEnding(appName, `.${ending}`)
|
|
62
|
+
: `app-${this.buildType}.${ending}`;
|
|
63
|
+
(0, fs_extra_1.copySync)((0, path_1.join)(apkBuildDir, appFile), (0, path_1.join)(copyDir, dstFile));
|
|
64
|
+
await file_1.default.set_xattr_of_existing_file(dstFile, copyDir, user);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const appDir = (0, path_1.join)(this.buildDir, "android", "app", "build", "outputs", "apk", this.buildType);
|
|
68
|
+
const ending = this.buildType === "debug" ? "apk" : "aab";
|
|
69
|
+
if (!(0, fs_1.existsSync)(copyDir))
|
|
70
|
+
(0, fs_1.mkdirSync)(copyDir);
|
|
71
|
+
copyHelper(ending, appDir);
|
|
72
|
+
// ipa
|
|
73
|
+
copyHelper("ipa", this.buildDir);
|
|
74
|
+
}
|
|
75
|
+
addPlatforms() {
|
|
76
|
+
const addFn = (platform) => {
|
|
77
|
+
let result = (0, child_process_1.spawnSync)("npm", ["install", `@capacitor/${platform}`], {
|
|
78
|
+
cwd: this.buildDir,
|
|
79
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
80
|
+
env: {
|
|
81
|
+
...process.env,
|
|
82
|
+
NODE_ENV: "development",
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
if (result.output)
|
|
86
|
+
console.log(result.output.toString());
|
|
87
|
+
else if (result.error)
|
|
88
|
+
throw new Error(`Unable to install ${platform} (code ${result.status})` +
|
|
89
|
+
`\n\n${result.error.toString()}`);
|
|
90
|
+
result = (0, child_process_1.spawnSync)("npx", ["cap", "add", platform], {
|
|
91
|
+
cwd: this.buildDir,
|
|
92
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
93
|
+
env: {
|
|
94
|
+
...process.env,
|
|
95
|
+
NODE_ENV: "development",
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
if (result.output)
|
|
99
|
+
console.log(result.output.toString());
|
|
100
|
+
else if (result.error)
|
|
101
|
+
throw new Error(`Unable to add ${platform} (code ${result.status})` +
|
|
102
|
+
`\n\n${result.error.toString()}`);
|
|
103
|
+
};
|
|
104
|
+
for (const platform of this.platforms)
|
|
105
|
+
addFn(platform);
|
|
106
|
+
}
|
|
107
|
+
generateAssets() {
|
|
108
|
+
const result = (0, child_process_1.spawnSync)("npx", ["capacitor-assets", "generate"], {
|
|
109
|
+
cwd: this.buildDir,
|
|
110
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
111
|
+
env: {
|
|
112
|
+
...process.env,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
if (result.output)
|
|
116
|
+
console.log(result.output.toString());
|
|
117
|
+
else if (result.error)
|
|
118
|
+
throw new Error(`Unable to generate assets (code ${result.status})` +
|
|
119
|
+
`\n\n${result.error.toString()}`);
|
|
120
|
+
}
|
|
121
|
+
gradleBuild() {
|
|
122
|
+
const result = (0, child_process_1.spawnSync)("./gradlew", [this.buildType === "release" ? "bundleRelease" : "assembleDebug"], {
|
|
123
|
+
cwd: this.buildDir + "/android",
|
|
124
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
125
|
+
env: {
|
|
126
|
+
...process.env,
|
|
127
|
+
NODE_ENV: "development",
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
if (result.output)
|
|
131
|
+
console.log(result.output.toString());
|
|
132
|
+
else if (result.error)
|
|
133
|
+
throw new Error(`Unable to call the gradlew build (code ${result.status})` +
|
|
134
|
+
`\n\n${result.error.toString()}`);
|
|
135
|
+
}
|
|
136
|
+
buildWithDocker() {
|
|
137
|
+
const spawnParams = [
|
|
138
|
+
"run",
|
|
139
|
+
"--network",
|
|
140
|
+
"host",
|
|
141
|
+
"-v",
|
|
142
|
+
`${this.buildDir}:/saltcorn-mobile-app`,
|
|
143
|
+
"saltcorn/capacitor-builder",
|
|
144
|
+
];
|
|
145
|
+
spawnParams.push(this.buildType);
|
|
146
|
+
if (this.keyStoreFile)
|
|
147
|
+
spawnParams.push(this.keyStoreFile, this.keyStoreAlias || "??", this.keyStorePassword || "??");
|
|
148
|
+
const result = (0, child_process_1.spawnSync)("docker", spawnParams, {
|
|
149
|
+
cwd: ".",
|
|
150
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
151
|
+
});
|
|
152
|
+
if (result.output)
|
|
153
|
+
console.log(result.output.toString());
|
|
154
|
+
else if (result.error)
|
|
155
|
+
throw new Error(`Unable to build with docker (code ${result.status})` +
|
|
156
|
+
`\n\n${result.error.toString()}`);
|
|
157
|
+
}
|
|
158
|
+
xCodeBuild() {
|
|
159
|
+
try {
|
|
160
|
+
console.log("xcodebuild -workspace");
|
|
161
|
+
let buffer = (0, child_process_1.execSync)(`xcodebuild -workspace ios/App/App.xcworkspace ` +
|
|
162
|
+
`-scheme App -destination "generic/platform=iOS" ` +
|
|
163
|
+
`-archivePath MyArchive.xcarchive archive PROVISIONING_PROFILE="${this.provisioningGUUID}" ` +
|
|
164
|
+
' CODE_SIGN_STYLE="Manual" CODE_SIGN_IDENTITY="iPhone Distribution" ' +
|
|
165
|
+
` DEVELOPMENT_TEAM="${this.appleTeamId}" `, { cwd: this.buildDir, maxBuffer: 1024 * 1024 * 10 });
|
|
166
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(this.buildDir, "MyArchive.xcarchive"))) {
|
|
167
|
+
console.log("Unable to export ipa: xcodebuild did not create the archivePath.");
|
|
168
|
+
return 1;
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
console.log("xcodebuild -exportArchive");
|
|
172
|
+
buffer = (0, child_process_1.execSync)("xcodebuild -exportArchive -archivePath MyArchive.xcarchive " +
|
|
173
|
+
`-exportPath ${this.buildDir} -exportOptionsPlist ExportOptions.plist`, { cwd: this.buildDir, maxBuffer: 1024 * 1024 * 10 });
|
|
174
|
+
console.log(buffer.toString());
|
|
175
|
+
// to upload it automatically:
|
|
176
|
+
// xrun altool --upload-app -f [.ipa file] -t ios -u [apple-id] -p [app-specific password]
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (err) {
|
|
181
|
+
console.log(err);
|
|
182
|
+
return 1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
capSync() {
|
|
186
|
+
const result = (0, child_process_1.spawnSync)("npx", ["cap", "sync"], {
|
|
187
|
+
cwd: this.buildDir,
|
|
188
|
+
maxBuffer: 1024 * 1024 * 10,
|
|
189
|
+
env: {
|
|
190
|
+
...process.env,
|
|
191
|
+
NODE_ENV: "development",
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
if (result.output)
|
|
195
|
+
console.log(result.output.toString());
|
|
196
|
+
else if (result.error)
|
|
197
|
+
throw new Error(`Unable to sync the native directory (code ${result.status})` +
|
|
198
|
+
`\n\n${result.error.toString()}`);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.CapacitorHelper = CapacitorHelper;
|
|
202
|
+
//# sourceMappingURL=capacitor-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capacitor-helper.js","sourceRoot":"","sources":["../../utils/capacitor-helper.ts"],"names":[],"mappings":";;;;;;AAAA,iDAAoD;AACpD,+BAAsC;AACtC,2BAA2C;AAC3C,uCAAoC;AAEpC,8CAA+C;AAC/C,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;AAC7C,sEAA8C;AAC9C,6DAS8B;AAiB9B,MAAa,eAAe;IAiB1B,YAAY,GAAiB;QAC3B,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,OAAO,CAAC;QAC1C,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAE3B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,GAAG,CAAC,YAAY;YAClC,CAAC,CAAC,IAAA,eAAQ,EAAC,GAAG,CAAC,YAAY,CAAC;YAC5B,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,CAAC,aAAa,GAAG,GAAG,CAAC,aAAa,CAAC;QACvC,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC,gBAAgB,CAAC;QAE7C,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QACnC,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC;QAE/C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,C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CAAC;gBACzC,MAAM,GAAG,IAAA,wBAAQ,EACf,6DAA6D;oBAC3D,eAAe,IAAI,CAAC,QAAQ,0CAA0C,EACxE,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,CACpD,CAAC;gBACF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;gBAC/B,8BAA8B;gBAC9B,0FAA0F;gBAC1F,OAAO,CAAC,CAAC;aACV;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,CAAC,CAAC;SACV;IACH,CAAC;IAEO,OAAO;QACb,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE;YAC/C,GAAG,EAAE,IAAI,CAAC,QAAQ;YAClB,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE;YAC3B,GAAG,EAAE;gBACH,GAAG,OAAO,CAAC,GAAG;gBACd,QAAQ,EAAE,aAAa;aACxB;SACF,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,MAAM;YAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;aACpD,IAAI,MAAM,CAAC,KAAK;YACnB,MAAM,IAAI,KAAK,CACb,6CAA6C,MAAM,CAAC,MAAM,GAAG;gBAC3D,OAAO,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,CACnC,CAAC;IACN,CAAC;CACF;AArPD,0CAqPC"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type User from "@saltcorn/data/models/user";
|
|
2
2
|
/**
|
|
3
3
|
* copy saltcorn-mobile-app as a template to buildDir
|
|
4
|
+
* and install the capacitor and cordova modules to node_modules (cap sync will be run later)
|
|
4
5
|
* @param buildDir directory where the app will be build
|
|
5
6
|
* @param templateDir directory of the template code that will be copied to 'buildDir'
|
|
6
7
|
*/
|
|
7
8
|
export declare function prepareBuildDir(buildDir: string, templateDir: string): void;
|
|
9
|
+
export declare function writeCapacitorConfig(buildDir: string, config: any): void;
|
|
10
|
+
export declare function prepAppIcon(buildDir: string, appIcon: string): void;
|
|
11
|
+
export declare function modifyAndroidManifest(buildDir: string): Promise<void>;
|
|
12
|
+
export declare function writeDataExtractionRules(buildDir: string): void;
|
|
13
|
+
export declare function copyPrepopulatedDb(buildDir: string, platforms: string[]): void;
|
|
14
|
+
export declare function writeNetworkSecurityConfig(buildDir: string): void;
|
|
8
15
|
export declare function modifyConfigXml(buildDir: string, config: any): Promise<void>;
|
|
9
16
|
/**
|
|
10
17
|
* copy a png file into the build dir and use it as launcher icon
|
|
@@ -22,10 +29,12 @@ export declare function prepareAppIcon(buildDir: string, appIcon: string, platfo
|
|
|
22
29
|
*/
|
|
23
30
|
export declare function prepareSplashIcon(buildDir: string, splashIcon: string, platforms: string[]): Promise<void>;
|
|
24
31
|
export declare function prepareExportOptionsPlist(buildDir: string, appId: string, provisioningProfile: string): void;
|
|
32
|
+
export declare function modifyInfoPlist(buildDir: string): Promise<void>;
|
|
25
33
|
export declare function decodeProvisioningProfile(buildDir: string, provisioningProfile: string): Promise<{
|
|
26
34
|
guuid: any;
|
|
27
35
|
teamId: any;
|
|
28
36
|
}>;
|
|
37
|
+
export declare function writePrivacyInfo(buildDir: string): void;
|
|
29
38
|
/**
|
|
30
39
|
* copy files from 'server/public' into the www folder (with a version_tag prefix)
|
|
31
40
|
* @param buildDir directory where the app will be build
|
|
@@ -75,4 +84,6 @@ export declare function createSqliteDb(buildDir: string): Promise<number | null>
|
|
|
75
84
|
* @param user
|
|
76
85
|
*/
|
|
77
86
|
export declare function prepareSplashPage(buildDir: string, pageName: string, serverUrl: string, tenantAppName?: string, user?: User): Promise<void>;
|
|
87
|
+
export declare function writePodfile(buildDir: string): void;
|
|
88
|
+
export declare function modifyGradleConfig(buildDir: string, keyStoreFile: string, keyStoreAlias: string, keyStorePassword: string): void;
|
|
78
89
|
//# sourceMappingURL=common-build-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common-build-utils.d.ts","sourceRoot":"","sources":["../../utils/common-build-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"common-build-utils.d.ts","sourceRoot":"","sources":["../../utils/common-build-utils.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,IAAI,MAAM,4BAA4B,CAAC;AAQnD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAmCpE;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,QAkDjE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAY5D;AAED,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,iBAqC3D;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,QA8BxD;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAiCvE;AAED,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,QAqB1D;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,iBAkBlE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EAAE,iBAepB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EAAE,iBAkCpB;AA4CD,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,K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