-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtarget.js
More file actions
47 lines (40 loc) · 1.12 KB
/
target.js
File metadata and controls
47 lines (40 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// metaSpace4GB.js
const { withGradleProperties } = require('@expo/config-plugins')
function setGradlePropertiesValue(config, key, value) {
return withGradleProperties(config, (exportedConfig) => {
const keyIdx = exportedConfig.modResults.findIndex(
(item) => item.type === 'property' && item.key === key,
)
if (keyIdx >= 0) {
exportedConfig.modResults.splice(keyIdx, 1, {
type: 'property',
key,
value,
})
} else {
exportedConfig.modResults.push({
type: 'property',
key,
value,
})
}
return exportedConfig
})
}
module.exports = function withCustomPlugin(config) {
// Configuration de la mémoire Gradle
config = setGradlePropertiesValue(
config,
'org.gradle.jvmargs',
'-Xmx4096m -XX:MaxMetaspaceSize=1024m',
)
// Autres optimisations Gradle utiles
config = setGradlePropertiesValue(config, 'org.gradle.parallel', 'true')
config = setGradlePropertiesValue(
config,
'org.gradle.configureondemand',
'true',
)
config = setGradlePropertiesValue(config, 'org.gradle.daemon', 'true')
return config
}