Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump OpenTelemetry to new version #123

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/open-telemetry/opentelemetry-swift",
"state" : {
"revision" : "0dd37c4a14a6aeeb131eea40a13cb3832c7c6a97",
"version" : "1.10.1"
"revision" : "0cd4a4c041baead7f845325b86b57f3d1355e86b"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ let package = Package(
),
.package(
url: "https://github.com/open-telemetry/opentelemetry-swift",
exact: "1.10.1"
revision: "0cd4a4c041baead7f845325b86b57f3d1355e86b"
),
.package(
url: "https://github.com/groue/GRDB.swift",
Expand Down
36 changes: 23 additions & 13 deletions bin/build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,41 @@ mkdir -p "$BUILD_DIR"

get_dependency_info() {
local DEPENDENCY_NAME=$(echo "$1" | tr '[:upper:]' '[:lower:]')
local INFO=$(jq -r --arg NAME "$DEPENDENCY_NAME" '.pins[] | select(.identity == $NAME) | { url: .location, version: (.state.version // .state.branch) }' Package.resolved)
local INFO=$(jq -r --arg NAME "$DEPENDENCY_NAME" '
.pins[] | select(.identity == $NAME) |
if .state.version or .state.branch then
{ url: .location, version: (.state.version // .state.branch) }
else
{ url: .location, revision: .state.revision }
end
' Package.resolved)
echo "$INFO"
}

for NAME in "${DEPENDENCIES[@]}"; do
echo "Processing dependency: $NAME"

INFO=$(get_dependency_info "$NAME")
echo $INFO
URL=$(echo "$INFO" | jq -r '.url')
VERSION=$(echo "$INFO" | jq -r '.version')

if [ -z "$URL" ] || [ -z "$VERSION" ]; then
echo "Could not find dependency $NAME in Package.resolved"
exit 1
fi

echo "URL: $URL"
echo "Version: $VERSION"
REVISION=$(echo "$INFO" | jq -r '.revision')

REPO_DIR="$TEMP_DIR/$NAME"
if git ls-remote --tags "$URL" | grep -q "refs/tags/v${VERSION}$"; then
git clone --branch "v${VERSION}" "$URL" "$REPO_DIR"
if [ "$VERSION" != "null" ]; then
if git ls-remote --tags "$URL" | grep -q "refs/tags/v${VERSION}$"; then
git clone --branch "v${VERSION}" "$URL" "$REPO_DIR"
else
git clone --branch "$VERSION" "$URL" "$REPO_DIR"
fi
elif [ "$REVISION" != "null" ]; then
git clone "$URL" "$REPO_DIR"
cd "$REPO_DIR"
git fetch --depth 1 origin "$REVISION"
git checkout "$REVISION"
cd -
else
git clone --branch "$VERSION" "$URL" "$REPO_DIR"
echo "Could not find dependency $NAME in Package.resolved"
exit 1
fi

LOWERCASE_NAME=$(echo "$NAME" | tr '[:upper:]' '[:lower:]')
Expand Down
Loading