@@ -70,6 +70,24 @@ class SdkConfiguration {
70
70
fileSystem ?? = const LocalFileSystem ();
71
71
72
72
validateSdkDir (fileSystem: fileSystem);
73
+ validateSummaries (fileSystem: fileSystem);
74
+ validateLibrariesSpec (fileSystem: fileSystem);
75
+ validateCompilerWorker (fileSystem: fileSystem);
76
+ }
77
+
78
+ /// Throws [InvalidSdkConfigurationException] if SDK root does not
79
+ /// exist on the disk.
80
+ void validateSdkDir ({FileSystem fileSystem}) {
81
+ fileSystem ?? = const LocalFileSystem ();
82
+ if (sdkDirectory == null ||
83
+ ! fileSystem.directory (sdkDirectory).existsSync ()) {
84
+ throw InvalidSdkConfigurationException (
85
+ 'Sdk directory $sdkDirectory does not exist' );
86
+ }
87
+ }
88
+
89
+ void validateSummaries ({FileSystem fileSystem}) {
90
+ fileSystem ?? = const LocalFileSystem ();
73
91
74
92
if (unsoundSdkSummaryPath == null ||
75
93
! fileSystem.file (unsoundSdkSummaryPath).existsSync ()) {
@@ -82,29 +100,26 @@ class SdkConfiguration {
82
100
throw InvalidSdkConfigurationException (
83
101
'Sdk summary $soundSdkSummaryPath does not exist' );
84
102
}
103
+ }
104
+
105
+ void validateLibrariesSpec ({FileSystem fileSystem}) {
106
+ fileSystem ?? = const LocalFileSystem ();
85
107
86
108
if (librariesPath == null || ! fileSystem.file (librariesPath).existsSync ()) {
87
109
throw InvalidSdkConfigurationException (
88
110
'Libraries spec $librariesPath does not exist' );
89
111
}
112
+ }
113
+
114
+ void validateCompilerWorker ({FileSystem fileSystem}) {
115
+ fileSystem ?? = const LocalFileSystem ();
90
116
91
117
if (compilerWorkerPath == null ||
92
118
! fileSystem.file (compilerWorkerPath).existsSync ()) {
93
119
throw InvalidSdkConfigurationException (
94
120
'Compiler worker $compilerWorkerPath does not exist' );
95
121
}
96
122
}
97
-
98
- /// Throws [InvalidSdkConfigurationException] if SDK root does not
99
- /// exist on the disk.
100
- void validateSdkDir ({FileSystem fileSystem}) {
101
- fileSystem ?? = const LocalFileSystem ();
102
- if (sdkDirectory == null ||
103
- ! fileSystem.directory (sdkDirectory).existsSync ()) {
104
- throw InvalidSdkConfigurationException (
105
- 'Sdk directory $sdkDirectory does not exist' );
106
- }
107
- }
108
123
}
109
124
110
125
/// Implementation for the default SDK configuration layout.
0 commit comments