expo-build-properties 0.11.0 → 0.12.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.
- package/CHANGELOG.md +21 -0
- package/README.md +2 -4
- package/build/android.d.ts +0 -1
- package/build/android.js +18 -27
- package/build/androidQueryUtils.js +3 -4
- package/build/fileContentsUtils.js +2 -3
- package/build/ios.js +4 -9
- package/build/pluginConfig.d.ts +90 -31
- package/build/pluginConfig.js +59 -16
- package/build/withBuildProperties.js +0 -1
- package/package.json +3 -3
- package/src/android.ts +16 -36
- package/src/ios.ts +4 -9
- package/src/pluginConfig.ts +156 -50
- package/src/withBuildProperties.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,27 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.12.0 — 2024-04-18
|
|
14
|
+
|
|
15
|
+
### 🛠 Breaking changes
|
|
16
|
+
|
|
17
|
+
- Removed Flipper support. ([#26581](https://github.com/expo/expo/pull/26581) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
### 🎉 New features
|
|
20
|
+
|
|
21
|
+
- Expand `android.extraMavenRepos` to allow authentication-required Maven repositories. ([#26895](https://github.com/expo/expo/pull/26895) by [@bpeltonc](https://github.com/bpeltonc))
|
|
22
|
+
- Added `extraPods` and `extraMavenRepos` supports within `withBuildProperties()` that library authors could reuse in third-party libraries. ([#28106](https://github.com/expo/expo/pull/28106) by [@kudo](https://github.com/kudo))
|
|
23
|
+
|
|
24
|
+
### 📚 3rd party library updates
|
|
25
|
+
|
|
26
|
+
- update semver from 7.5.3 to 7.5.4. ([#26876](https://github.com/expo/expo/pull/26876) by [@GaelCO](https://github.com/GaelCO))
|
|
27
|
+
|
|
28
|
+
## 0.11.1 - 2024-02-01
|
|
29
|
+
|
|
30
|
+
### 🎉 New features
|
|
31
|
+
|
|
32
|
+
- Added `useLegacyPackaging` property to instruct AGP to compress native libraries in the APK. ([#26779](https://github.com/expo/expo/pull/26779) by [@alanjhughes](https://github.com/alanjhughes))
|
|
33
|
+
|
|
13
34
|
## 0.11.0 — 2023-11-14
|
|
14
35
|
|
|
15
36
|
### 🛠 Breaking changes
|
package/README.md
CHANGED
|
@@ -25,12 +25,10 @@ Add plugin to `app.json`. For example:
|
|
|
25
25
|
"android": {
|
|
26
26
|
"compileSdkVersion": 31,
|
|
27
27
|
"targetSdkVersion": 31,
|
|
28
|
-
"buildToolsVersion": "31.0.0"
|
|
29
|
-
"flipper": true
|
|
28
|
+
"buildToolsVersion": "31.0.0"
|
|
30
29
|
},
|
|
31
30
|
"ios": {
|
|
32
|
-
"deploymentTarget": "13.0"
|
|
33
|
-
"flipper": true
|
|
31
|
+
"deploymentTarget": "13.0"
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
34
|
]
|
package/build/android.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ConfigPlugin } from 'expo/config-plugins';
|
|
2
2
|
import type { PluginConfigType } from './pluginConfig';
|
|
3
3
|
export declare const withAndroidBuildProperties: ConfigPlugin<PluginConfigType>;
|
|
4
|
-
export declare const withAndroidFlipper: ConfigPlugin<PluginConfigType>;
|
|
5
4
|
/**
|
|
6
5
|
* Appends `props.android.extraProguardRules` content into `android/app/proguard-rules.pro`
|
|
7
6
|
*/
|
package/build/android.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.withAndroidQueries = exports.withAndroidCleartextTraffic = exports.
|
|
6
|
+
exports.withAndroidQueries = exports.withAndroidCleartextTraffic = exports.withAndroidPurgeProguardRulesOnce = exports.withAndroidProguardRules = exports.withAndroidBuildProperties = void 0;
|
|
7
|
+
exports.updateAndroidProguardRules = updateAndroidProguardRules;
|
|
7
8
|
const config_plugins_1 = require("expo/config-plugins");
|
|
8
9
|
const fs_1 = __importDefault(require("fs"));
|
|
9
10
|
const path_1 = __importDefault(require("path"));
|
|
@@ -63,32 +64,23 @@ exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([
|
|
|
63
64
|
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
64
65
|
propValueGetter: (config) => (config.android?.networkInspector ?? true).toString(),
|
|
65
66
|
},
|
|
67
|
+
{
|
|
68
|
+
propName: 'expo.useLegacyPackaging',
|
|
69
|
+
propValueGetter: (config) => (config.android?.useLegacyPackaging ?? false).toString(),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
propName: 'android.extraMavenRepos',
|
|
73
|
+
propValueGetter: (config) => {
|
|
74
|
+
const extraMavenRepos = (config.android?.extraMavenRepos ?? []).map((item) => {
|
|
75
|
+
if (typeof item === 'string') {
|
|
76
|
+
return { url: item };
|
|
77
|
+
}
|
|
78
|
+
return item;
|
|
79
|
+
});
|
|
80
|
+
return JSON.stringify(extraMavenRepos);
|
|
81
|
+
},
|
|
82
|
+
},
|
|
66
83
|
], 'withAndroidBuildProperties');
|
|
67
|
-
const withAndroidFlipper = (config, props) => {
|
|
68
|
-
const ANDROID_FLIPPER_KEY = 'FLIPPER_VERSION';
|
|
69
|
-
const FLIPPER_FALLBACK = '0.125.0';
|
|
70
|
-
// when not set, make no changes
|
|
71
|
-
if (props.android?.flipper === undefined) {
|
|
72
|
-
return config;
|
|
73
|
-
}
|
|
74
|
-
return (0, config_plugins_1.withGradleProperties)(config, (c) => {
|
|
75
|
-
// check for Flipper version in package. If set, use that
|
|
76
|
-
let existing;
|
|
77
|
-
const found = c.modResults.find((item) => item.type === 'property' && item.key === ANDROID_FLIPPER_KEY);
|
|
78
|
-
if (found && found.type === 'property') {
|
|
79
|
-
existing = found.value;
|
|
80
|
-
}
|
|
81
|
-
// strip key and re-add based on setting
|
|
82
|
-
c.modResults = c.modResults.filter((item) => !(item.type === 'property' && item.key === ANDROID_FLIPPER_KEY));
|
|
83
|
-
c.modResults.push({
|
|
84
|
-
type: 'property',
|
|
85
|
-
key: ANDROID_FLIPPER_KEY,
|
|
86
|
-
value: (props.android?.flipper ?? existing ?? FLIPPER_FALLBACK),
|
|
87
|
-
});
|
|
88
|
-
return c;
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
exports.withAndroidFlipper = withAndroidFlipper;
|
|
92
84
|
/**
|
|
93
85
|
* Appends `props.android.extraProguardRules` content into `android/app/proguard-rules.pro`
|
|
94
86
|
*/
|
|
@@ -174,7 +166,6 @@ function updateAndroidProguardRules(contents, newProguardRules, updateMode) {
|
|
|
174
166
|
}
|
|
175
167
|
return newContents;
|
|
176
168
|
}
|
|
177
|
-
exports.updateAndroidProguardRules = updateAndroidProguardRules;
|
|
178
169
|
const withAndroidCleartextTraffic = (config, props) => {
|
|
179
170
|
return (0, config_plugins_1.withAndroidManifest)(config, (config) => {
|
|
180
171
|
if (props.android?.usesCleartextTraffic == null) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.renderQueryProviders = renderQueryProviders;
|
|
4
|
+
exports.renderQueryPackages = renderQueryPackages;
|
|
5
|
+
exports.renderQueryIntents = renderQueryIntents;
|
|
4
6
|
function renderQueryProviders(data) {
|
|
5
7
|
const dataStr = Array.isArray(data) ? data.join(';') : data;
|
|
6
8
|
return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
|
|
7
9
|
}
|
|
8
|
-
exports.renderQueryProviders = renderQueryProviders;
|
|
9
10
|
function renderQueryPackages(data) {
|
|
10
11
|
return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
|
|
11
12
|
$: {
|
|
@@ -13,7 +14,6 @@ function renderQueryPackages(data) {
|
|
|
13
14
|
},
|
|
14
15
|
}));
|
|
15
16
|
}
|
|
16
|
-
exports.renderQueryPackages = renderQueryPackages;
|
|
17
17
|
function renderQueryIntents(queryIntents) {
|
|
18
18
|
return (queryIntents?.map((intent) => {
|
|
19
19
|
const { data, category, action } = intent;
|
|
@@ -36,4 +36,3 @@ function renderQueryIntents(queryIntents) {
|
|
|
36
36
|
};
|
|
37
37
|
}) ?? []);
|
|
38
38
|
}
|
|
39
|
-
exports.renderQueryIntents = renderQueryIntents;
|
|
@@ -6,7 +6,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.appendContents = appendContents;
|
|
10
|
+
exports.purgeContents = purgeContents;
|
|
10
11
|
const assert_1 = __importDefault(require("assert"));
|
|
11
12
|
/**
|
|
12
13
|
* Append new contents to src with generated section comments
|
|
@@ -28,7 +29,6 @@ function appendContents(src, contents, sectionOptions) {
|
|
|
28
29
|
return `${src}\n${sectionedContents}`;
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
exports.appendContents = appendContents;
|
|
32
32
|
/**
|
|
33
33
|
* Purge a generated section
|
|
34
34
|
*/
|
|
@@ -38,7 +38,6 @@ function purgeContents(src, sectionOptions) {
|
|
|
38
38
|
const regex = new RegExp(`\\n${escapeRegExp(start)}\\n[\\s\\S]*\\n${escapeRegExp(end)}`, 'gm');
|
|
39
39
|
return src.replace(regex, '');
|
|
40
40
|
}
|
|
41
|
-
exports.purgeContents = purgeContents;
|
|
42
41
|
/**
|
|
43
42
|
* Create comments for generated section
|
|
44
43
|
*/
|
package/build/ios.js
CHANGED
|
@@ -12,19 +12,14 @@ exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([
|
|
|
12
12
|
propName: 'ios.useFrameworks',
|
|
13
13
|
propValueGetter: (config) => config.ios?.useFrameworks,
|
|
14
14
|
},
|
|
15
|
-
{
|
|
16
|
-
propName: 'ios.flipper',
|
|
17
|
-
propValueGetter: (config) => {
|
|
18
|
-
if (typeof config.ios?.flipper === 'string' || typeof config.ios?.flipper === 'boolean') {
|
|
19
|
-
return config.ios.flipper.toString();
|
|
20
|
-
}
|
|
21
|
-
return undefined;
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
15
|
{
|
|
25
16
|
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
26
17
|
propValueGetter: (config) => (config.ios?.networkInspector ?? true).toString(),
|
|
27
18
|
},
|
|
19
|
+
{
|
|
20
|
+
propName: 'apple.extraPods',
|
|
21
|
+
propValueGetter: (config) => JSON.stringify(config.ios?.extraPods ?? []),
|
|
22
|
+
},
|
|
28
23
|
], 'withIosBuildProperties');
|
|
29
24
|
const withIosDeploymentTarget = (config, props) => {
|
|
30
25
|
const deploymentTarget = props.ios?.deploymentTarget;
|
package/build/pluginConfig.d.ts
CHANGED
|
@@ -59,14 +59,6 @@ export interface PluginConfigTypeAndroid {
|
|
|
59
59
|
* Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions).
|
|
60
60
|
*/
|
|
61
61
|
packagingOptions?: PluginConfigTypeAndroidPackagingOptions;
|
|
62
|
-
/**
|
|
63
|
-
* By default, Flipper is enabled with the version that comes bundled with `react-native`.
|
|
64
|
-
*
|
|
65
|
-
* Use this to change the [Flipper](https://fbflipper.com/) version when
|
|
66
|
-
* running your app on Android. You can set the `flipper` property to a
|
|
67
|
-
* semver string and specify an alternate Flipper version.
|
|
68
|
-
*/
|
|
69
|
-
flipper?: string;
|
|
70
62
|
/**
|
|
71
63
|
* Enable the Network Inspector.
|
|
72
64
|
*
|
|
@@ -76,21 +68,45 @@ export interface PluginConfigTypeAndroid {
|
|
|
76
68
|
/**
|
|
77
69
|
* Add extra maven repositories to all gradle projects.
|
|
78
70
|
*
|
|
79
|
-
*
|
|
71
|
+
*
|
|
72
|
+
* Takes an array of objects or strings.
|
|
73
|
+
* Strings are passed as the `url` property of the object with no credentials or authentication scheme.
|
|
74
|
+
*
|
|
75
|
+
* This adds the following code to **android/build.gradle**:
|
|
76
|
+
* ```groovy
|
|
77
|
+
* allprojects {
|
|
78
|
+
* repositories {
|
|
79
|
+
* maven {
|
|
80
|
+
* url "https://foo.com/maven-releases"
|
|
81
|
+
* }
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* By using an `AndroidMavenRepository` object, you can specify credentials and an authentication scheme.
|
|
86
|
+
*
|
|
80
87
|
* ```groovy
|
|
81
88
|
* allprojects {
|
|
82
89
|
* repositories {
|
|
83
90
|
* maven {
|
|
84
|
-
* url
|
|
91
|
+
* url "https://foo.com/maven-releases"
|
|
92
|
+
* credentials {
|
|
93
|
+
* username = "bar"
|
|
94
|
+
* password = "baz"
|
|
95
|
+
* }
|
|
96
|
+
* authentication {
|
|
97
|
+
* basic(BasicAuthentication)
|
|
98
|
+
* }
|
|
85
99
|
* }
|
|
86
100
|
* }
|
|
87
101
|
* }
|
|
88
102
|
* ```
|
|
89
103
|
*
|
|
104
|
+
* @see [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven)
|
|
105
|
+
*
|
|
90
106
|
* @hide For the implementation details,
|
|
91
|
-
* this property is actually handled by `expo-modules-autolinking`
|
|
107
|
+
* this property is actually handled by `expo-modules-autolinking` not the config-plugins inside `expo-build-properties`
|
|
92
108
|
*/
|
|
93
|
-
extraMavenRepos?: string[];
|
|
109
|
+
extraMavenRepos?: (AndroidMavenRepository | string)[];
|
|
94
110
|
/**
|
|
95
111
|
* Indicates whether the app intends to use cleartext network traffic.
|
|
96
112
|
*
|
|
@@ -99,6 +115,14 @@ export interface PluginConfigTypeAndroid {
|
|
|
99
115
|
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic)
|
|
100
116
|
*/
|
|
101
117
|
usesCleartextTraffic?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Instructs the Android Gradle plugin to compress native libraries in the APK using the legacy packaging system.
|
|
120
|
+
*
|
|
121
|
+
* @default false
|
|
122
|
+
*
|
|
123
|
+
* @see [Android documentation](https://developer.android.com/build/releases/past-releases/agp-4-2-0-release-notes#compress-native-libs-dsl)
|
|
124
|
+
*/
|
|
125
|
+
useLegacyPackaging?: boolean;
|
|
102
126
|
/**
|
|
103
127
|
* Specifies the set of other apps that an app intends to interact with. These other apps are specified by package name,
|
|
104
128
|
* by intent signature, or by provider authority.
|
|
@@ -107,6 +131,37 @@ export interface PluginConfigTypeAndroid {
|
|
|
107
131
|
*/
|
|
108
132
|
manifestQueries?: PluginConfigTypeAndroidQueries;
|
|
109
133
|
}
|
|
134
|
+
export interface AndroidMavenRepository {
|
|
135
|
+
/**
|
|
136
|
+
* The URL of the Maven repository.
|
|
137
|
+
*/
|
|
138
|
+
url: string;
|
|
139
|
+
/**
|
|
140
|
+
* The credentials to use when accessing the Maven repository.
|
|
141
|
+
* May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.
|
|
142
|
+
*
|
|
143
|
+
* @see the authentication schemes section of [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:authentication_schemes) for more information.
|
|
144
|
+
*/
|
|
145
|
+
credentials?: AndroidMavenRepositoryCredentials;
|
|
146
|
+
/**
|
|
147
|
+
* The authentication scheme to use when accessing the Maven repository.
|
|
148
|
+
*/
|
|
149
|
+
authentication?: 'basic' | 'digest' | 'header';
|
|
150
|
+
}
|
|
151
|
+
interface AndroidMavenRepositoryPasswordCredentials {
|
|
152
|
+
username: string;
|
|
153
|
+
password: string;
|
|
154
|
+
}
|
|
155
|
+
interface AndroidMavenRepositoryHttpHeaderCredentials {
|
|
156
|
+
name: string;
|
|
157
|
+
value: string;
|
|
158
|
+
}
|
|
159
|
+
interface AndroidMavenRepositoryAWSCredentials {
|
|
160
|
+
accessKey: string;
|
|
161
|
+
secretKey: string;
|
|
162
|
+
sessionToken?: string;
|
|
163
|
+
}
|
|
164
|
+
type AndroidMavenRepositoryCredentials = AndroidMavenRepositoryPasswordCredentials | AndroidMavenRepositoryHttpHeaderCredentials | AndroidMavenRepositoryAWSCredentials;
|
|
110
165
|
/**
|
|
111
166
|
* Interface representing available configuration for iOS native build properties.
|
|
112
167
|
* @platform ios
|
|
@@ -125,21 +180,8 @@ export interface PluginConfigTypeIos {
|
|
|
125
180
|
/**
|
|
126
181
|
* Enable [`use_frameworks!`](https://guides.cocoapods.org/syntax/podfile.html#use_frameworks_bang)
|
|
127
182
|
* in `Podfile` to use frameworks instead of static libraries for Pods.
|
|
128
|
-
*
|
|
129
|
-
* > You cannot use `useFrameworks` and `flipper` at the same time, and
|
|
130
|
-
* doing so will generate an error.
|
|
131
183
|
*/
|
|
132
184
|
useFrameworks?: 'static' | 'dynamic';
|
|
133
|
-
/**
|
|
134
|
-
* Enable [Flipper](https://fbflipper.com/) when running your app on iOS in
|
|
135
|
-
* Debug mode. Setting `true` enables the default version of Flipper, while
|
|
136
|
-
* setting a semver string will enable a specific version of Flipper you've
|
|
137
|
-
* declared in your **package.json**. The default for this configuration is `false`.
|
|
138
|
-
*
|
|
139
|
-
* > You cannot use `flipper` at the same time as `useFrameworks`, and
|
|
140
|
-
* doing so will generate an error.
|
|
141
|
-
*/
|
|
142
|
-
flipper?: boolean | string;
|
|
143
185
|
/**
|
|
144
186
|
* Enable the Network Inspector.
|
|
145
187
|
*
|
|
@@ -174,12 +216,18 @@ export interface ExtraIosPodDependency {
|
|
|
174
216
|
/**
|
|
175
217
|
* Version of the pod.
|
|
176
218
|
* CocoaPods supports various [versioning options](https://guides.cocoapods.org/using/the-podfile.html#pod).
|
|
177
|
-
* @example
|
|
219
|
+
* @example
|
|
220
|
+
* ```
|
|
221
|
+
* ~> 0.1.2
|
|
222
|
+
* ```
|
|
178
223
|
*/
|
|
179
224
|
version?: string;
|
|
180
225
|
/**
|
|
181
226
|
* Build configurations for which the pod should be installed.
|
|
182
|
-
* @example
|
|
227
|
+
* @example
|
|
228
|
+
* ```
|
|
229
|
+
* ['Debug', 'Release']
|
|
230
|
+
* ```
|
|
183
231
|
*/
|
|
184
232
|
configurations?: string[];
|
|
185
233
|
/**
|
|
@@ -188,22 +236,32 @@ export interface ExtraIosPodDependency {
|
|
|
188
236
|
modular_headers?: boolean;
|
|
189
237
|
/**
|
|
190
238
|
* Custom source to search for this dependency.
|
|
191
|
-
* @example
|
|
239
|
+
* @example
|
|
240
|
+
* ```
|
|
241
|
+
* https://github.com/CocoaPods/Specs.git
|
|
242
|
+
* ```
|
|
192
243
|
*/
|
|
193
244
|
source?: string;
|
|
194
245
|
/**
|
|
195
246
|
* Custom local filesystem path to add the dependency.
|
|
196
|
-
* @example
|
|
247
|
+
* @example
|
|
248
|
+
* ```
|
|
249
|
+
* ~/Documents/AFNetworking
|
|
250
|
+
* ```
|
|
197
251
|
*/
|
|
198
252
|
path?: string;
|
|
199
253
|
/**
|
|
200
254
|
* Custom podspec path.
|
|
201
|
-
* @example
|
|
255
|
+
* @example
|
|
256
|
+
* ```https://example.com/JSONKit.podspec```
|
|
202
257
|
*/
|
|
203
258
|
podspec?: string;
|
|
204
259
|
/**
|
|
205
260
|
* Test specs can be optionally included via the :testspecs option. By default, none of a Pod's test specs are included.
|
|
206
|
-
* @example
|
|
261
|
+
* @example
|
|
262
|
+
* ```
|
|
263
|
+
* ['UnitTests', 'SomeOtherTests']
|
|
264
|
+
* ```
|
|
207
265
|
*/
|
|
208
266
|
testspecs?: string[];
|
|
209
267
|
/**
|
|
@@ -306,3 +364,4 @@ export interface PluginConfigTypeAndroidQueriesData {
|
|
|
306
364
|
* @ignore
|
|
307
365
|
*/
|
|
308
366
|
export declare function validateConfig(config: any): PluginConfigType;
|
|
367
|
+
export {};
|
package/build/pluginConfig.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateConfig =
|
|
6
|
+
exports.validateConfig = validateConfig;
|
|
7
7
|
const ajv_1 = __importDefault(require("ajv"));
|
|
8
8
|
const semver_1 = __importDefault(require("semver"));
|
|
9
9
|
/**
|
|
@@ -36,10 +36,6 @@ const schema = {
|
|
|
36
36
|
enableProguardInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
37
37
|
enableShrinkResourcesInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
38
38
|
extraProguardRules: { type: 'string', nullable: true },
|
|
39
|
-
flipper: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
nullable: true,
|
|
42
|
-
},
|
|
43
39
|
packagingOptions: {
|
|
44
40
|
type: 'object',
|
|
45
41
|
properties: {
|
|
@@ -51,8 +47,65 @@ const schema = {
|
|
|
51
47
|
nullable: true,
|
|
52
48
|
},
|
|
53
49
|
networkInspector: { type: 'boolean', nullable: true },
|
|
54
|
-
extraMavenRepos: {
|
|
50
|
+
extraMavenRepos: {
|
|
51
|
+
type: 'array',
|
|
52
|
+
items: {
|
|
53
|
+
type: ['string', 'object'],
|
|
54
|
+
anyOf: [
|
|
55
|
+
{ type: 'string', nullable: false },
|
|
56
|
+
{
|
|
57
|
+
type: 'object',
|
|
58
|
+
required: ['url'],
|
|
59
|
+
properties: {
|
|
60
|
+
url: { type: 'string', nullable: false },
|
|
61
|
+
credentials: {
|
|
62
|
+
type: 'object',
|
|
63
|
+
oneOf: [
|
|
64
|
+
{
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
username: { type: 'string' },
|
|
68
|
+
password: { type: 'string' },
|
|
69
|
+
},
|
|
70
|
+
required: ['username', 'password'],
|
|
71
|
+
additionalProperties: false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
name: { type: 'string' },
|
|
77
|
+
value: { type: 'string' },
|
|
78
|
+
},
|
|
79
|
+
required: ['name', 'value'],
|
|
80
|
+
additionalProperties: false,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: {
|
|
85
|
+
accessKey: { type: 'string' },
|
|
86
|
+
secretKey: { type: 'string' },
|
|
87
|
+
sessionToken: { type: 'string', nullable: true },
|
|
88
|
+
},
|
|
89
|
+
required: ['accessKey', 'secretKey'],
|
|
90
|
+
additionalProperties: false,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
nullable: true,
|
|
94
|
+
},
|
|
95
|
+
authentication: {
|
|
96
|
+
type: 'string',
|
|
97
|
+
enum: ['basic', 'digest', 'header'],
|
|
98
|
+
nullable: true,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
nullable: true,
|
|
106
|
+
},
|
|
55
107
|
usesCleartextTraffic: { type: 'boolean', nullable: true },
|
|
108
|
+
useLegacyPackaging: { type: 'boolean', nullable: true },
|
|
56
109
|
manifestQueries: {
|
|
57
110
|
required: ['package'],
|
|
58
111
|
type: 'object',
|
|
@@ -91,10 +144,6 @@ const schema = {
|
|
|
91
144
|
newArchEnabled: { type: 'boolean', nullable: true },
|
|
92
145
|
deploymentTarget: { type: 'string', pattern: '\\d+\\.\\d+', nullable: true },
|
|
93
146
|
useFrameworks: { type: 'string', enum: ['static', 'dynamic'], nullable: true },
|
|
94
|
-
flipper: {
|
|
95
|
-
type: ['boolean', 'string'],
|
|
96
|
-
nullable: true,
|
|
97
|
-
},
|
|
98
147
|
networkInspector: { type: 'boolean', nullable: true },
|
|
99
148
|
extraPods: {
|
|
100
149
|
type: 'array',
|
|
@@ -181,15 +230,9 @@ function validateConfig(config) {
|
|
|
181
230
|
throw new Error('Invalid expo-build-properties config: ' + JSON.stringify(validate.errors));
|
|
182
231
|
}
|
|
183
232
|
maybeThrowInvalidVersions(config);
|
|
184
|
-
// explicitly block using use_frameworks and Flipper in iOS
|
|
185
|
-
// https://github.com/facebook/flipper/issues/2414
|
|
186
|
-
if (Boolean(config.ios?.flipper) && config.ios?.useFrameworks !== undefined) {
|
|
187
|
-
throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
|
|
188
|
-
}
|
|
189
233
|
if (config.android?.enableShrinkResourcesInReleaseBuilds === true &&
|
|
190
234
|
config.android?.enableProguardInReleaseBuilds !== true) {
|
|
191
235
|
throw new Error('`android.enableShrinkResourcesInReleaseBuilds` requires `android.enableProguardInReleaseBuilds` to be enabled.');
|
|
192
236
|
}
|
|
193
237
|
return config;
|
|
194
238
|
}
|
|
195
|
-
exports.validateConfig = validateConfig;
|
|
@@ -22,7 +22,6 @@ const withBuildProperties = (config, props) => {
|
|
|
22
22
|
//
|
|
23
23
|
// plugins order matter: the later one would run first
|
|
24
24
|
config = (0, android_1.withAndroidPurgeProguardRulesOnce)(config);
|
|
25
|
-
config = (0, android_1.withAndroidFlipper)(config, pluginConfig);
|
|
26
25
|
config = (0, ios_1.withIosBuildProperties)(config, pluginConfig);
|
|
27
26
|
config = (0, ios_1.withIosDeploymentTarget)(config, pluginConfig);
|
|
28
27
|
return config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-build-properties",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Config plugin to customize native build properties on prebuild",
|
|
5
5
|
"main": "build/withBuildProperties.js",
|
|
6
6
|
"types": "build/withBuildProperties.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/build-properties",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ajv": "^8.11.0",
|
|
35
|
-
"semver": "^7.
|
|
35
|
+
"semver": "^7.6.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"expo-module-scripts": "^3.0.0"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"expo": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
|
|
44
44
|
}
|
package/src/android.ts
CHANGED
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
History,
|
|
5
5
|
withAndroidManifest,
|
|
6
6
|
withDangerousMod,
|
|
7
|
-
withGradleProperties,
|
|
8
7
|
} from 'expo/config-plugins';
|
|
9
8
|
import fs from 'fs';
|
|
10
9
|
import path from 'path';
|
|
@@ -69,45 +68,26 @@ export const withAndroidBuildProperties = createBuildGradlePropsConfigPlugin<Plu
|
|
|
69
68
|
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
70
69
|
propValueGetter: (config) => (config.android?.networkInspector ?? true).toString(),
|
|
71
70
|
},
|
|
71
|
+
{
|
|
72
|
+
propName: 'expo.useLegacyPackaging',
|
|
73
|
+
propValueGetter: (config) => (config.android?.useLegacyPackaging ?? false).toString(),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
propName: 'android.extraMavenRepos',
|
|
77
|
+
propValueGetter: (config) => {
|
|
78
|
+
const extraMavenRepos = (config.android?.extraMavenRepos ?? []).map((item) => {
|
|
79
|
+
if (typeof item === 'string') {
|
|
80
|
+
return { url: item };
|
|
81
|
+
}
|
|
82
|
+
return item;
|
|
83
|
+
});
|
|
84
|
+
return JSON.stringify(extraMavenRepos);
|
|
85
|
+
},
|
|
86
|
+
},
|
|
72
87
|
],
|
|
73
88
|
'withAndroidBuildProperties'
|
|
74
89
|
);
|
|
75
90
|
|
|
76
|
-
export const withAndroidFlipper: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
77
|
-
const ANDROID_FLIPPER_KEY = 'FLIPPER_VERSION';
|
|
78
|
-
const FLIPPER_FALLBACK = '0.125.0';
|
|
79
|
-
|
|
80
|
-
// when not set, make no changes
|
|
81
|
-
if (props.android?.flipper === undefined) {
|
|
82
|
-
return config;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return withGradleProperties(config, (c) => {
|
|
86
|
-
// check for Flipper version in package. If set, use that
|
|
87
|
-
let existing: string | undefined;
|
|
88
|
-
|
|
89
|
-
const found = c.modResults.find(
|
|
90
|
-
(item) => item.type === 'property' && item.key === ANDROID_FLIPPER_KEY
|
|
91
|
-
);
|
|
92
|
-
if (found && found.type === 'property') {
|
|
93
|
-
existing = found.value;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// strip key and re-add based on setting
|
|
97
|
-
c.modResults = c.modResults.filter(
|
|
98
|
-
(item) => !(item.type === 'property' && item.key === ANDROID_FLIPPER_KEY)
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
c.modResults.push({
|
|
102
|
-
type: 'property',
|
|
103
|
-
key: ANDROID_FLIPPER_KEY,
|
|
104
|
-
value: (props.android?.flipper ?? existing ?? FLIPPER_FALLBACK) as string,
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return c;
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
|
|
111
91
|
/**
|
|
112
92
|
* Appends `props.android.extraProguardRules` content into `android/app/proguard-rules.pro`
|
|
113
93
|
*/
|
package/src/ios.ts
CHANGED
|
@@ -14,19 +14,14 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin<Plugin
|
|
|
14
14
|
propName: 'ios.useFrameworks',
|
|
15
15
|
propValueGetter: (config) => config.ios?.useFrameworks,
|
|
16
16
|
},
|
|
17
|
-
{
|
|
18
|
-
propName: 'ios.flipper',
|
|
19
|
-
propValueGetter: (config) => {
|
|
20
|
-
if (typeof config.ios?.flipper === 'string' || typeof config.ios?.flipper === 'boolean') {
|
|
21
|
-
return config.ios.flipper.toString();
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
17
|
{
|
|
27
18
|
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
28
19
|
propValueGetter: (config) => (config.ios?.networkInspector ?? true).toString(),
|
|
29
20
|
},
|
|
21
|
+
{
|
|
22
|
+
propName: 'apple.extraPods',
|
|
23
|
+
propValueGetter: (config) => JSON.stringify(config.ios?.extraPods ?? []),
|
|
24
|
+
},
|
|
30
25
|
],
|
|
31
26
|
'withIosBuildProperties'
|
|
32
27
|
);
|
package/src/pluginConfig.ts
CHANGED
|
@@ -80,15 +80,6 @@ export interface PluginConfigTypeAndroid {
|
|
|
80
80
|
*/
|
|
81
81
|
packagingOptions?: PluginConfigTypeAndroidPackagingOptions;
|
|
82
82
|
|
|
83
|
-
/**
|
|
84
|
-
* By default, Flipper is enabled with the version that comes bundled with `react-native`.
|
|
85
|
-
*
|
|
86
|
-
* Use this to change the [Flipper](https://fbflipper.com/) version when
|
|
87
|
-
* running your app on Android. You can set the `flipper` property to a
|
|
88
|
-
* semver string and specify an alternate Flipper version.
|
|
89
|
-
*/
|
|
90
|
-
flipper?: string;
|
|
91
|
-
|
|
92
83
|
/**
|
|
93
84
|
* Enable the Network Inspector.
|
|
94
85
|
*
|
|
@@ -99,21 +90,45 @@ export interface PluginConfigTypeAndroid {
|
|
|
99
90
|
/**
|
|
100
91
|
* Add extra maven repositories to all gradle projects.
|
|
101
92
|
*
|
|
102
|
-
*
|
|
93
|
+
*
|
|
94
|
+
* Takes an array of objects or strings.
|
|
95
|
+
* Strings are passed as the `url` property of the object with no credentials or authentication scheme.
|
|
96
|
+
*
|
|
97
|
+
* This adds the following code to **android/build.gradle**:
|
|
98
|
+
* ```groovy
|
|
99
|
+
* allprojects {
|
|
100
|
+
* repositories {
|
|
101
|
+
* maven {
|
|
102
|
+
* url "https://foo.com/maven-releases"
|
|
103
|
+
* }
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* By using an `AndroidMavenRepository` object, you can specify credentials and an authentication scheme.
|
|
108
|
+
*
|
|
103
109
|
* ```groovy
|
|
104
110
|
* allprojects {
|
|
105
111
|
* repositories {
|
|
106
112
|
* maven {
|
|
107
|
-
* url
|
|
113
|
+
* url "https://foo.com/maven-releases"
|
|
114
|
+
* credentials {
|
|
115
|
+
* username = "bar"
|
|
116
|
+
* password = "baz"
|
|
117
|
+
* }
|
|
118
|
+
* authentication {
|
|
119
|
+
* basic(BasicAuthentication)
|
|
120
|
+
* }
|
|
108
121
|
* }
|
|
109
122
|
* }
|
|
110
123
|
* }
|
|
111
124
|
* ```
|
|
112
125
|
*
|
|
126
|
+
* @see [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven)
|
|
127
|
+
*
|
|
113
128
|
* @hide For the implementation details,
|
|
114
|
-
* this property is actually handled by `expo-modules-autolinking`
|
|
129
|
+
* this property is actually handled by `expo-modules-autolinking` not the config-plugins inside `expo-build-properties`
|
|
115
130
|
*/
|
|
116
|
-
extraMavenRepos?: string[];
|
|
131
|
+
extraMavenRepos?: (AndroidMavenRepository | string)[];
|
|
117
132
|
/**
|
|
118
133
|
* Indicates whether the app intends to use cleartext network traffic.
|
|
119
134
|
*
|
|
@@ -122,6 +137,14 @@ export interface PluginConfigTypeAndroid {
|
|
|
122
137
|
* @see [Android documentation](https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic)
|
|
123
138
|
*/
|
|
124
139
|
usesCleartextTraffic?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Instructs the Android Gradle plugin to compress native libraries in the APK using the legacy packaging system.
|
|
142
|
+
*
|
|
143
|
+
* @default false
|
|
144
|
+
*
|
|
145
|
+
* @see [Android documentation](https://developer.android.com/build/releases/past-releases/agp-4-2-0-release-notes#compress-native-libs-dsl)
|
|
146
|
+
*/
|
|
147
|
+
useLegacyPackaging?: boolean;
|
|
125
148
|
/**
|
|
126
149
|
* Specifies the set of other apps that an app intends to interact with. These other apps are specified by package name,
|
|
127
150
|
* by intent signature, or by provider authority.
|
|
@@ -131,6 +154,45 @@ export interface PluginConfigTypeAndroid {
|
|
|
131
154
|
manifestQueries?: PluginConfigTypeAndroidQueries;
|
|
132
155
|
}
|
|
133
156
|
|
|
157
|
+
export interface AndroidMavenRepository {
|
|
158
|
+
/**
|
|
159
|
+
* The URL of the Maven repository.
|
|
160
|
+
*/
|
|
161
|
+
url: string;
|
|
162
|
+
/**
|
|
163
|
+
* The credentials to use when accessing the Maven repository.
|
|
164
|
+
* May be of type PasswordCredentials, HttpHeaderCredentials, or AWSCredentials.
|
|
165
|
+
*
|
|
166
|
+
* @see the authentication schemes section of [Gradle documentation](https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:authentication_schemes) for more information.
|
|
167
|
+
*/
|
|
168
|
+
credentials?: AndroidMavenRepositoryCredentials;
|
|
169
|
+
/**
|
|
170
|
+
* The authentication scheme to use when accessing the Maven repository.
|
|
171
|
+
*/
|
|
172
|
+
authentication?: 'basic' | 'digest' | 'header';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface AndroidMavenRepositoryPasswordCredentials {
|
|
176
|
+
username: string;
|
|
177
|
+
password: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
interface AndroidMavenRepositoryHttpHeaderCredentials {
|
|
181
|
+
name: string;
|
|
182
|
+
value: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface AndroidMavenRepositoryAWSCredentials {
|
|
186
|
+
accessKey: string;
|
|
187
|
+
secretKey: string;
|
|
188
|
+
sessionToken?: string;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
type AndroidMavenRepositoryCredentials =
|
|
192
|
+
| AndroidMavenRepositoryPasswordCredentials
|
|
193
|
+
| AndroidMavenRepositoryHttpHeaderCredentials
|
|
194
|
+
| AndroidMavenRepositoryAWSCredentials;
|
|
195
|
+
|
|
134
196
|
/**
|
|
135
197
|
* Interface representing available configuration for iOS native build properties.
|
|
136
198
|
* @platform ios
|
|
@@ -150,23 +212,9 @@ export interface PluginConfigTypeIos {
|
|
|
150
212
|
/**
|
|
151
213
|
* Enable [`use_frameworks!`](https://guides.cocoapods.org/syntax/podfile.html#use_frameworks_bang)
|
|
152
214
|
* in `Podfile` to use frameworks instead of static libraries for Pods.
|
|
153
|
-
*
|
|
154
|
-
* > You cannot use `useFrameworks` and `flipper` at the same time, and
|
|
155
|
-
* doing so will generate an error.
|
|
156
215
|
*/
|
|
157
216
|
useFrameworks?: 'static' | 'dynamic';
|
|
158
217
|
|
|
159
|
-
/**
|
|
160
|
-
* Enable [Flipper](https://fbflipper.com/) when running your app on iOS in
|
|
161
|
-
* Debug mode. Setting `true` enables the default version of Flipper, while
|
|
162
|
-
* setting a semver string will enable a specific version of Flipper you've
|
|
163
|
-
* declared in your **package.json**. The default for this configuration is `false`.
|
|
164
|
-
*
|
|
165
|
-
* > You cannot use `flipper` at the same time as `useFrameworks`, and
|
|
166
|
-
* doing so will generate an error.
|
|
167
|
-
*/
|
|
168
|
-
flipper?: boolean | string;
|
|
169
|
-
|
|
170
218
|
/**
|
|
171
219
|
* Enable the Network Inspector.
|
|
172
220
|
*
|
|
@@ -203,12 +251,18 @@ export interface ExtraIosPodDependency {
|
|
|
203
251
|
/**
|
|
204
252
|
* Version of the pod.
|
|
205
253
|
* CocoaPods supports various [versioning options](https://guides.cocoapods.org/using/the-podfile.html#pod).
|
|
206
|
-
* @example
|
|
254
|
+
* @example
|
|
255
|
+
* ```
|
|
256
|
+
* ~> 0.1.2
|
|
257
|
+
* ```
|
|
207
258
|
*/
|
|
208
259
|
version?: string;
|
|
209
260
|
/**
|
|
210
261
|
* Build configurations for which the pod should be installed.
|
|
211
|
-
* @example
|
|
262
|
+
* @example
|
|
263
|
+
* ```
|
|
264
|
+
* ['Debug', 'Release']
|
|
265
|
+
* ```
|
|
212
266
|
*/
|
|
213
267
|
configurations?: string[];
|
|
214
268
|
/**
|
|
@@ -217,22 +271,32 @@ export interface ExtraIosPodDependency {
|
|
|
217
271
|
modular_headers?: boolean;
|
|
218
272
|
/**
|
|
219
273
|
* Custom source to search for this dependency.
|
|
220
|
-
* @example
|
|
274
|
+
* @example
|
|
275
|
+
* ```
|
|
276
|
+
* https://github.com/CocoaPods/Specs.git
|
|
277
|
+
* ```
|
|
221
278
|
*/
|
|
222
279
|
source?: string;
|
|
223
280
|
/**
|
|
224
281
|
* Custom local filesystem path to add the dependency.
|
|
225
|
-
* @example
|
|
282
|
+
* @example
|
|
283
|
+
* ```
|
|
284
|
+
* ~/Documents/AFNetworking
|
|
285
|
+
* ```
|
|
226
286
|
*/
|
|
227
287
|
path?: string;
|
|
228
288
|
/**
|
|
229
289
|
* Custom podspec path.
|
|
230
|
-
* @example
|
|
290
|
+
* @example
|
|
291
|
+
* ```https://example.com/JSONKit.podspec```
|
|
231
292
|
*/
|
|
232
293
|
podspec?: string;
|
|
233
294
|
/**
|
|
234
295
|
* Test specs can be optionally included via the :testspecs option. By default, none of a Pod's test specs are included.
|
|
235
|
-
* @example
|
|
296
|
+
* @example
|
|
297
|
+
* ```
|
|
298
|
+
* ['UnitTests', 'SomeOtherTests']
|
|
299
|
+
* ```
|
|
236
300
|
*/
|
|
237
301
|
testspecs?: string[];
|
|
238
302
|
/**
|
|
@@ -353,11 +417,6 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
353
417
|
enableShrinkResourcesInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
354
418
|
extraProguardRules: { type: 'string', nullable: true },
|
|
355
419
|
|
|
356
|
-
flipper: {
|
|
357
|
-
type: 'string',
|
|
358
|
-
nullable: true,
|
|
359
|
-
},
|
|
360
|
-
|
|
361
420
|
packagingOptions: {
|
|
362
421
|
type: 'object',
|
|
363
422
|
properties: {
|
|
@@ -371,10 +430,68 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
371
430
|
|
|
372
431
|
networkInspector: { type: 'boolean', nullable: true },
|
|
373
432
|
|
|
374
|
-
extraMavenRepos: {
|
|
433
|
+
extraMavenRepos: {
|
|
434
|
+
type: 'array',
|
|
435
|
+
items: {
|
|
436
|
+
type: ['string', 'object'],
|
|
437
|
+
anyOf: [
|
|
438
|
+
{ type: 'string', nullable: false },
|
|
439
|
+
{
|
|
440
|
+
type: 'object',
|
|
441
|
+
required: ['url'],
|
|
442
|
+
properties: {
|
|
443
|
+
url: { type: 'string', nullable: false },
|
|
444
|
+
credentials: {
|
|
445
|
+
type: 'object',
|
|
446
|
+
oneOf: [
|
|
447
|
+
{
|
|
448
|
+
type: 'object',
|
|
449
|
+
properties: {
|
|
450
|
+
username: { type: 'string' },
|
|
451
|
+
password: { type: 'string' },
|
|
452
|
+
},
|
|
453
|
+
required: ['username', 'password'],
|
|
454
|
+
additionalProperties: false,
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
type: 'object',
|
|
458
|
+
properties: {
|
|
459
|
+
name: { type: 'string' },
|
|
460
|
+
value: { type: 'string' },
|
|
461
|
+
},
|
|
462
|
+
required: ['name', 'value'],
|
|
463
|
+
additionalProperties: false,
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
type: 'object',
|
|
467
|
+
properties: {
|
|
468
|
+
accessKey: { type: 'string' },
|
|
469
|
+
secretKey: { type: 'string' },
|
|
470
|
+
sessionToken: { type: 'string', nullable: true },
|
|
471
|
+
},
|
|
472
|
+
required: ['accessKey', 'secretKey'],
|
|
473
|
+
additionalProperties: false,
|
|
474
|
+
},
|
|
475
|
+
],
|
|
476
|
+
nullable: true,
|
|
477
|
+
},
|
|
478
|
+
authentication: {
|
|
479
|
+
type: 'string',
|
|
480
|
+
enum: ['basic', 'digest', 'header'],
|
|
481
|
+
nullable: true,
|
|
482
|
+
},
|
|
483
|
+
},
|
|
484
|
+
additionalProperties: false,
|
|
485
|
+
},
|
|
486
|
+
],
|
|
487
|
+
},
|
|
488
|
+
nullable: true,
|
|
489
|
+
},
|
|
375
490
|
|
|
376
491
|
usesCleartextTraffic: { type: 'boolean', nullable: true },
|
|
377
492
|
|
|
493
|
+
useLegacyPackaging: { type: 'boolean', nullable: true },
|
|
494
|
+
|
|
378
495
|
manifestQueries: {
|
|
379
496
|
required: ['package'],
|
|
380
497
|
type: 'object',
|
|
@@ -414,11 +531,6 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
414
531
|
deploymentTarget: { type: 'string', pattern: '\\d+\\.\\d+', nullable: true },
|
|
415
532
|
useFrameworks: { type: 'string', enum: ['static', 'dynamic'], nullable: true },
|
|
416
533
|
|
|
417
|
-
flipper: {
|
|
418
|
-
type: ['boolean', 'string'],
|
|
419
|
-
nullable: true,
|
|
420
|
-
},
|
|
421
|
-
|
|
422
534
|
networkInspector: { type: 'boolean', nullable: true },
|
|
423
535
|
|
|
424
536
|
extraPods: {
|
|
@@ -515,12 +627,6 @@ export function validateConfig(config: any): PluginConfigType {
|
|
|
515
627
|
|
|
516
628
|
maybeThrowInvalidVersions(config);
|
|
517
629
|
|
|
518
|
-
// explicitly block using use_frameworks and Flipper in iOS
|
|
519
|
-
// https://github.com/facebook/flipper/issues/2414
|
|
520
|
-
if (Boolean(config.ios?.flipper) && config.ios?.useFrameworks !== undefined) {
|
|
521
|
-
throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
|
|
522
|
-
}
|
|
523
|
-
|
|
524
630
|
if (
|
|
525
631
|
config.android?.enableShrinkResourcesInReleaseBuilds === true &&
|
|
526
632
|
config.android?.enableProguardInReleaseBuilds !== true
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
withAndroidBuildProperties,
|
|
5
5
|
withAndroidProguardRules,
|
|
6
6
|
withAndroidPurgeProguardRulesOnce,
|
|
7
|
-
withAndroidFlipper,
|
|
8
7
|
withAndroidCleartextTraffic,
|
|
9
8
|
withAndroidQueries,
|
|
10
9
|
} from './android';
|
|
@@ -32,7 +31,6 @@ export const withBuildProperties: ConfigPlugin<PluginConfigType> = (config, prop
|
|
|
32
31
|
// plugins order matter: the later one would run first
|
|
33
32
|
config = withAndroidPurgeProguardRulesOnce(config);
|
|
34
33
|
|
|
35
|
-
config = withAndroidFlipper(config, pluginConfig);
|
|
36
34
|
config = withIosBuildProperties(config, pluginConfig);
|
|
37
35
|
config = withIosDeploymentTarget(config, pluginConfig);
|
|
38
36
|
|