@@ -81,7 +81,8 @@ Future<InitializedCompilerState> initializeCompiler(
81
81
List <Uri > inputSummaries,
82
82
Target target,
83
83
{FileSystem fileSystem,
84
- Map <ExperimentalFlag , bool > experiments}) async {
84
+ Map <ExperimentalFlag , bool > experiments,
85
+ Map <String , String > environmentDefines}) async {
85
86
inputSummaries.sort ((a, b) => a.toString ().compareTo (b.toString ()));
86
87
87
88
if (oldState != null &&
@@ -90,7 +91,8 @@ Future<InitializedCompilerState> initializeCompiler(
90
91
oldState.options.packagesFileUri == packagesFile &&
91
92
oldState.options.librariesSpecificationUri == librariesSpecificationUri &&
92
93
equalLists (oldState.options.inputSummaries, inputSummaries) &&
93
- equalMaps (oldState.options.experimentalFlags, experiments)) {
94
+ equalMaps (oldState.options.experimentalFlags, experiments) &&
95
+ equalMaps (oldState.options.environmentDefines, environmentDefines)) {
94
96
// Reuse old state.
95
97
96
98
// These libraries are marked external when compiling. If not un-marking
@@ -114,7 +116,8 @@ Future<InitializedCompilerState> initializeCompiler(
114
116
..inputSummaries = inputSummaries
115
117
..librariesSpecificationUri = librariesSpecificationUri
116
118
..target = target
117
- ..fileSystem = fileSystem ?? StandardFileSystem .instance;
119
+ ..fileSystem = fileSystem ?? StandardFileSystem .instance
120
+ ..environmentDefines = environmentDefines;
118
121
if (experiments != null ) options.experimentalFlags = experiments;
119
122
120
123
ProcessedOptions processedOpts = new ProcessedOptions (options: options);
@@ -134,7 +137,8 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
134
137
Map <Uri , List <int >> workerInputDigests,
135
138
Target target,
136
139
{FileSystem fileSystem,
137
- Map <ExperimentalFlag , bool > experiments}) async {
140
+ Map <ExperimentalFlag , bool > experiments,
141
+ Map <String , String > environmentDefines}) async {
138
142
inputSummaries.sort ((a, b) => a.toString ().compareTo (b.toString ()));
139
143
140
144
IncrementalCompiler incrementalCompiler;
@@ -156,7 +160,8 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
156
160
oldState.options.compileSdk != compileSdk ||
157
161
cachedSdkInput == null ||
158
162
! digestsEqual (cachedSdkInput.digest, sdkDigest) ||
159
- ! equalMaps (oldState.options.experimentalFlags, experiments)) {
163
+ ! equalMaps (oldState.options.experimentalFlags, experiments) ||
164
+ ! equalMaps (oldState.options.environmentDefines, environmentDefines)) {
160
165
// No previous state.
161
166
options = new CompilerOptions ()
162
167
..compileSdk = compileSdk
@@ -166,7 +171,8 @@ Future<InitializedCompilerState> initializeIncrementalCompiler(
166
171
..inputSummaries = inputSummaries
167
172
..librariesSpecificationUri = librariesSpecificationUri
168
173
..target = target
169
- ..fileSystem = fileSystem ?? StandardFileSystem .instance;
174
+ ..fileSystem = fileSystem ?? StandardFileSystem .instance
175
+ ..environmentDefines = environmentDefines;
170
176
if (experiments != null ) options.experimentalFlags = experiments;
171
177
172
178
// We'll load a new sdk, anything loaded already will have a wrong root.
0 commit comments