From 2b9a33c165b44b958666b9998f90e8da0ae2f41b Mon Sep 17 00:00:00 2001 From: Rexogamer Date: Sat, 17 Aug 2024 01:25:26 +0100 Subject: [PATCH] chore: remove FOSS builds if they ever become necessary - or if we want to set up flavours again - this might be handy as a reverse guide --- .github/workflows/build-android.yml | 61 +++---------------- README.md | 23 +++---- android/app/build.gradle | 18 +----- package.json | 6 +- react-native.config.js | 2 - .../settings/sections/app/AppInfoSection.tsx | 4 -- 6 files changed, 22 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 94ef029..32f2690 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -26,60 +26,19 @@ jobs: - name: Bundle the JS run: yarn react-native bundle --platform android --entry-file ./index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res - name: Build the app - run: yarn react-native build-android --tasks assembleRegularDebug + run: yarn react-native build-android --tasks assembleDebug - name: Rename debug APKs run: | - mv app-regular-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-arm64-v8a.apk - mv app-regular-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk - mv app-regular-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-x86_64.apk - mv app-regular-x86-debug.apk RVMob-Debug-${{ github.sha }}-x86.apk - working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/ + mv app-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-arm64-v8a.apk + mv app-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk + mv app-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-x86_64.apk + mv app-x86-debug.apk RVMob-Debug-${{ github.sha }}-x86.apk + working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/ - name: Upload debug APK uses: actions/upload-artifact@v4 with: - name: regular-artifact path: | - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-arm64-v8a.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-x86_64.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-x86.apk - - build-android-debug-foss: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Enable Corepack - run: corepack enable - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'yarn' - - name: Set up Java - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'microsoft' - - name: Install dependencies and prepare assets - run: yarn install && npx react-native-asset - - name: Bundle the JS - run: yarn react-native bundle --platform android --entry-file ./index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res - - name: Build the app - run: yarn react-native build-android --tasks assembleFossDebug - - name: Rename debug APKs - run: | - mv app-foss-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-arm64-v8a.apk - mv app-foss-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-armeabi-v7a.apk - mv app-foss-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-x86_64.apk - mv app-foss-x86-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-x86.apk - working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/ - - name: Upload debug APK - uses: actions/upload-artifact@v4 - with: - name: foss-artifact - path: | - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-arm64-v8a.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-armeabi-v7a.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-x86_64.apk - /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-x86.apk + /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-arm64-v8a.apk + /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk + /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-x86_64.apk + /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-x86.apk diff --git a/README.md b/README.md index 34ee183..13212fb 100644 --- a/README.md +++ b/README.md @@ -61,25 +61,20 @@ npx react-native-asset # for web: yarn web -# for android: -yarn android # regular version -# OR -yarn android-foss # FOSS flavour -# then start Metro: +# for android, run the following then press `a`: yarn start ``` CLI commands: -| Command | Description | -| ------------------- | ----------------------------------------- | -| `yarn start` | Starts Metro (the dev server). | -| `yarn test` | Tests to see if everything is working. | -| `yarn web` | Runs the web app. | -| `yarn android` | Runs the Android app. | -| `yarn android-foss` | Runs the Android app's FOSS flavour. | -| `yarn ios` | Runs the iOS app (broken/requires a Mac). | -| `yarn lint` | Checks the code syntax using ESLint. | +| Command | Description | +| -------------- | ----------------------------------------- | +| `yarn start` | Starts Metro (the dev server). | +| `yarn test` | Tests to see if everything is working. | +| `yarn web` | Runs the web app. | +| `yarn android` | Runs the Android app. | +| `yarn ios` | Runs the iOS app (broken/requires a Mac). | +| `yarn lint` | Checks the code syntax using ESLint. | For more information, see a list of `react-native`'s commands [here](https://github.com/react-native-community/cli/blob/master/docs/commands.md). You can access them by running `yarn react-native`. diff --git a/android/app/build.gradle b/android/app/build.gradle index ad53d41..67cd843 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -20,7 +20,7 @@ react { // The list of variants to that are debuggable. For those we're going to // skip the bundling of the JS bundle and the assets. By default is just 'debug'. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants. - debuggableVariants = ["regularDebug", "fossDebug"] + // debuggableVariants = ["liteDebug", "prodDebug"] /* Bundling */ // A list containing the node command and its flags. Default is just 'node'. // nodeExecutableAndArgs = ["node"] @@ -127,22 +127,6 @@ android { proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } - - flavorDimensions "featureSet" - productFlavors { - // regular build with non-free dependencies - regular { - versionNameSuffix "-regular" - buildConfigField "boolean", "IS_FOSS", "false" - } - - // build without non-free dependencies (no notifications) - foss { - applicationIdSuffix ".foss" - versionNameSuffix "-foss" - buildConfigField "boolean", "IS_FOSS", "true" - } - } } dependencies { diff --git a/package.json b/package.json index d5c6b33..f6a0523 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,8 @@ "private": true, "scripts": { "clean": "react-native clean", - "android": "react-native run-android --active-arch-only --appIdSuffix=debug --mode=regularDebug", - "android-foss": "FOSS=true react-native run-android --active-arch-only --appIdSuffix=foss.debug --mode=fossDebug", - "android-release": "react-native build-android --tasks assembleRegularRelease", - "android-release-foss": "FOSS=true react-native build-android --tasks assembleFossRelease", + "android": "react-native run-android --active-arch-only --appIdSuffix=debug --mode=debug", + "android-release": "react-native build-android --tasks assembleRelease", "ios": "react-native run-ios", "start": "react-native start", "test": "jest", diff --git a/react-native.config.js b/react-native.config.js index 1d1767f..ef09f5b 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -1,5 +1,3 @@ -const isFoss = process.env.FOSS; - module.exports = { project: { ios: {}, diff --git a/src/components/common/settings/sections/app/AppInfoSection.tsx b/src/components/common/settings/sections/app/AppInfoSection.tsx index 2e1bf5c..19fc3db 100644 --- a/src/components/common/settings/sections/app/AppInfoSection.tsx +++ b/src/components/common/settings/sections/app/AppInfoSection.tsx @@ -14,7 +14,6 @@ import ReleaseIcon from '../../../../../../assets/images/icon_release.svg'; import DebugIcon from '../../../../../../assets/images/icon_debug.svg'; const AppIcon = getBundleId().match('debug') ? DebugIcon : ReleaseIcon; -const isFoss = getBundleId().match('foss'); export const AppInfoSection = () => { return ( @@ -29,9 +28,6 @@ export const AppInfoSection = () => { RVMob v{app.version} - {isFoss ? ( - FOSS build - ) : null}