stripCommand method

List<String> stripCommand(
  1. NativeTarget target
)

Resolve the strip executable for target.

For Android, returns the NDK's llvm-strip. For Apple, returns xcrun strip wrapper. Otherwise returns plain strip or llvm-strip discovery.

Implementation

List<String> stripCommand(NativeTarget target) {
  if (target.os == OS.android) {
    final ndk = _findAndroidNdk();
    if (ndk != null) {
      final hostTag = _ndkHostTag();
      final llvmStrip = p.join(
        ndk.path,
        'toolchains',
        'llvm',
        'prebuilt',
        hostTag,
        'bin',
        'llvm-strip',
      );
      if (File(llvmStrip).existsSync()) return [llvmStrip];
    }
  }
  if (target.os == OS.iOS || target.os == OS.macOS) {
    // Prefer xcrun strip when available.
    return ['xcrun', 'strip'];
  }
  return ['strip'];
}