expo-build-properties 0.5.1 → 0.6.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 +12 -0
- package/build/android.js +8 -0
- package/build/ios.js +4 -0
- package/build/pluginConfig.d.ts +15 -0
- package/build/pluginConfig.js +7 -0
- package/package.json +2 -2
- package/src/android.ts +8 -0
- package/src/ios.ts +4 -0
- package/src/pluginConfig.ts +31 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.6.0 — 2023-04-14
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Added experimental `unstable_networkInspector` properties. ([#22129](https://github.com/expo/expo/pull/22129) by [@kudo](https://github.com/kudo))
|
|
18
|
+
|
|
19
|
+
## 0.5.2 — 2023-04-03
|
|
20
|
+
|
|
21
|
+
### 🎉 New features
|
|
22
|
+
|
|
23
|
+
- Added `enableShrinkResourcesInReleaseBuilds` property to enable Android `shrinkResources` build feature. ([#21911](https://github.com/expo/expo/pull/21911) by [@kudo](https://github.com/kudo))
|
|
24
|
+
|
|
13
25
|
## 0.5.1 — 2023-02-09
|
|
14
26
|
|
|
15
27
|
### 🎉 New features
|
package/build/android.js
CHANGED
|
@@ -54,6 +54,14 @@ exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([
|
|
|
54
54
|
propName: 'android.enableProguardInReleaseBuilds',
|
|
55
55
|
propValueGetter: (config) => config.android?.enableProguardInReleaseBuilds?.toString(),
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
propName: 'android.enableShrinkResourcesInReleaseBuilds',
|
|
59
|
+
propValueGetter: (config) => config.android?.enableShrinkResourcesInReleaseBuilds?.toString(),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
63
|
+
propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(),
|
|
64
|
+
},
|
|
57
65
|
], 'withAndroidBuildProperties');
|
|
58
66
|
const withAndroidFlipper = (config, props) => {
|
|
59
67
|
const ANDROID_FLIPPER_KEY = 'FLIPPER_VERSION';
|
package/build/ios.js
CHANGED
|
@@ -21,6 +21,10 @@ exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([
|
|
|
21
21
|
return undefined;
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
26
|
+
propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(),
|
|
27
|
+
},
|
|
24
28
|
], 'withIosBuildProperties');
|
|
25
29
|
const withIosDeploymentTarget = (config, props) => {
|
|
26
30
|
const deploymentTarget = props.ios?.deploymentTarget;
|
package/build/pluginConfig.d.ts
CHANGED
|
@@ -46,6 +46,11 @@ export interface PluginConfigTypeAndroid {
|
|
|
46
46
|
* Enable [Proguard or R8](https://developer.android.com/studio/build/shrink-code) in release builds to obfuscate Java code and reduce app size.
|
|
47
47
|
*/
|
|
48
48
|
enableProguardInReleaseBuilds?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Enable [`shrinkResources`](https://developer.android.com/studio/build/shrink-code#shrink-resources) in release builds to remove unused resources from the app.
|
|
51
|
+
* This property should be used in combination with `enableProguardInReleaseBuilds`.
|
|
52
|
+
*/
|
|
53
|
+
enableShrinkResourcesInReleaseBuilds?: boolean;
|
|
49
54
|
/**
|
|
50
55
|
* Append custom [Proguard rules](https://www.guardsquare.com/manual/configuration/usage) to **android/app/proguard-rules.pro**.
|
|
51
56
|
*/
|
|
@@ -61,6 +66,11 @@ export interface PluginConfigTypeAndroid {
|
|
|
61
66
|
* alternate Flipper version.
|
|
62
67
|
*/
|
|
63
68
|
flipper?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
|
|
71
|
+
* SDK 49+ is required.
|
|
72
|
+
*/
|
|
73
|
+
unstable_networkInspector?: boolean;
|
|
64
74
|
}
|
|
65
75
|
/**
|
|
66
76
|
* Interface representing available configuration for iOS native build properties.
|
|
@@ -94,6 +104,11 @@ export interface PluginConfigTypeIos {
|
|
|
94
104
|
* doing so will generate an error.
|
|
95
105
|
*/
|
|
96
106
|
flipper?: boolean | string;
|
|
107
|
+
/**
|
|
108
|
+
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
|
|
109
|
+
* SDK 49+ is required.
|
|
110
|
+
*/
|
|
111
|
+
unstable_networkInspector?: boolean;
|
|
97
112
|
}
|
|
98
113
|
/**
|
|
99
114
|
* 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).
|
package/build/pluginConfig.js
CHANGED
|
@@ -34,6 +34,7 @@ const schema = {
|
|
|
34
34
|
buildToolsVersion: { type: 'string', nullable: true },
|
|
35
35
|
kotlinVersion: { type: 'string', nullable: true },
|
|
36
36
|
enableProguardInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
37
|
+
enableShrinkResourcesInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
37
38
|
extraProguardRules: { type: 'string', nullable: true },
|
|
38
39
|
flipper: {
|
|
39
40
|
type: 'string',
|
|
@@ -49,6 +50,7 @@ const schema = {
|
|
|
49
50
|
},
|
|
50
51
|
nullable: true,
|
|
51
52
|
},
|
|
53
|
+
unstable_networkInspector: { type: 'boolean', nullable: true },
|
|
52
54
|
},
|
|
53
55
|
nullable: true,
|
|
54
56
|
},
|
|
@@ -62,6 +64,7 @@ const schema = {
|
|
|
62
64
|
type: ['boolean', 'string'],
|
|
63
65
|
nullable: true,
|
|
64
66
|
},
|
|
67
|
+
unstable_networkInspector: { type: 'boolean', nullable: true },
|
|
65
68
|
},
|
|
66
69
|
nullable: true,
|
|
67
70
|
},
|
|
@@ -130,6 +133,10 @@ function validateConfig(config) {
|
|
|
130
133
|
if (config?.ios?.flipper !== undefined && config?.ios?.useFrameworks !== undefined) {
|
|
131
134
|
throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
|
|
132
135
|
}
|
|
136
|
+
if (config.android?.enableShrinkResourcesInReleaseBuilds === true &&
|
|
137
|
+
config.android?.enableProguardInReleaseBuilds !== true) {
|
|
138
|
+
throw new Error('`android.enableShrinkResourcesInReleaseBuilds` requires `android.enableProguardInReleaseBuilds` to be enabled.');
|
|
139
|
+
}
|
|
133
140
|
return config;
|
|
134
141
|
}
|
|
135
142
|
exports.validateConfig = validateConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-build-properties",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"expo": "*"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "6b73082d014ebe93f091aa75cd06f4d4d90eff19"
|
|
44
44
|
}
|
package/src/android.ts
CHANGED
|
@@ -59,6 +59,14 @@ export const withAndroidBuildProperties = createBuildGradlePropsConfigPlugin<Plu
|
|
|
59
59
|
propName: 'android.enableProguardInReleaseBuilds',
|
|
60
60
|
propValueGetter: (config) => config.android?.enableProguardInReleaseBuilds?.toString(),
|
|
61
61
|
},
|
|
62
|
+
{
|
|
63
|
+
propName: 'android.enableShrinkResourcesInReleaseBuilds',
|
|
64
|
+
propValueGetter: (config) => config.android?.enableShrinkResourcesInReleaseBuilds?.toString(),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
68
|
+
propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(),
|
|
69
|
+
},
|
|
62
70
|
],
|
|
63
71
|
'withAndroidBuildProperties'
|
|
64
72
|
);
|
package/src/ios.ts
CHANGED
|
@@ -23,6 +23,10 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin<Plugin
|
|
|
23
23
|
return undefined;
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
+
{
|
|
27
|
+
propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
|
|
28
|
+
propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(),
|
|
29
|
+
},
|
|
26
30
|
],
|
|
27
31
|
'withIosBuildProperties'
|
|
28
32
|
);
|
package/src/pluginConfig.ts
CHANGED
|
@@ -66,6 +66,11 @@ export interface PluginConfigTypeAndroid {
|
|
|
66
66
|
* Enable [Proguard or R8](https://developer.android.com/studio/build/shrink-code) in release builds to obfuscate Java code and reduce app size.
|
|
67
67
|
*/
|
|
68
68
|
enableProguardInReleaseBuilds?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Enable [`shrinkResources`](https://developer.android.com/studio/build/shrink-code#shrink-resources) in release builds to remove unused resources from the app.
|
|
71
|
+
* This property should be used in combination with `enableProguardInReleaseBuilds`.
|
|
72
|
+
*/
|
|
73
|
+
enableShrinkResourcesInReleaseBuilds?: boolean;
|
|
69
74
|
/**
|
|
70
75
|
* Append custom [Proguard rules](https://www.guardsquare.com/manual/configuration/usage) to **android/app/proguard-rules.pro**.
|
|
71
76
|
*/
|
|
@@ -82,6 +87,12 @@ export interface PluginConfigTypeAndroid {
|
|
|
82
87
|
* alternate Flipper version.
|
|
83
88
|
*/
|
|
84
89
|
flipper?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
|
|
93
|
+
* SDK 49+ is required.
|
|
94
|
+
*/
|
|
95
|
+
unstable_networkInspector?: boolean;
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
/**
|
|
@@ -118,6 +129,12 @@ export interface PluginConfigTypeIos {
|
|
|
118
129
|
* doing so will generate an error.
|
|
119
130
|
*/
|
|
120
131
|
flipper?: boolean | string;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
|
|
135
|
+
* SDK 49+ is required.
|
|
136
|
+
*/
|
|
137
|
+
unstable_networkInspector?: boolean;
|
|
121
138
|
}
|
|
122
139
|
|
|
123
140
|
/**
|
|
@@ -157,6 +174,7 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
157
174
|
kotlinVersion: { type: 'string', nullable: true },
|
|
158
175
|
|
|
159
176
|
enableProguardInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
177
|
+
enableShrinkResourcesInReleaseBuilds: { type: 'boolean', nullable: true },
|
|
160
178
|
extraProguardRules: { type: 'string', nullable: true },
|
|
161
179
|
|
|
162
180
|
flipper: {
|
|
@@ -174,6 +192,8 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
174
192
|
},
|
|
175
193
|
nullable: true,
|
|
176
194
|
},
|
|
195
|
+
|
|
196
|
+
unstable_networkInspector: { type: 'boolean', nullable: true },
|
|
177
197
|
},
|
|
178
198
|
nullable: true,
|
|
179
199
|
},
|
|
@@ -188,6 +208,8 @@ const schema: JSONSchemaType<PluginConfigType> = {
|
|
|
188
208
|
type: ['boolean', 'string'],
|
|
189
209
|
nullable: true,
|
|
190
210
|
},
|
|
211
|
+
|
|
212
|
+
unstable_networkInspector: { type: 'boolean', nullable: true },
|
|
191
213
|
},
|
|
192
214
|
nullable: true,
|
|
193
215
|
},
|
|
@@ -266,5 +288,14 @@ export function validateConfig(config: any): PluginConfigType {
|
|
|
266
288
|
throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
|
|
267
289
|
}
|
|
268
290
|
|
|
291
|
+
if (
|
|
292
|
+
config.android?.enableShrinkResourcesInReleaseBuilds === true &&
|
|
293
|
+
config.android?.enableProguardInReleaseBuilds !== true
|
|
294
|
+
) {
|
|
295
|
+
throw new Error(
|
|
296
|
+
'`android.enableShrinkResourcesInReleaseBuilds` requires `android.enableProguardInReleaseBuilds` to be enabled.'
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
|
|
269
300
|
return config;
|
|
270
301
|
}
|