@@ -483,6 +483,110 @@ workspaces
483
483
''' );
484
484
}
485
485
486
+ test_packageConfigWorkspace_multipleAnalysisOptions_nestedExclude () async {
487
+ final workspaceRootPath = '/home' ;
488
+ final testPackageRootPath = '$workspaceRootPath /test' ;
489
+ final testPackageLibPath = '$testPackageRootPath /lib' ;
490
+
491
+ newPubspecYamlFile (testPackageRootPath, r'''
492
+ name: test
493
+ ''' );
494
+
495
+ newSinglePackageConfigJsonFile (
496
+ packagePath: testPackageRootPath,
497
+ name: 'test' ,
498
+ );
499
+
500
+ newAnalysisOptionsYamlFile (testPackageRootPath, '' );
501
+ newFile ('$testPackageLibPath /a.dart' , '' );
502
+
503
+ final nestedPath = '$testPackageLibPath /nested' ;
504
+ newAnalysisOptionsYamlFile (nestedPath, r'''
505
+ analyzer:
506
+ exclude:
507
+ - excluded/**
508
+ ''' );
509
+ newFile ('$nestedPath /b.dart' , '' );
510
+ newFile ('$nestedPath /excluded/b.dart' , '' );
511
+
512
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
513
+ contexts
514
+ /home/test
515
+ packagesFile: /home/test/.dart_tool/package_config.json
516
+ workspace: workspace_0
517
+ analyzedFiles
518
+ /home/test/lib/a.dart
519
+ uri: package:test/a.dart
520
+ analysisOptions_0
521
+ workspacePackage_0_0
522
+ /home/test/lib/nested/b.dart
523
+ uri: package:test/nested/b.dart
524
+ analysisOptions_1
525
+ workspacePackage_0_0
526
+ analysisOptions
527
+ analysisOptions_0: /home/test/analysis_options.yaml
528
+ analysisOptions_1: /home/test/lib/nested/analysis_options.yaml
529
+ workspaces
530
+ workspace_0: PackageConfigWorkspace
531
+ root: /home/test
532
+ pubPackages
533
+ workspacePackage_0_0: PubPackage
534
+ root: /home/test
535
+ ''' );
536
+ }
537
+
538
+ test_packageConfigWorkspace_multipleAnalysisOptions_outerExclude () async {
539
+ final workspaceRootPath = '/home' ;
540
+ final testPackageRootPath = '$workspaceRootPath /test' ;
541
+ final testPackageLibPath = '$testPackageRootPath /lib' ;
542
+
543
+ newPubspecYamlFile (testPackageRootPath, r'''
544
+ name: test
545
+ ''' );
546
+
547
+ newSinglePackageConfigJsonFile (
548
+ packagePath: testPackageRootPath,
549
+ name: 'test' ,
550
+ );
551
+
552
+ newAnalysisOptionsYamlFile (testPackageRootPath, r'''
553
+ analyzer:
554
+ exclude:
555
+ - excluded/**
556
+ ''' );
557
+ newFile ('$testPackageLibPath /a.dart' , '' );
558
+ newFile ('$testPackageRootPath /excluded/b.dart' , '' );
559
+
560
+ final nestedPath = '$testPackageLibPath /nested' ;
561
+ newAnalysisOptionsYamlFile (nestedPath, '' );
562
+ newFile ('$nestedPath /b.dart' , '' );
563
+
564
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
565
+ contexts
566
+ /home/test
567
+ packagesFile: /home/test/.dart_tool/package_config.json
568
+ workspace: workspace_0
569
+ analyzedFiles
570
+ /home/test/lib/a.dart
571
+ uri: package:test/a.dart
572
+ analysisOptions_0
573
+ workspacePackage_0_0
574
+ /home/test/lib/nested/b.dart
575
+ uri: package:test/nested/b.dart
576
+ analysisOptions_1
577
+ workspacePackage_0_0
578
+ analysisOptions
579
+ analysisOptions_0: /home/test/analysis_options.yaml
580
+ analysisOptions_1: /home/test/lib/nested/analysis_options.yaml
581
+ workspaces
582
+ workspace_0: PackageConfigWorkspace
583
+ root: /home/test
584
+ pubPackages
585
+ workspacePackage_0_0: PubPackage
586
+ root: /home/test
587
+ ''' );
588
+ }
589
+
486
590
test_packageConfigWorkspace_multipleAnalysisOptions_overridingOptions () async {
487
591
final workspaceRootPath = '/home' ;
488
592
final testPackageRootPath = '$workspaceRootPath /test' ;
@@ -717,6 +821,49 @@ workspaces
717
821
''' );
718
822
}
719
823
824
+ test_packageConfigWorkspace_singleAnalysisOptions_exclude () async {
825
+ final workspaceRootPath = '/home' ;
826
+ final testPackageRootPath = '$workspaceRootPath /test' ;
827
+ final testPackageLibPath = '$testPackageRootPath /lib' ;
828
+
829
+ newPubspecYamlFile (testPackageRootPath, r'''
830
+ name: test
831
+ ''' );
832
+ newSinglePackageConfigJsonFile (
833
+ packagePath: testPackageRootPath,
834
+ name: 'test' ,
835
+ );
836
+ newAnalysisOptionsYamlFile (testPackageRootPath, r'''
837
+ analyzer:
838
+ exclude:
839
+ - lib/nested/**
840
+ ''' );
841
+
842
+ newFile ('$testPackageLibPath /a.dart' , '' );
843
+ final nestedPath = '$testPackageLibPath /nested' ;
844
+ newFile ('$nestedPath /b.dart' , '' );
845
+
846
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
847
+ contexts
848
+ /home/test
849
+ packagesFile: /home/test/.dart_tool/package_config.json
850
+ workspace: workspace_0
851
+ analyzedFiles
852
+ /home/test/lib/a.dart
853
+ uri: package:test/a.dart
854
+ analysisOptions_0
855
+ workspacePackage_0_0
856
+ analysisOptions
857
+ analysisOptions_0: /home/test/analysis_options.yaml
858
+ workspaces
859
+ workspace_0: PackageConfigWorkspace
860
+ root: /home/test
861
+ pubPackages
862
+ workspacePackage_0_0: PubPackage
863
+ root: /home/test
864
+ ''' );
865
+ }
866
+
720
867
test_packageConfigWorkspace_singleAnalysisOptions_multipleContexts () async {
721
868
final workspaceRootPath = '/home' ;
722
869
final testPackageRootPath = '$workspaceRootPath /test' ;
@@ -897,6 +1044,130 @@ workspaces
897
1044
''' );
898
1045
}
899
1046
1047
+ @override
1048
+ test_packageConfigWorkspace_multipleAnalysisOptions_nestedExclude () async {
1049
+ final workspaceRootPath = '/home' ;
1050
+ final testPackageRootPath = '$workspaceRootPath /test' ;
1051
+ final testPackageLibPath = '$testPackageRootPath /lib' ;
1052
+
1053
+ newPubspecYamlFile (testPackageRootPath, r'''
1054
+ name: test
1055
+ ''' );
1056
+
1057
+ newSinglePackageConfigJsonFile (
1058
+ packagePath: testPackageRootPath,
1059
+ name: 'test' ,
1060
+ );
1061
+
1062
+ newAnalysisOptionsYamlFile (testPackageRootPath, '' );
1063
+ newFile ('$testPackageLibPath /a.dart' , '' );
1064
+
1065
+ final nestedPath = '$testPackageLibPath /nested' ;
1066
+ newAnalysisOptionsYamlFile (nestedPath, r'''
1067
+ analyzer:
1068
+ exclude:
1069
+ - excluded/**
1070
+ ''' );
1071
+ newFile ('$nestedPath /b.dart' , '' );
1072
+ newFile ('$nestedPath /excluded/b.dart' , '' );
1073
+
1074
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
1075
+ contexts
1076
+ /home/test
1077
+ packagesFile: /home/test/.dart_tool/package_config.json
1078
+ workspace: workspace_0
1079
+ analyzedFiles
1080
+ /home/test/lib/a.dart
1081
+ uri: package:test/a.dart
1082
+ analysisOptions_0
1083
+ workspacePackage_0_0
1084
+ /home/test/lib/nested
1085
+ packagesFile: /home/test/.dart_tool/package_config.json
1086
+ workspace: workspace_1
1087
+ analyzedFiles
1088
+ /home/test/lib/nested/b.dart
1089
+ uri: package:test/nested/b.dart
1090
+ analysisOptions_1
1091
+ workspacePackage_1_0
1092
+ analysisOptions
1093
+ analysisOptions_0: /home/test/analysis_options.yaml
1094
+ analysisOptions_1: /home/test/lib/nested/analysis_options.yaml
1095
+ workspaces
1096
+ workspace_0: PackageConfigWorkspace
1097
+ root: /home/test
1098
+ pubPackages
1099
+ workspacePackage_0_0: PubPackage
1100
+ root: /home/test
1101
+ workspace_1: PackageConfigWorkspace
1102
+ root: /home/test
1103
+ pubPackages
1104
+ workspacePackage_1_0: PubPackage
1105
+ root: /home/test
1106
+ ''' );
1107
+ }
1108
+
1109
+ @override
1110
+ test_packageConfigWorkspace_multipleAnalysisOptions_outerExclude () async {
1111
+ final workspaceRootPath = '/home' ;
1112
+ final testPackageRootPath = '$workspaceRootPath /test' ;
1113
+ final testPackageLibPath = '$testPackageRootPath /lib' ;
1114
+
1115
+ newPubspecYamlFile (testPackageRootPath, r'''
1116
+ name: test
1117
+ ''' );
1118
+
1119
+ newSinglePackageConfigJsonFile (
1120
+ packagePath: testPackageRootPath,
1121
+ name: 'test' ,
1122
+ );
1123
+
1124
+ newAnalysisOptionsYamlFile (testPackageRootPath, r'''
1125
+ analyzer:
1126
+ exclude:
1127
+ - excluded/**
1128
+ ''' );
1129
+ newFile ('$testPackageLibPath /a.dart' , '' );
1130
+ newFile ('$testPackageRootPath /excluded/b.dart' , '' );
1131
+
1132
+ final nestedPath = '$testPackageLibPath /nested' ;
1133
+ newAnalysisOptionsYamlFile (nestedPath, '' );
1134
+ newFile ('$nestedPath /b.dart' , '' );
1135
+
1136
+ _assertWorkspaceCollectionText (workspaceRootPath, r'''
1137
+ contexts
1138
+ /home/test
1139
+ packagesFile: /home/test/.dart_tool/package_config.json
1140
+ workspace: workspace_0
1141
+ analyzedFiles
1142
+ /home/test/lib/a.dart
1143
+ uri: package:test/a.dart
1144
+ analysisOptions_0
1145
+ workspacePackage_0_0
1146
+ /home/test/lib/nested
1147
+ packagesFile: /home/test/.dart_tool/package_config.json
1148
+ workspace: workspace_1
1149
+ analyzedFiles
1150
+ /home/test/lib/nested/b.dart
1151
+ uri: package:test/nested/b.dart
1152
+ analysisOptions_1
1153
+ workspacePackage_1_0
1154
+ analysisOptions
1155
+ analysisOptions_0: /home/test/analysis_options.yaml
1156
+ analysisOptions_1: /home/test/lib/nested/analysis_options.yaml
1157
+ workspaces
1158
+ workspace_0: PackageConfigWorkspace
1159
+ root: /home/test
1160
+ pubPackages
1161
+ workspacePackage_0_0: PubPackage
1162
+ root: /home/test
1163
+ workspace_1: PackageConfigWorkspace
1164
+ root: /home/test
1165
+ pubPackages
1166
+ workspacePackage_1_0: PubPackage
1167
+ root: /home/test
1168
+ ''' );
1169
+ }
1170
+
900
1171
@override
901
1172
test_packageConfigWorkspace_multipleAnalysisOptions_overridingOptions () async {
902
1173
final workspaceRootPath = '/home' ;
0 commit comments