@atonemi/expo-android-splits-plugin 0.1.1 → 1.0.0
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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ConfigPlugin } from "expo/config-plugins";
|
|
2
2
|
export interface PluginOptions {
|
|
3
|
-
buildArchs?: string[];
|
|
4
3
|
}
|
|
5
|
-
declare const withAndroidSplits: ConfigPlugin
|
|
4
|
+
declare const withAndroidSplits: ConfigPlugin;
|
|
6
5
|
export default withAndroidSplits;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_plugins_1 = require("expo/config-plugins");
|
|
4
|
-
const withAndroidSplits = (config
|
|
4
|
+
const withAndroidSplits = (config) => {
|
|
5
5
|
return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
|
|
6
6
|
const buildGradle = config.modResults.contents;
|
|
7
|
-
const includes = buildArchs && buildArchs.length > 0
|
|
8
|
-
? buildArchs
|
|
9
|
-
: ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
|
|
10
7
|
const splitsConfig = `
|
|
11
8
|
splits {
|
|
12
9
|
abi {
|
|
13
|
-
enable true
|
|
10
|
+
enable System.getenv('ENABLE_ABI_SPLITS') == 'true'
|
|
14
11
|
reset()
|
|
15
|
-
include
|
|
12
|
+
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
16
13
|
universalApk false
|
|
17
14
|
}
|
|
18
15
|
}
|
package/package.json
CHANGED
package/src/withAndroidSplits.ts
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import { withAppBuildGradle } from "expo/config-plugins";
|
|
2
2
|
import type { ConfigPlugin } from "expo/config-plugins";
|
|
3
3
|
|
|
4
|
-
export interface PluginOptions {
|
|
5
|
-
buildArchs?: string[];
|
|
6
|
-
}
|
|
4
|
+
export interface PluginOptions {}
|
|
7
5
|
|
|
8
|
-
const withAndroidSplits: ConfigPlugin
|
|
6
|
+
const withAndroidSplits: ConfigPlugin = (config) => {
|
|
9
7
|
return withAppBuildGradle(config, (config) => {
|
|
10
8
|
const buildGradle = config.modResults.contents;
|
|
11
|
-
const includes =
|
|
12
|
-
buildArchs && buildArchs.length > 0
|
|
13
|
-
? buildArchs
|
|
14
|
-
: ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
|
|
15
9
|
|
|
16
10
|
const splitsConfig = `
|
|
17
11
|
splits {
|
|
18
12
|
abi {
|
|
19
|
-
enable true
|
|
13
|
+
enable System.getenv('ENABLE_ABI_SPLITS') == 'true'
|
|
20
14
|
reset()
|
|
21
|
-
include
|
|
15
|
+
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
|
|
22
16
|
universalApk false
|
|
23
17
|
}
|
|
24
18
|
}
|
|
25
19
|
`;
|
|
26
|
-
|
|
27
20
|
if (!buildGradle.includes("splits {")) {
|
|
28
21
|
config.modResults.contents = buildGradle.replace(/android\s*{/, `android {\n${splitsConfig}`);
|
|
29
22
|
}
|