David PHAM-VAN

Improve the Makefile

@@ -37,3 +37,4 @@ pdf/lcov.info @@ -37,3 +37,4 @@ pdf/lcov.info
37 pdf/coverage.json 37 pdf/coverage.json
38 .coverage 38 .coverage
39 package-lock.json 39 package-lock.json
  40 +printing/lcov.info
@@ -53,15 +53,19 @@ format-swift: $(SWFT_SRC) @@ -53,15 +53,19 @@ format-swift: $(SWFT_SRC)
53 node_modules: 53 node_modules:
54 npm install lcov-summary 54 npm install lcov-summary
55 55
56 -test: $(FONTS) .coverage node_modules 56 +test-pdf: $(FONTS) .coverage
57 cd pdf; pub get 57 cd pdf; pub get
58 cd pdf; pub global run coverage:collect_coverage --port=$(COV_PORT) -o coverage.json --resume-isolates --wait-paused &\ 58 cd pdf; pub global run coverage:collect_coverage --port=$(COV_PORT) -o coverage.json --resume-isolates --wait-paused &\
59 dart --enable-asserts --disable-service-auth-codes --enable-vm-service=$(COV_PORT) --pause-isolates-on-exit test/all_tests.dart 59 dart --enable-asserts --disable-service-auth-codes --enable-vm-service=$(COV_PORT) --pause-isolates-on-exit test/all_tests.dart
60 cd pdf; pub global run coverage:format_coverage --packages=.packages -i coverage.json --report-on lib --lcov --out lcov.info 60 cd pdf; pub global run coverage:format_coverage --packages=.packages -i coverage.json --report-on lib --lcov --out lcov.info
61 cd pdf; for EXAMPLE in $(shell cd pdf; find example -name '*.dart'); do dart $$EXAMPLE; done 61 cd pdf; for EXAMPLE in $(shell cd pdf; find example -name '*.dart'); do dart $$EXAMPLE; done
62 - cd printing/example; flutter packages get  
63 - cd printing/example; flutter test  
64 - node_modules/.bin/lcov-summary pdf/lcov.info 62 +
  63 +test-printing: $(FONTS) .coverage
  64 + cd printing; flutter packages get
  65 + cd printing; flutter test --coverage --coverage-path lcov.info
  66 +
  67 +test: test-pdf test-printing node_modules
  68 + cat pdf/lcov.info printing/lcov.info | node_modules/.bin/lcov-summary
65 69
66 clean: 70 clean:
67 git clean -fdx -e .vscode 71 git clean -fdx -e .vscode
@@ -80,14 +84,18 @@ publish-printing: format clean @@ -80,14 +84,18 @@ publish-printing: format clean
80 pub global activate pana 84 pub global activate pana
81 touch $@ 85 touch $@
82 86
83 -analyze: .pana 87 +analyze-pdf: .pana
84 @find pdf -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';' 88 @find pdf -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';'
85 - @find printing -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';'  
86 @pub global run pana --no-warning --source path pdf 2> /dev/null | python pana_report.py 89 @pub global run pana --no-warning --source path pdf 2> /dev/null | python pana_report.py
87 - @pub global run pana --no-warning --source path printing 2> /dev/null | python pana_report.py  
88 @find pdf -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';' 90 @find pdf -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';'
  91 +
  92 +analyze-printing: .pana
  93 + @find printing -name pubspec.yaml -exec sed -i -e 's/^dependency_overrides:/_dependency_overrides:/g' '{}' ';'
  94 + @pub global run pana --no-warning --source path printing 2> /dev/null | python pana_report.py
89 @find printing -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';' 95 @find printing -name pubspec.yaml -exec sed -i -e 's/^_dependency_overrides:/dependency_overrides:/g' '{}' ';'
90 96
  97 +analyze: analyze-pdf analyze-printing
  98 +
91 .dartfix: 99 .dartfix:
92 pub global activate dartfix 100 pub global activate dartfix
93 touch $@ 101 touch $@
@@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart'; @@ -5,7 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
5 import 'package:pdf/pdf.dart'; 5 import 'package:pdf/pdf.dart';
6 import 'package:pdf/widgets.dart' as pdf; 6 import 'package:pdf/widgets.dart' as pdf;
7 7
8 -import 'package:printing_example/document.dart'; 8 +import '../example/lib/document.dart';
9 9
10 void main() { 10 void main() {
11 testWidgets('Pdf Generate the document', (WidgetTester tester) async { 11 testWidgets('Pdf Generate the document', (WidgetTester tester) async {