@@ -70,6 +70,24 @@ class SdkConfiguration {
7070 fileSystem ?? = const LocalFileSystem ();
7171
7272 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 ();
7391
7492 if (unsoundSdkSummaryPath == null ||
7593 ! fileSystem.file (unsoundSdkSummaryPath).existsSync ()) {
@@ -82,29 +100,26 @@ class SdkConfiguration {
82100 throw InvalidSdkConfigurationException (
83101 'Sdk summary $soundSdkSummaryPath does not exist' );
84102 }
103+ }
104+
105+ void validateLibrariesSpec ({FileSystem fileSystem}) {
106+ fileSystem ?? = const LocalFileSystem ();
85107
86108 if (librariesPath == null || ! fileSystem.file (librariesPath).existsSync ()) {
87109 throw InvalidSdkConfigurationException (
88110 'Libraries spec $librariesPath does not exist' );
89111 }
112+ }
113+
114+ void validateCompilerWorker ({FileSystem fileSystem}) {
115+ fileSystem ?? = const LocalFileSystem ();
90116
91117 if (compilerWorkerPath == null ||
92118 ! fileSystem.file (compilerWorkerPath).existsSync ()) {
93119 throw InvalidSdkConfigurationException (
94120 'Compiler worker $compilerWorkerPath does not exist' );
95121 }
96122 }
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- }
108123}
109124
110125/// Implementation for the default SDK configuration layout.
0 commit comments