Update pod generation script

Motivation:

To workaround https://github.com/apple/swift-nio/issues/2073 we must
list all transitive dependencies when building podspecs.

Modifications:

- Copy over `list_transitive_dependencies.py` from the NIO repo.
- Include transitive dependencies in the build_podspec script
- Bump C++ language standard from 11 to 14
- Ignore non-modular header warnings
- Be more precise when specifying 'CNIOBoringSSL*' targets
- Use python3 in build-asm.py (The soundness script includes the
  shebang as part of the 'hash' when checking for license headers and
  only allows for one shebang per extension so we cannot use both Python
  2 and 3 in the same repo.)

Result:

Podspec generation script includes transitive dependencies.
This commit is contained in:
George Barnett committed 2022-05-04 10:59:20 +01:00
1 parent 9bc329d9e4
commit 36880de810
4 files changed
+132 -11

No files matched your search

+6 -4
View File
@@ -83,12 +83,12 @@ for target in "${targets[@]}"; do
dependencies=()
while read -r raw_dependency; do
if [[ "$raw_dependency" =~ ^CNIO ]]; then
if [[ "$raw_dependency" =~ ^CNIOBoringSSL ]]; then
dependencies+=( "${newline} s.dependency '$raw_dependency', s.version.to_s" )
else
dependencies+=( "${newline} s.dependency '$raw_dependency', '>= $nio_version', '< $next_major_version'" )
fi
done < <("${here}/list_topsorted_dependencies.sh" -d "${target#Swift}" | sed 's/^NIO/SwiftNIO/')
done < <("${here}/list_transitive_dependencies.py" "${target#Swift}" | sed 's/^NIO/SwiftNIO/')
# C++ specific podspec settings
@@ -98,8 +98,10 @@ for target in "${targets[@]}"; do
if [ "$target" == "CNIOBoringSSL" ] || [ "$target" == "CNIOBoringSSLShims" ]; then
libraries="s.libraries = 'c++'"
xcconfig="s.xcconfig = { 'HEADER_SEARCH_PATHS' => 'Sources/${target}/include', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++11', }"
xcconfig="s.xcconfig = { 'HEADER_SEARCH_PATHS' => 'Sources/${target}/include', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }"
public_header_files="s.public_header_files = 'Sources/${target}/include/*.h'"
elif [ "$target" == "SwiftNIOSSL" ]; then
xcconfig="s.xcconfig = { 'OTHER_SWIFT_FLAGS' => '-Xcc -Wno-error=non-modular-include-in-framework-module' }"
fi
cat > "${tmpdir}/${target}.podspec" <<- EOF
@@ -137,9 +139,9 @@ Pod::Spec.new do |s|
end
EOF
pod repo update # last chance of getting the latest versions of previous pushed pods
if $upload; then
echo "Uploading ${tmpdir}/${target}.podspec"
pod repo update # last chance of getting the latest versions of previous pushed pods
# CNIOBoringSSL and SwiftNIOSSL emit build warnings
pod trunk push --allow-warnings --synchronous "${tmpdir}/${target}.podspec"
fi