fix str.removeprefix only works after python 3.9

pull/36062/head
Hannah Shi 9 months ago
parent 7324977aaa
commit ac3e525bf2
  1. 2
      BoringSSL-Package.swift
  2. 6
      templates/BoringSSL-Package.swift.template

@ -7,6 +7,8 @@ let basePath = "third_party/boringssl-with-bazel"
let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy" let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy"
let testPath = "test/boringssl_spm_build" let testPath = "test/boringssl_spm_build"
let package = Package( let package = Package(
name: "BoringSSL-GRPC", name: "BoringSSL-GRPC",
products: [ products: [

@ -9,6 +9,8 @@
let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy" let privacyInfoPath = "../../src/objective-c/PrivacyInfo.xcprivacy"
let testPath = "test/boringssl_spm_build" let testPath = "test/boringssl_spm_build"
let package = Package( let package = Package(
name: "BoringSSL-GRPC", name: "BoringSSL-GRPC",
products: [ products: [
@ -25,12 +27,14 @@
exclude: [ exclude: [
], ],
<% <%
def remove_prefix(s, prefix):
return s[len(prefix):] if s.startswith(prefix) else s
files = [] files = []
lib_maps = {lib.name: lib for lib in libs} lib_maps = {lib.name: lib for lib in libs}
for dep in swift_boringssl_package.get('deps', []): for dep in swift_boringssl_package.get('deps', []):
lib = lib_maps[dep] lib = lib_maps[dep]
files.extend(lib.src) files.extend(lib.src)
files = sorted(set({file.removeprefix("third_party/boringssl-with-bazel/"): file for file in files})) files = sorted(set({remove_prefix(file, "third_party/boringssl-with-bazel/"): file for file in files}))
%> %>
sources: [ sources: [
% for file in files: % for file in files:

Loading…
Cancel
Save