Skip to content

Commit

Permalink
Merge upstream into bookmark-games
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 committed Dec 23, 2024
2 parents f1e26e9 + 2a8263e commit 40ef91a
Show file tree
Hide file tree
Showing 760 changed files with 128,051 additions and 38,644 deletions.
4 changes: 0 additions & 4 deletions .fvm/fvm_config.json

This file was deleted.

4 changes: 4 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"flutter": "beta",
"flavors": {}
}
1 change: 1 addition & 0 deletions .github/workflows/deploy_play_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
options:
- internal
- alpha
- production

# Declare default permissions as read only.
permissions: read-all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/draft_github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- name: Draft release with release notes
id: create_release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974
with:
tag_name: ${{ github.event.inputs.version }}
draft: true
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ doc/api/
*.ipr
*.iws
.idea/
.fvm/flutter_sdk

# FVM Version Cache
.fvm/

# VS Code
.vscode/
21 changes: 17 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

## I want to contribute code to Lichess Mobile

- [Set up your development environment](https://docs.flutter.dev/get-started/install);
- [Set up your development environment](https://github.com/lichess-org/mobile/blob/main/docs/setting_dev_env.md);
- Communicate with other devs on [Discord](https://discord.gg/lichess).
- You may want to install a local instance of lila, [see lila wiki for that](https://github.com/lichess-org/lila/wiki/Lichess-Development-Onboarding);
- read the [coding style guide](https://github.com/lichess-org/mobile/blob/main/docs/coding_style.md)
- don't edit manually the `app_en.arb` file! See [about internationalization](https://github.com/lichess-org/mobile/blob/main/docs/internationalisation.md) in the docs.
- check the [docs](https://github.com/lichess-org/mobile/tree/main/docs) for more documentation

### What to work on
Expand All @@ -33,6 +30,22 @@ like, but check the existing pull requests to avoid duplicated work. Once you
start working on an issue, submit a pull request as soon as possible (in draft
mode if it's not ready yet) to let others know that you're working on it.

## Before submitting a Pull Request

- Make sure your code follows the [coding style guide](https://github.com/lichess-org/mobile/blob/main/docs/coding_style.md)
- Don't manually edit the `app_en.arb` file! See the [internalizations docs](https://github.com/lichess-org/mobile/blob/main/docs/internationalisation.md) for instructions on how to add new translations.
- If possible, write a new widget test for your bugfix or new feature.
- Consider adding a screenshot and/or screen recording to the PR description.
- Run the linter and tests:
```sh
flutter analyze
flutter test
```
- Ensure your code is formatted correctly (or use your editor's "format on save" feature):
```sh
dart format --output=none --set-exit-if-changed $(find lib/src -name "*.dart" -not \( -name "*.*freezed.dart" -o -name "*.*g.dart" -o -name "*lichess_icons.dart" \) )
dart format --output=none --set-exit-if-changed $(find test -name "*.dart" -not \( -name "*.*freezed.dart" -o -name "*.*g.dart" \) )
```

## I want to report a bug or a problem about Lichess Mobile

Expand Down
85 changes: 2 additions & 83 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,90 +8,9 @@ Contributions to this project are welcome!

If you want to contribute, please read the [contributing guide](./CONTRIBUTING.md).

## Setup
## Setup and Run

1. Follow the [Flutter guide](https://docs.flutter.dev/get-started/install) to
install Flutter and the platform of you choice (iOS and/or Android). **Note, if you're on Linux**, you should install flutter manually because there is an [issue](https://github.com/lichess-org/mobile/issues/123) with snapd when building Stockfish. Note that this project is not meant to be run on web platform.
2. Switch to the beta channel by running `flutter channel beta` and `flutter
upgrade`
3. Ensure Flutter is correctly configured by running `flutter doctor`

### Flutter version

While the app is in beta we'll use the `beta` channel of Flutter.

#### Flutter Version Management

If you want to use FVM to manage your Flutter versions effectively, please consult the [FVM (Flutter Version Management) guide](https://fvm.app/documentation/getting-started/installation) for comprehensive instructions on installing Flutter on your specific operating system.

**Pro Tip:** Remember to prepend the 'flutter' prefix when using FVM commands, like this: `fvm flutter [command]`.

### Local lila

You will need a local [lila](https://github.com/lichess-org/lila) (lichess server scala app) instance to work on this
project. You will also need to setup [lila-ws](https://github.com/lichess-org/lila-ws) (websocket server).

Instructions to install both are found in [the lila wiki](https://github.com/lichess-org/lila/wiki).

The mobile application is configured by default to target `http://127.0.0.1:9663` and `ws://127.0.0.1:9664`, so keep these when installing lila.

### Using Lichess dev server

To use the [Lichess dev](https://lichess.dev/) to run this app, run the following command to set up the Lichess host URLs in the app.

```
flutter run --dart-define=LICHESS_HOST=lichess.dev --dart-define=LICHESS_WS_HOST=socket.lichess.dev
```

**Note : Do not use any scheme (https:// or ws://) in url in host, since it's already handled by URI helper methods**


## Run

We don't commit generated code to the repository. So you need to run the code
generator first:

```sh
flutter pub get
dart run build_runner watch
```

Check you have some connected device with: `flutter devices`.
If you target an android emulator you need to run these commands so the device can reach the local lila instance.

**Note: Only run the command if you are using a local Lila server; otherwise, there's no need to set up port forwarding.**

```sh
adb reverse tcp:9663 tcp:9663
adb reverse tcp:9664 tcp:9664
```

Then run on your device:

```sh
flutter run -d <my_device>
```

You can find more information about emulators [in the documentation](https://github.com/lichess-org/mobile/blob/main/docs/setting_dev_env.md).

You can find more information about the `flutter run` command by running `flutter run --help`.

### Test

Before submitting a pull request, please run the tests:

```sh
flutter analyze
flutter test
```

### Logging

```sh
dart devtools
```

Then run the app with the `flutter run` command above, and a link to the logging page will be printed in the console.
See [the dev environment docs](./docs/setting_dev_env.md) for detailed instructions.

## Internationalisation

Expand Down
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ analyzer:
plugins:
- custom_lint

formatter:
page_width: 100

linter:
rules:
require_trailing_commas: false
prefer_single_quotes: true
always_use_package_imports: false
avoid_redundant_argument_values: false
Expand Down
67 changes: 35 additions & 32 deletions android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ GEM
base64
nkf
rexml
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.934.0)
aws-sdk-core (3.196.1)
aws-partitions (1.1013.0)
aws-sdk-core (3.213.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.82.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.151.0)
aws-sdk-core (~> 3, >= 3.194.0)
aws-sdk-kms (1.96.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.173.0)
aws-sdk-core (~> 3, >= 3.210.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (1.8.0)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.10.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.2.0)
Expand All @@ -38,8 +38,8 @@ GEM
domain_name (0.6.20240107)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.110.0)
faraday (1.10.3)
excon (0.112.0)
faraday (1.10.4)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -60,15 +60,15 @@ GEM
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday_middleware (1.2.1)
faraday (~> 1.0)
fastimage (2.3.1)
fastlane (2.221.1)
fastlane (2.225.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -84,6 +84,7 @@ GEM
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
fastlane-sirp (>= 1.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
Expand All @@ -109,6 +110,8 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-sirp (1.0.0)
sysrandom (~> 1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.54.0)
google-apis-core (>= 0.11.0, < 2.a)
Expand All @@ -126,7 +129,7 @@ GEM
google-apis-core (>= 0.11.0, < 2.a)
google-apis-storage_v1 (0.31.0)
google-apis-core (>= 0.11.0, < 2.a)
google-cloud-core (1.7.0)
google-cloud-core (1.7.1)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0)
Expand All @@ -147,32 +150,31 @@ GEM
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.0.5)
http-cookie (1.0.7)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.6.2)
json (2.7.2)
jwt (2.8.1)
json (2.8.2)
jwt (2.9.3)
base64
mini_magick (4.12.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.15.0)
multipart-post (2.4.1)
nanaimo (0.3.0)
nanaimo (0.4.0)
naturally (2.2.1)
nkf (0.2.0)
optparse (0.5.0)
optparse (0.6.0)
os (1.1.4)
plist (3.7.1)
public_suffix (5.0.5)
public_suffix (6.0.1)
rake (13.2.1)
representable (3.2.0)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.3.3)
strscan
rexml (3.3.9)
rouge (2.0.7)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
Expand All @@ -185,7 +187,7 @@ GEM
simctl (1.6.10)
CFPropertyList
naturally
strscan (3.1.0)
sysrandom (1.0.5)
terminal-notifier (2.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand All @@ -195,14 +197,15 @@ GEM
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
word_wrap (1.0.0)
xcodeproj (1.19.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1)
Expand Down
3 changes: 3 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ android {
ndkVersion flutter.ndkVersion

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Expand All @@ -49,6 +50,7 @@ android {
}

defaultConfig {
multiDexEnabled true
applicationId "org.lichess.mobileV2"
minSdkVersion 26
targetSdkVersion flutter.targetSdkVersion
Expand Down Expand Up @@ -96,4 +98,5 @@ flutter {
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
}
Loading

0 comments on commit 40ef91a

Please sign in to comment.