Skip to content

Commit 536213d

Browse files
authored
Merge pull request #379 from Countly/license-lite
License addition
2 parents 94d1824 + c6d87a8 commit 536213d

39 files changed

Lines changed: 136 additions & 64 deletions
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Flutter Tests and Coverage
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- staging-lite
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
package-tests:
13+
name: Package tests (root)
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Flutter
21+
uses: subosito/flutter-action@v2
22+
with:
23+
channel: stable
24+
25+
- name: Get dependencies
26+
run: flutter pub get
27+
28+
- name: Run tests with coverage
29+
shell: bash
30+
run: |
31+
set -o pipefail
32+
flutter test --coverage -r expanded | tee package-test-output.txt
33+
34+
- name: Print coverage summary
35+
shell: bash
36+
run: |
37+
if [ ! -f coverage/lcov.info ]; then
38+
echo "No coverage/lcov.info found"
39+
exit 1
40+
fi
41+
42+
awk -F: '
43+
/^LF:/ { lf += $2 }
44+
/^LH:/ { lh += $2 }
45+
END {
46+
pct = (lf > 0) ? (lh / lf) * 100 : 0
47+
printf "Root package coverage: %.2f%% (%d/%d)\n", pct, lh, lf
48+
}
49+
' coverage/lcov.info | tee package-coverage-summary.txt
50+
51+
{
52+
echo "## Root package test coverage"
53+
echo
54+
cat package-coverage-summary.txt
55+
} >> "$GITHUB_STEP_SUMMARY"
56+
57+
- name: Upload root coverage artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: root-lcov
61+
path: coverage/lcov.info

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2026 Countly
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Track, measure, and take action - all without leaving Countly.
1313

1414
## Integrating Countly SDK in your projects
1515

16-
For a detailed description on how to use this SDK [check out our documentation](https://support.count.ly/hc/en-us/articles/).
16+
For a detailed description on how to use this SDK [check out our documentation](https://support.countly.com/hc/en-us/articles/360037944212-Flutter#h_01KV0E0M1GZPYV77YH6Z0M9QXH).
1717

18-
For an example integration of this SDK, see the [Flutter example app in this repository](https://github.com/Countly/countly-sdk-dart/tree/main/example/flutter_example).
18+
For an example integration of this SDK, see the [Flutter example app in this repository](https://github.com/Countly/countly-sdk-flutter-bridge/tree/master-lite/example/flutter_example).
1919

2020
This SDK supports the following features:
2121

@@ -39,7 +39,7 @@ dependencies:
3939
### Initialization
4040
4141
```dart
42-
import 'package:countly_flutter_lite/countly.dart';
42+
import 'package:countly_flutter_lite/countly_flutter_lite.dart';
4343
import 'package:flutter/widgets.dart';
4444

4545
void main() async {

analysis_options.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
include: package:flutter_lints/flutter.yaml
2+
3+
analyzer:
4+
exclude:
5+
- test/**
6+
- integration_test/**
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
include: package:flutter_lints/flutter.yaml
2+
3+
analyzer:
4+
exclude:
5+
- test/**
6+
- integration_test/**

example/flutter_example/integration_test/metrics_test/metric_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import 'dart:convert';
21
import 'dart:io';
32

4-
import 'package:countly_flutter_lite/countly.dart';
3+
import 'package:countly_flutter_lite/countly_flutter_lite.dart';
54
import 'package:flutter_test/flutter_test.dart';
65
import 'package:integration_test/integration_test.dart';
76
import 'package:countly_sdk_dart_core/src/networking.dart';

example/flutter_example/integration_test/migration/migration_no_old_data_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import 'package:countly_flutter_lite/countly.dart' as C;
1+
import 'package:countly_flutter_lite/countly_flutter_lite.dart' as C;
22
import 'package:countly_sdk_dart_core/src/networking.dart' as N;
33
import 'package:flutter_test/flutter_test.dart';
44
import 'package:http/http.dart' as http;

example/flutter_example/integration_test/migration/migration_non_default_instance_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'package:countly_flutter_np/countly_config.dart';
22
import 'package:countly_flutter_np/countly_flutter.dart';
3-
import 'package:countly_flutter_lite/countly.dart' as C;
3+
import 'package:countly_flutter_lite/countly_flutter_lite.dart' as C;
44
import 'package:countly_sdk_dart_core/src/networking.dart' as N;
55
import 'package:flutter_test/flutter_test.dart';
66
import 'package:http/http.dart' as http;

example/flutter_example/integration_test/migration/migration_only_events_test.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'dart:convert';
22

33
import 'package:countly_flutter_np/countly_config.dart';
44
import 'package:countly_flutter_np/countly_flutter.dart';
5-
import 'package:countly_flutter_lite/countly.dart' as C;
5+
import 'package:countly_flutter_lite/countly_flutter_lite.dart' as C;
66
import 'package:countly_sdk_dart_core/src/networking.dart' as N;
77
import 'package:flutter_test/flutter_test.dart';
88
import 'package:http/http.dart' as http;
@@ -40,10 +40,7 @@ void main() {
4040
});
4141

4242
testWidgets('Migration with only old event data (no old requests)', (WidgetTester tester) async {
43-
final oldConfig = CountlyConfig('https://old.com', 'old-app-only-events')
44-
.setLoggingEnabled(true)
45-
.enableManualSessionHandling()
46-
.setDeviceId('old-only-events-device');
43+
final oldConfig = CountlyConfig('https://old.com', 'old-app-only-events').setLoggingEnabled(true).enableManualSessionHandling().setDeviceId('old-only-events-device');
4744
await Countly.initWithConfig(oldConfig);
4845

4946
Countly.recordEvent({'key': 'old_event_only', 'count': 1});

example/flutter_example/integration_test/migration/migration_second_init_test.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import 'dart:convert';
2-
import 'dart:io' show Platform;
32

43
import 'package:countly_flutter_np/countly_config.dart';
54
import 'package:countly_flutter_np/countly_flutter.dart';
6-
import 'package:countly_flutter_lite/countly.dart' as C;
5+
import 'package:countly_flutter_lite/countly_flutter_lite.dart' as C;
76
import 'package:countly_sdk_dart_core/src/networking.dart' as N;
87
import 'package:flutter_test/flutter_test.dart';
98
import 'package:http/http.dart' as http;
@@ -45,8 +44,7 @@ void main() {
4544

4645
testWidgets('Migration does not re-populate legacy values on next core init', (WidgetTester tester) async {
4746
const markerEventKey = 'Old reinit marker event';
48-
final oldConfig =
49-
CountlyConfig('https://old.com', 'old-app-reinit').setLoggingEnabled(true).setDeviceId('old-device-reinit');
47+
final oldConfig = CountlyConfig('https://old.com', 'old-app-reinit').setLoggingEnabled(true).setDeviceId('old-device-reinit');
5048
await Countly.initWithConfig(oldConfig);
5149

5250
Countly.instance.userProfile.setProperty('specialReinitProperty', 'value');

0 commit comments

Comments
 (0)