Skip to content

Commit

Permalink
More test updates regarding `targetMacOSVersion must be set iff targe…
Browse files Browse the repository at this point in the history
…tOS==MacOS` requirement
  • Loading branch information
mkustermann committed Oct 15, 2024
1 parent 5b32ae8 commit 2ade85b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void main(List<String> args) async {
targetArchitecture: Architecture.current,
linkModePreference: LinkModePreference.dynamic,
cCompilerConfig: dartCICompilerConfig,
targetMacOSVersion: OS.current == OS.macOS ? defaultMacOSVersion : null,
),
buildMode: BuildMode.release,
targetOS: OS.current,
Expand Down
56 changes: 33 additions & 23 deletions pkgs/native_assets_builder/test/build_runner/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,22 @@ Future<BuildResult?> build(
logger: logger,
dartExecutable: dartExecutable,
).build(
configCreator: () => BuildConfigBuilder()
..setupCodeConfig(
targetArchitecture: target?.architecture ?? Architecture.current,
linkModePreference: linkModePreference,
cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig,
targetIOSSdk: targetIOSSdk,
targetIOSVersion: targetIOSVersion,
targetMacOSVersion: targetMacOSVersion ??
(targetOS == OS.macOS ? _defaultMacOSVersion : null),
targetAndroidNdkApi: targetAndroidNdkApi,
),
configCreator: () {
final configBuilder = BuildConfigBuilder();
if (supportedAssetTypes.contains(CodeAsset.type)) {
configBuilder.setupCodeConfig(
targetArchitecture: target?.architecture ?? Architecture.current,
linkModePreference: linkModePreference,
cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig,
targetIOSSdk: targetIOSSdk,
targetIOSVersion: targetIOSVersion,
targetMacOSVersion: targetMacOSVersion ??
(targetOS == OS.macOS ? defaultMacOSVersion : null),
targetAndroidNdkApi: targetAndroidNdkApi,
);
}
return configBuilder;
},
configValidator: configValidator,
buildMode: BuildMode.release,
targetOS: targetOS,
Expand Down Expand Up @@ -118,17 +123,22 @@ Future<LinkResult?> link(
logger: logger,
dartExecutable: dartExecutable,
).link(
configCreator: () => LinkConfigBuilder()
..setupCodeConfig(
targetArchitecture: target?.architecture ?? Architecture.current,
linkModePreference: linkModePreference,
cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig,
targetIOSSdk: targetIOSSdk,
targetIOSVersion: targetIOSVersion,
targetMacOSVersion: targetMacOSVersion ??
(targetOS == OS.macOS ? _defaultMacOSVersion : null),
targetAndroidNdkApi: targetAndroidNdkApi,
),
configCreator: () {
final configBuilder = LinkConfigBuilder();
if (supportedAssetTypes.contains(CodeAsset.type)) {
configBuilder.setupCodeConfig(
targetArchitecture: target?.architecture ?? Architecture.current,
linkModePreference: linkModePreference,
cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig,
targetIOSSdk: targetIOSSdk,
targetIOSVersion: targetIOSVersion,
targetMacOSVersion: targetMacOSVersion ??
(targetOS == OS.macOS ? defaultMacOSVersion : null),
targetAndroidNdkApi: targetAndroidNdkApi,
);
}
return configBuilder;
},
configValidator: configValidator,
buildMode: BuildMode.release,
targetOS: target?.os ?? OS.current,
Expand Down Expand Up @@ -350,4 +360,4 @@ final CCompilerConfig? dartCICompilerConfig = (() {
return null;
})();

int _defaultMacOSVersion = 13;
int defaultMacOSVersion = 13;

0 comments on commit 2ade85b

Please sign in to comment.