diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 000000000..fe2658d14 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,31 @@ +{ + "semi": false, + "arrowParens": "avoid", + "bracketSameLine": true, + "bracketSpacing": false, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 80, + "sortPackageJson": false, + "ignorePatterns": [ + "*", + "!**/*.js", + "!**/*.jsx", + "!**/*.ts", + "!**/*.tsx", + "!**/*.mjs", + "!**/*.cjs", + "!*/", + "!**/*.css", + "!**/pnpm-workspace.yaml", + ".expo", + "android", + "ios", + "src/locale/locales", + "src/lexicons", + "lib/react-compiler-runtime", + "bskyweb/static", + "coverage", + "web-build" + ] +} diff --git a/app.config.js b/app.config.js index b298b3645..671de37e6 100644 --- a/app.config.js +++ b/app.config.js @@ -355,6 +355,7 @@ module.exports = function (_config) { ], './plugins/starterPackAppClipExtension/withStarterPackAppClip.js', './plugins/withGradleJVMHeapSizeIncrease.js', + './plugins/withGradleWrapperPin.js', './plugins/withAndroidManifestLargeHeapPlugin.js', './plugins/withAndroidManifestFCMIconPlugin.js', './plugins/withAndroidManifestIntentQueriesPlugin.js', diff --git a/plugins/withGradleWrapperPin.js b/plugins/withGradleWrapperPin.js new file mode 100644 index 000000000..b67238287 --- /dev/null +++ b/plugins/withGradleWrapperPin.js @@ -0,0 +1,39 @@ +// oxlint-disable import/no-nodejs-modules +const {withDangerousMod} = require('@expo/config-plugins') + +/** + * react-native-material-you calls jcenter(), which Gradle 9 removed. + * Pin Gradle 8 instead. + * + * @param {import('@expo/config-types').ExpoConfig} config + * @returns {import('@expo/config-types').ExpoConfig} + */ +module.exports = function withGradleWrapperVersion(config) { + return withDangerousMod(config, [ + 'android', + /** + * @param {import('@expo/config-plugins').ExportedConfigWithProps} modConfig + * @returns {Promise} + */ + async modConfig => { + const fs = require('node:fs/promises') + const path = require('node:path') + const wrapperProperties = path.join( + modConfig.modRequest.projectRoot, + 'android', + 'gradle', + 'wrapper', + 'gradle-wrapper.properties', + ) + const contents = await fs.readFile(wrapperProperties, 'utf8') + await fs.writeFile( + wrapperProperties, + contents.replace( + /gradle-[0-9][0-9.]*-bin\.zip/, + 'gradle-8.14.4-bin.zip', + ), + ) + return modConfig + }, + ]) +}