Browse Source

test(nextcloud): test validity of the generated clients

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/1014/head
Nikolas Rimikis 1 year ago
parent
commit
15ed36ee50
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 13
      packages/nextcloud/generate.sh
  2. 1
      packages/nextcloud/pubspec.yaml
  3. 13
      packages/nextcloud/test/ensure_validity_test.dart
  4. 9
      tool/generate-nextcloud.sh

13
packages/nextcloud/generate.sh

@ -0,0 +1,13 @@
#!/bin/bash
set -euxo pipefail
(
fvm dart run nextcloud:generate_props
fvm dart pub run build_runner build --delete-conflicting-outputs
fvm dart run nextcloud:generate_exports
# For some reason we need to fix and format twice, otherwise not everything gets fixed
fvm dart fix --apply lib/src/api/
melos run format
fvm dart fix --apply lib/src/api/
melos run format
)

1
packages/nextcloud/pubspec.yaml

@ -25,6 +25,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.4.6
build_verify: ^3.1.0
built_value_generator: ^8.6.3
coverage: ^1.7.1
dynamite:

13
packages/nextcloud/test/ensure_validity_test.dart

@ -0,0 +1,13 @@
import 'package:build_verify/build_verify.dart';
import 'package:test/test.dart';
void main() {
test(
'ensure_build',
() async => expectBuildClean(
packageRelativeDirectory: 'packages/nextcloud',
customCommand: ['bash', 'generate.sh'],
),
tags: 'source_verification',
);
}

9
tool/generate-nextcloud.sh

@ -5,12 +5,5 @@ cd "$(dirname "$0")/.."
(
cd packages/nextcloud
rm -rf .dart_tool/build/generated/dynamite
fvm dart run nextcloud:generate_props
fvm dart pub run build_runner build --delete-conflicting-outputs
fvm dart run nextcloud:generate_exports
# For some reason we need to fix and format twice, otherwise not everything gets fixed
fvm dart fix --apply lib/src/api/
melos run format
fvm dart fix --apply lib/src/api/
melos run format
bash generate.sh
)

Loading…
Cancel
Save