10000 Format Android source code with `google-java-format` (#23) · evdokimovs/flutter-webrtc@df4682e · GitHub
[go: up one dir, main page]

Skip to content

Commit df4682e

Browse files
evdokimovsalexlapatyranron
authored
Format Android source code with google-java-format (flutter-webrtc#23)
Additionally: - rework CI pipeline - enable dependabot for GitHub Actions Co-authored-by: alexlapa <lapa.alex@ex.ua> Co-authored-by: Kai Ren <tyranron@gmail.com>
1 parent eda3388 commit df4682e

25 files changed

+2647
-2520
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/build.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
env:
14+
FLUTTER_VERSION: 2.2.3
15+
FLUTTER_CHANNEL: stable
16+
17+
jobs:
18+
19+
##########################
20+
# Linting and formatting #
21+
##########################
22+
23+
dartanalyze:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: subosito/flutter-action@v1
28+
with:
29+
flutter-version: ${{ env.FLUTTER_VERSION }}
30+
channel: ${{ env.FLUTTER_CHANNEL }}
31+
32+
- run: flutter pub get
33+
34+
- run: flutter analyze
35+
36+
dartfmt:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
- uses: subosito/flutter-action@v1
41+
with:
42+
flutter-version: ${{ env.FLUTTER_VERSION }}
43+
channel: ${{ env.FLUTTER_CHANNEL }}
44+
45+
- run: flutter format lib/ test/ --set-exit-if-changed
46+
47+
- run: flutter pub get
48+
49+
- run: flutter pub run import_sorter:main --no-comments --exit-if-changed
50+
51+
google-java-format:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
56+
- uses: axel-op/googlejavaformat-action@v3
57+
with:
58+
args: --set-exit-if-changed
59+
files: android/src/main/java/com/cloudwebrtc/webrtc/**/*.java
60+
version: 1.13.0
61+
62+
63+
64+
65+
###########
66+
# Testing #
67+
###########
68+
69+
test:
70+
name: Flutter unit tests
71+
runs-on: ubuntu-latest
72+
steps:
73+
- uses: actions/checkout@v2
74+
- uses: actions/setup-java@v1
75+
with:
76+
java-version: "12.x"
77+
- uses: subosito/flutter-action@v1
78+
with:
79+
flutter-version: ${{ env.FLUTTER_VERSION }}
80+
channel: ${{ env.FLUTTER_CHANNEL }}
81+
82+
- run: flutter test

.github/workflows/publish.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,52 @@
11
package com.cloudwebrtc.webrtc;
22

33
import android.util.Log;
4-
54
import org.webrtc.CameraVideoCapturer;
65

76
class CameraEventsHandler implements CameraVideoCapturer.CameraEventsHandler {
8-
private static final String TAG = FlutterWebRTCPlugin.TAG;
9-
10-
/*
11-
Camera error handler - invoked when camera can not be opened
12-
or any camera exception happens on camera thread.
13-
*/
14-
@Override
15-
public void onCameraError(String errorDescription) {
16-
Log.d(TAG, String.format("CameraEventsHandler.onCameraError: errorDescription=%s", errorDescription));
17-
}
18-
19-
/* Called when camera is disconnected. */
20-
@Override
21-
public void onCameraDisconnected() {
22-
Log.d(TAG, "CameraEventsHandler.onCameraDisconnected");
23-
}
24-
25-
/* Invoked when camera stops receiving frames */
26-
@Override
27-
public void onCameraFreezed(String errorDescription) {
28-
Log.d(TAG, String.format("CameraEventsHandler.onCameraFreezed: errorDescription=%s", errorDescription));
29-
}
30-
31-
/* Callback invoked when camera is opening. */
32-
@Override
33-
public void onCameraOpening(String cameraName) {
34-
Log.d(TAG, String.format("CameraEventsHandler.onCameraOpening: cameraName=%s", cameraName));
35-
}
36-
37-
/* Callback invoked when first camera frame is available after camera is opened. */
38-
@Override
39-
public void onFirstFrameAvailable() {
40-
Log.d(TAG, "CameraEventsHandler.onFirstFrameAvailable");
41-
}
42-
43-
/* Callback invoked when camera closed. */
44-
@Override
45-
public void onCameraClosed() {
46-
Log.d(TAG, "CameraEventsHandler.onCameraClosed");
47-
}
7+
private static final String TAG = FlutterWebRTCPlugin.TAG;
8+
9+
/*
10+
Camera error handler - invoked when camera can not be opened
11+
or any camera exception happens on camera thread.
12+
*/
13+
@Override
14+
public void onCameraError(String errorDescription) {
15+
Log.d(
16+
TAG,
17+
String.format("CameraEventsHandler.onCameraError: errorDescription=%s", errorDescription));
18+
}
19+
20+
/* Called when camera is disconnected. */
21+
@Override
22+
public void onCameraDisconnected() {
23+
Log.d(TAG, "CameraEventsHandler.onCameraDisconnected");
24+
}
25+
26+
/* Invoked when camera stops receiving frames */
27+
@Override
28+
public void onCameraFreezed(String errorDescription) {
29+
Log.d(
30+
TAG,
31+
String.format(
32+
"CameraEventsHandler.onCameraFreezed: errorDescription=%s", errorDescription));
33+
}
34+
35+
/* Callback invoked when camera is opening. */
36+
@Override
37+
public void onCameraOpening(String cameraName) {
38+
Log.d(TAG, String.format("CameraEventsHandler.onCameraOpening: cameraName=%s", cameraName));
39+
}
40+
41+
/* Callback invoked when first camera frame is available after camera is opened. */
42+
@Override
43+
public void onFirstFrameAvailable() {
44+
Log.d(TAG, "CameraEventsHandler.onFirstFrameAvailable");
45+
}
46+
47+
/* Callback invoked when camera closed. */
48+
@Override
49+
public void onCameraClosed() {
50+
Log.d(TAG, "CameraEventsHandler.onCameraClosed");
51+
}
4852
}

0 commit comments

Comments
 (0)
0