#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftNIO open source project ## ## Copyright (c) 2019-2020 Apple Inc. and the SwiftNIO project authors ## Licensed under Apache License v2.0 ## ## See LICENSE.txt for license information ## See CONTRIBUTORS.txt for the list of SwiftNIO project authors ## ## SPDX-License-Identifier: Apache-2.0 ## ##===----------------------------------------------------------------------===## set -eu here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" build_opts=( -c release ) function die() { echo >&2 "ERROR: $*" exit 1 } function make_git_commit_all() { git init > /dev/null git checkout -b main > /dev/null if [[ "$(git config user.email)" == "" ]]; then git config --local user.email does@really-not.matter git config --local user.name 'Does Not Matter' fi git add . > /dev/null git commit -m 'everything' > /dev/null } # function hooked_package_swift_start() { local extra_dependencies_file=$1 local swiftpm_pkg_name=$2 shift 2 cat <<"EOF" // swift-tools-version:5.7 import PackageDescription let package = Package( name: "allocation-counter-tests", platforms: [ .macOS(.v10_15), .iOS(.v13), .watchOS(.v6), .tvOS(.v13), ], products: [ EOF for f in "$@"; do local module module=$(module_name_from_path "$f") echo ".executable(name: \"$module\", targets: [\"bootstrap_$module\"])," done cat < function hooked_package_swift_target() { local target_name="$1" shift local deps="" for dep in "$@"; do deps="$deps .product(name: \"$dep\", package: \"swift-nio\")," done cat < Package.swift <