Skip to content

Commit 49914d7

Browse files
committed
Fix tests
1 parent 987296c commit 49914d7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

pkgs/native_assets_cli/lib/src/model/build_config.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig {
153153
@override
154154
Map<String, Object> toJson() => {
155155
...hookToJson(),
156-
LinkModePreferenceImpl.configKey: linkModePreference.toString(),
157156
if (!dryRun) ...{
158157
if (_dependencyMetadata != null && _dependencyMetadata.isNotEmpty)
159158
dependencyMetadataConfigKey: _dependencyMetadata.map(
@@ -171,9 +170,6 @@ final class BuildConfigImpl extends HookConfigImpl implements BuildConfig {
171170
if (other is! BuildConfigImpl) {
172171
return false;
173172
}
174-
if (other.linkModePreference != linkModePreference) {
175-
return false;
176-
}
177173
if (!dryRun &&
178174
!const DeepCollectionEquality()
179175
.equals(other._dependencyMetadata, _dependencyMetadata)) {

pkgs/native_assets_cli/lib/src/model/hook_config.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ abstract class HookConfigImpl implements HookConfig {
156156
if (cCompilerJson.isNotEmpty)
157157
CCompilerConfigImpl.configKey: cCompilerJson,
158158
},
159+
LinkModePreferenceImpl.configKey: linkModePreference.toString(),
159160
}.sortOnKey();
160161
}
161162

@@ -380,6 +381,7 @@ can _only_ depend on OS.''');
380381
if (other.packageRoot != packageRoot) return false;
381382
if (other.dryRun != dryRun) return false;
382383
if (other.targetOS != targetOS) return false;
384+
if (other.linkModePreference != linkModePreference) return false;
383385
if (!const DeepCollectionEquality()
384386
.equals(other.supportedAssetTypes, supportedAssetTypes)) return false;
385387
if (!dryRun) {

pkgs/native_assets_cli/test/model/link_config_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ void main() async {
247247
'target_ios_sdk': 'iphoneos',
248248
'target_os': 'ios',
249249
'version': '${HookConfigImpl.latestVersion}',
250+
'link_mode_preference': 'prefer-static',
250251
};
251252
expect(jsonObject, equals(expectedJson));
252253

@@ -293,6 +294,7 @@ void main() async {
293294
'target_android_ndk_api': 30,
294295
'build_mode': BuildModeImpl.release.name,
295296
'assets': 'astring',
297+
'link_mode_preference': LinkModePreferenceImpl.preferStatic.name,
296298
}),
297299
throwsA(predicate(
298300
(e) =>
@@ -312,6 +314,7 @@ void main() async {
312314
'target_architecture': 'arm64',
313315
'target_os': 'android',
314316
'build_mode': BuildModeImpl.release.name,
317+
'link_mode_preference': LinkModePreferenceImpl.preferStatic.name,
315318
}),
316319
throwsA(predicate(
317320
(e) =>

0 commit comments

Comments
 (0)