Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Licenses #19

Merged
merged 8 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
18 changes: 18 additions & 0 deletions .github/workflows/analyze-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ env:
flutter_version: 3.13.6

jobs:
check-licenses:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true

- run: dart pub get

- name: Check licenses
run: dart run scripts/check_license.dart

analyze-format:
runs-on: ubuntu-22.04
steps:
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ See for example [`wallet_proxy/model.dart`](./lib/services/wallet_proxy/model.da
which expands into [`wallet_proxy/model.g.dart`](./lib/services/wallet_proxy/model.g.dart).

The generated class is checked into the repo, but imports always refer to the original one.

## Licenses

To see the allowed licenses, check out `scripts/license.yaml`.

To get a (readable) list of the licenses of dependencies run:
```
dart run license_checker check-licenses --config scripts/license.yaml
```
3 changes: 3 additions & 0 deletions assets/graphics/CCD.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions lib/screens/home/about_button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:package_info_plus/package_info_plus.dart';

/// Button that when pressed shows the about page for the app, including the license page.
class AboutButton extends StatelessWidget {
const AboutButton({super.key});

@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: () {
PackageInfo.fromPlatform().then((packageInfo) {
showAboutDialog(
context: context,
applicationName: packageInfo.appName,
applicationVersion: packageInfo.version,
applicationIcon: SvgPicture.asset(
'assets/graphics/CCD.svg',
semanticsLabel: 'CCD Logo',
),
);
});
},
child: const Text('Show About'),
);
}
}
3 changes: 3 additions & 0 deletions lib/screens/home/screen.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:concordium_wallet/screens/home/about_button.dart';
import 'package:concordium_wallet/screens/terms_and_conditions/screen.dart';
import 'package:concordium_wallet/services/url_launcher.dart';
import 'package:concordium_wallet/services/wallet_proxy/service.dart';
Expand Down Expand Up @@ -79,6 +80,8 @@ class _HomeScreenState extends State<HomeScreen> {
],
),
),
const AboutButton(),
const SizedBox(height: 8),
ElevatedButton(
onPressed: () => context.read<TermsAndConditionAcceptance>().testResetValidTime(),
child: const Text('Reset update time of valid T&C'),
Expand Down
112 changes: 112 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.11.0"
barbecue:
dependency: transitive
description:
name: barbecue
sha256: e3a0afaf9005e466887d6c87411a2ddd8d72fc46db3caabf278ee600f1e2f92c
url: "https://pub.dev"
source: hosted
version: "0.4.0"
bloc:
dependency: transitive
description:
Expand Down Expand Up @@ -137,6 +145,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
cli_util:
dependency: transitive
description:
name: cli_util
sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7
url: "https://pub.dev"
source: hosted
version: "0.4.0"
clock:
dependency: transitive
description:
Expand All @@ -161,6 +177,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.17.2"
colorize:
dependency: transitive
description:
name: colorize
sha256: "584746cd6ba1cba0633b6720f494fe6f9601c4170f0666c1579d2aa2a61071ba"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
convert:
dependency: transitive
description:
Expand All @@ -185,6 +209,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
csslib:
dependency: transitive
description:
name: csslib
sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
cupertino_icons:
dependency: "direct main"
description:
Expand Down Expand Up @@ -304,6 +336,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.3.1"
html:
dependency: transitive
description:
name: html
sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a"
url: "https://pub.dev"
source: hosted
version: "0.15.4"
http:
dependency: "direct main"
description:
Expand Down Expand Up @@ -360,6 +400,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "6.7.1"
license_checker:
dependency: "direct dev"
description:
name: license_checker
sha256: eea27638e42bc98fd91a6a8187eb57e5617e2c3c8b313a5d51b14bec7a8685e1
url: "https://pub.dev"
source: hosted
version: "1.6.0"
lints:
dependency: transitive
description:
Expand All @@ -376,6 +424,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
markdown:
dependency: transitive
description:
name: markdown
sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd
url: "https://pub.dev"
source: hosted
version: "7.1.1"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -440,6 +496,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017"
url: "https://pub.dev"
source: hosted
version: "4.2.0"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
pana:
dependency: transitive
description:
name: pana
sha256: "6f4372d5d2af5fe3fc6491c18f575601743bceb8433c7f179a6fffd162ee55f1"
url: "https://pub.dev"
source: hosted
version: "0.21.39"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -536,6 +616,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.3"
retry:
dependency: transitive
description:
name: retry
sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc"
url: "https://pub.dev"
source: hosted
version: "3.1.2"
safe_url_check:
dependency: transitive
description:
name: safe_url_check
sha256: b85685b48d74dcd9659e1f2228f900b9fb37cd3b4ba085ca4f593d06c00c36a6
url: "https://pub.dev"
source: hosted
version: "1.1.1"
shared_preferences:
dependency: "direct main"
description:
Expand Down Expand Up @@ -701,6 +797,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.0"
string_validator:
dependency: transitive
description:
name: string_validator
sha256: "50dd8ecf91db6a732f4a851eeae81ee12406eedc62d0da72f2d91a04a2d10dd8"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
tar:
dependency: transitive
description:
name: tar
sha256: "451629b6ed9dd18be43688f4b42de34dd0ddd9e0a7da76a42b9e0b4ac7e9c68d"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
term_glyph:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies:
shared_preferences: ^2.2.1
http: ^1.1.0
flutter_bloc: ^8.1.3
package_info_plus: ^4.2.0

dev_dependencies:
flutter_test:
Expand All @@ -56,6 +57,7 @@ dev_dependencies:
json_serializable: ^6.7.1
mocktail: ^1.0.1
bloc_test: ^9.1.5
license_checker: ^1.6.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
Expand Down Expand Up @@ -100,3 +102,4 @@ flutter:
# see https://flutter.dev/custom-fonts/#from-packages
assets:
- assets/graphics/

35 changes: 35 additions & 0 deletions scripts/check_license.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// ignore_for_file: avoid_print
import 'dart:io';
import 'package:license_checker/src/config.dart';
import 'package:license_checker/src/check_license.dart';
import 'package:license_checker/src/dependency_checker.dart';
import 'package:license_checker/src/package_checker.dart';

void main() async {
// Load the config file
Config config = Config.fromFile(File('./scripts/license.yaml'));

// Get the package configuration from the current directory
PackageChecker packageConfig = await PackageChecker.fromCurrentDirectory(config: config);

// Run the license check on all packages
List<LicenseDisplayWithPriority<String>> lic = await checkAllPackageLicenses<String>(
packageConfig: packageConfig,
showDirectDepsOnly: false,
filterApproved: true,
licenseDisplay: ({
required String licenseName,
required String packageName,
required LicenseStatus licenseStatus,
}) =>
'$packageName - $licenseName',
);

if (lic.isNotEmpty) {
print('Unapproved licenses used, see below:');
for (final x in lic) {
print(x.display);
}
throw "Stopping due to unapproved licenses used!";
}
}
21 changes: 21 additions & 0 deletions scripts/license.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
permittedLicenses:
- MIT
- BSD-3-Clause
- Apache-2.0
- MIT-Modern-Variant
- Zlib

rejectedLicenses:
shjortConcordium marked this conversation as resolved.
Show resolved Hide resolved
- GPL
- GPL-1
- GPL-2
- GPL-3

packageLicenseOverride:
flutter_test: BSD-3-Clause
flutter_web_plugins: BSD-3-Clause

omitDisclaimer:
- flutter_test
- flutter_web_plugins