Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Simpler project structure #3555

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 5 additions & 26 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ updates:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
include: "scope"

- package-ecosystem: "bundler"
directory: "packages/smooth_app/ios"
Expand All @@ -31,53 +31,32 @@ updates:
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "pub"
directory: "/packages/smooth_app/"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "bundler"
directory: "packages/app/android"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"


- package-ecosystem: "bundler"
directory: "packages/app/ios"
schedule:
interval: "daily"
labels:
- "dependencies"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "pub"
directory: "/packages/app/"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
include: "scope"
- package-ecosystem: "pub"
directory: "/packages/scanner/mlkit/"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "pub"
directory: "/packages/scanner/shared/"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
include: "scope"

- package-ecosystem: "pub"
directory: "/packages/scanner/zxing/"
schedule:
Expand Down
13 changes: 6 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ android:
- packages/smooth_app/android/**/*

macos:
- packages/app/macos/**/*
- packages/smooth_app/macos/**/*

assets cache:
- packages/smooth_app/assets/cache/

documentation:
- README.md
- packages/app/README.md
- packages/app/android/fastlane/README.md
- packages/smooth_app/android/fastlane/README.md
- packages/smooth_app/README.md
- packages/smooth_app/lib/l10n/README.md

Expand All @@ -33,7 +32,7 @@ web:

tests:
- packages/smooth_app/test/**/*
- packages/app/test/widget_test.dart
- packages/smooth_app/test/widget_test.dart
- packages/smooth_app/test/basic_test.dart
- packages/scanner/shared/test/shared_test.dart
- packages/smooth_app/test/cache/cache_test.dart
Expand Down Expand Up @@ -92,13 +91,13 @@ mlkit:
- packages/smooth_app/lib/pages/scan/ml_kit_scan_page.dart

Amazon Appstore:
- packages/app/lib/entrypoints/android/main_amazon_appstore.dart,
- packages/smooth_app/lib/entrypoints/android/main_amazon_appstore.dart,

fdroid:
- packages/app/lib/entrypoints/android/main_fdroid.dart,
- packages/smooth_app/lib/entrypoints/android/main_fdroid.dart,

Huawei AppGallery:
- packages/app/lib/entrypoints/android/main_huawei_appgallery.dart,
- packages/smooth_app/lib/entrypoints/android/main_huawei_appgallery.dart,

zxing:
- packages/scanner/zxing/**/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
BUILD_TYPE:
required: true
type: string
# The name of the entrypoints in packages/app/lib/entrypoints/android/
# The name of the entrypoints in packages/smooth_app/lib/entrypoints/android/
# Example for entrypoints/android/main_google_play.dart
# Use <main_google_play> here
FLAVOR:
Expand Down Expand Up @@ -79,10 +79,10 @@ jobs:

- name: bundle install
run: bundle install
working-directory: ./packages/app/android/
working-directory: ./packages/smooth_app/android/

- name: Decrypt API JSON file
run: cd ./packages/app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
run: cd ./packages/smooth_app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
env:
API_JSON_FILE_DECRYPTKEY: ${{ secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{ secrets.DECRYPT_GPG_KEYSTORE }}
Expand Down Expand Up @@ -115,13 +115,13 @@ jobs:
uses: maierj/fastlane-action@v3.0.0
with:
lane: setVersion
subdirectory: ./packages/app/android/
subdirectory: ./packages/smooth_app/android/
env:
VERSION_NAME: ${{ inputs.VERSION_NAME }}
VERSION_CODE: ${{ inputs.VERSION_CODE }}

- name: Build app
run: echo $SIGN_STORE_PATH && pwd && cd ./packages/app/ && pwd && flutter build ${{ inputs.BUILD_TYPE }} --release -t lib/entrypoints/android/${{ inputs.FLAVOR }}.dart
run: echo $SIGN_STORE_PATH && pwd && cd ./packages/smooth_app/ && pwd && flutter build ${{ inputs.BUILD_TYPE }} --release -t lib/entrypoints/android/${{ inputs.FLAVOR }}.dart
env:
SIGN_STORE_PATH: ./../fastlane/envfiles/keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
Expand All @@ -133,7 +133,7 @@ jobs:
if: inputs.RELEASE_TYPE == 'GITHUB' && inputs.BUILD_TYPE == 'apk' && inputs.TAG_NAME != ''
continue-on-error: true
with:
file: ./packages/app/build/app/outputs/flutter-apk/app-release.apk
file: ./packages/smooth_app/build/app/outputs/flutter-apk/app-release.apk
asset_name: openfoodfacts-${{ inputs.FLAVOR }}-${{ inputs.TAG_NAME }}.apk
tag: ${{ inputs.TAG_NAME }}
overwrite: true
Expand All @@ -143,7 +143,7 @@ jobs:
if: inputs.RELEASE_TYPE == 'PLAY' && inputs.BUILD_TYPE == 'appbundle'
with:
lane: release
subdirectory: ./packages/app/android/
subdirectory: ./packages/smooth_app/android/
env:
SIGN_STORE_PATH: ./../fastlane/envfiles/keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ jobs:
with:
bundler-cache: true
ruby-version: ${{ env.RUBY_VERSION }}
#working-directory: packages/app/android
#working-directory: packages/smooth_app/android
- name: bundle install
run: bundle install
working-directory: ./packages/app/android/
working-directory: ./packages/smooth_app/android/
# Get the latest version name from file
- name: Set VERSION_NAME env
run: echo "VERSION_NAME=$(cat version.txt)">> $GITHUB_ENV
#run: echo "VERSION_NAME=1.9.0" >> $GITHUB_ENV

- name: Decrypt Android API JSON file
run: cd ./packages/app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
run: cd ./packages/smooth_app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
env:
API_JSON_FILE_DECRYPTKEY: ${{ secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{ secrets.DECRYPT_GPG_KEYSTORE }}
Expand All @@ -48,7 +48,7 @@ jobs:
uses: maierj/fastlane-action@v3.0.0
with:
lane: getOldVersionCode
subdirectory: packages/app/android
subdirectory: packages/smooth_app/android

- name: Version
run: echo "${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ios-release-to-org-openfoodfacts-scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ jobs:
ruby-version: ${{ env.RUBY_VERSION }}
- name: bundle install
run: bundle install
working-directory: ./packages/app/ios/
working-directory: ./packages/smooth_app/ios/
- name: bundle install
run: bundle install
working-directory: ./packages/app/android/
working-directory: ./packages/smooth_app/android/
- name: Setup Java JDK
uses: actions/setup-java@v3.9.0
with:
Expand Down Expand Up @@ -87,10 +87,10 @@ jobs:
run: ci/pub_upgrade.sh

- name: Bundle install
run: cd ./packages/app/ios && gem install bundler:1.17.3 && bundle install
run: cd ./packages/smooth_app/ios && gem install bundler:1.17.3 && bundle install

- name: Decrypt iOS AuthKey file
run: cd ./packages/app/ios/fastlane/envfiles && ./decrypt_secrets.sh
run: cd ./packages/smooth_app/ios/fastlane/envfiles && ./decrypt_secrets.sh
env:
AUTH_KEY_FILE_DECRYPTKEY: ${{ secrets.AUTH_KEY_FILE_DECRYPTKEY }}

Expand All @@ -100,7 +100,7 @@ jobs:
uses: maierj/fastlane-action@v3.0.0
with:
lane: setVersion
subdirectory: ./packages/app/android/
subdirectory: ./packages/smooth_app/android/
env:
VERSION_NAME: ${{ inputs.VERSION_NAME }}
VERSION_CODE: ${{ inputs.VERSION_CODE }}
Expand All @@ -123,10 +123,10 @@ jobs:
CI_RELEASE: true

- name: cat Podfile
run: cd ./packages/app/ios && cat Podfile
run: cd ./packages/smooth_app/ios && cat Podfile

- name: Release ipa
run: cd ./packages/app/ios && bundle exec fastlane beta
run: cd ./packages/smooth_app/ios && bundle exec fastlane beta
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: release-apk
path: packages/app/build/app/outputs/flutter-apk/app-debug.apk
path: packages/smooth_app/build/app/outputs/flutter-apk/app-debug.apk
6 changes: 3 additions & 3 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
#run: echo "VERSION_NAME=1.9.0" >> $GITHUB_ENV

- name: Decrypt Android API JSON file
run: cd ./packages/app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
run: cd ./packages/smooth_app/android/fastlane/envfiles && chmod +x ./decrypt_secrets.sh && ./decrypt_secrets.sh
env:
API_JSON_FILE_DECRYPTKEY: ${{ secrets.API_JSON_FILE_DECRYPTKEY }}
DECRYPT_GPG_KEYSTORE: ${{ secrets.DECRYPT_GPG_KEYSTORE }}
Expand All @@ -59,7 +59,7 @@ jobs:
ruby-version: ${{ env.RUBY_VERSION }}
- name: bundle install
run: bundle install
working-directory: ./packages/app/android/
working-directory: ./packages/smooth_app/android/

# We are using the android version code for iOS as well to have the version codes in sync
# in order for Sentry and other tools to work properly
Expand All @@ -68,7 +68,7 @@ jobs:
uses: maierj/fastlane-action@v3.0.0
with:
lane: getOldVersionCode
subdirectory: packages/app/android
subdirectory: packages/smooth_app/android

- name: Version
run: echo "${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ android_keys.zip
/packages/smooth_app/ios/fastlane/envfiles/AuthKey_KDAUTTM76R.p8
/packages/smooth_app/ios/fastlane/.env

# Flutter version manager
.fvm/


# Unsupported locals
app_ach.arb
Expand Down
7 changes: 2 additions & 5 deletions .run/Android (Amazon App Store).run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android (Amazon App Store)" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="Android">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/android/main_amazon_appstore.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_zxing dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable uri_store dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/android/main_amazon_appstore.dart" />
<method v="2" />
</configuration>
</component>
7 changes: 2 additions & 5 deletions .run/Android (Fdroid).dart.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android (Fdroid).dart" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="Android">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/android/main_fdroid.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_zxing dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable uri_store dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/android/main_fdroid.dart" />
<method v="2" />
</configuration>
</component>
7 changes: 2 additions & 5 deletions .run/Android (Google Play).dart.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android (Google Play).dart" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="Android">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/android/main_google_play.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_mlkit dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable google_play dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/android/main_google_play.dart" />
<method v="2" />
</configuration>
</component>
7 changes: 2 additions & 5 deletions .run/Android (Huawei Appgallery).run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android (Huawei Appgallery)" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="Android">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/android/main_huawei_appgallery.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_zxing dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable uri_store dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/android/main_huawei_appgallery.dart" />
<method v="2" />
</configuration>
</component>
7 changes: 2 additions & 5 deletions .run/Android (Samsung Gallery).dart.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Android (Samsung Gallery).dart" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="Android">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/android/main_samsung_gallery.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_mlkit dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable uri_store dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/android/main_samsung_gallery.dart" />
<method v="2" />
</configuration>
</component>
7 changes: 2 additions & 5 deletions .run/iOS app.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iOS app" type="FlutterRunConfigurationType" factoryName="Flutter" folderName="iOS">
<option name="filePath" value="$PROJECT_DIR$/packages/app/lib/entrypoints/ios/main_ios.dart" />
<method v="2">
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable scanner_mlkit dependency" run_configuration_type="ShConfigurationType" />
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Enable app_store dependency" run_configuration_type="ShConfigurationType" />
</method>
<option name="filePath" value="$PROJECT_DIR$/packages/smooth_app/lib/entrypoints/ios/main_ios.dart" />
<method v="2" />
</configuration>
</component>
Loading