Skip to content
Merged
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
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ jobs:
- v2-cargo-cache-{{arch}}-{{checksum "buildtype.txt"}}-{{checksum "Cargo.lock"}}
- run:
name: Run iOS build
command: bash bin/run-ios-build.sh
command: make build-swift
- save_cache:
paths:
- /Users/distiller/.cargo/registry
Expand All @@ -598,14 +598,14 @@ jobs:
if git log -1 "$CIRCLE_SHA1" | grep -q '\[doc only\]'; then
echo "Skipping this step. Last commit was tagged to not require tests."
else
bash bin/run-ios-tests.sh
make test-swift
fi
- run:
name: Generate Swift documentation
command: |
# Skip doc generation for pull requests.
if [ "$CIRCLE_BRANCH" = "main" ]; then
bash bin/build-swift-docs.sh
make docs-swift
else
mkdir -p build/docs/swift
fi
Expand Down Expand Up @@ -666,14 +666,14 @@ jobs:
- run:
name: Build sample app
command: |
bash bin/run-ios-sample-app-build.sh
bin/iosbuild build sample
- store_artifacts:
path: raw_sample_xcodebuild.log
destination: raw_sample_xcodebuild.log
- run:
name: Run sample app tests
command: |
bash bin/run-ios-sample-app-test.sh
bin/iosbuild test sample
- store_artifacts:
path: raw_sample_xcodetest.log
destination: raw_sample_xcodetest.log
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ build-kotlin: ## Build all Kotlin code
./gradlew build -x test

build-swift: ## Build all Swift code
bin/run-ios-build.sh
bin/iosbuild build sdk

build-apk: build-kotlin ## Build an apk of the Glean sample app
./gradlew glean-sample-app:build glean-sample-app:assembleAndroidTest
Expand Down Expand Up @@ -83,13 +83,13 @@ test-kotlin: ## Run all Kotlin tests
./gradlew :glean:testDebugUnitTest

test-swift: ## Run all Swift tests
bin/run-ios-tests.sh
bin/iosbuild test sdk

test-android-sample: build-apk ## Run the Android UI tests on the sample app
./gradlew :glean-sample-app:connectedAndroidTest

test-ios-sample: ## Run the iOS UI tests on the sample app
bin/run-ios-sample-app-test.sh
bin/iosbuild test sample

test-python: build-python ## Run all Python tests
$(GLEAN_PYENV)/bin/py.test -v glean-core/python/tests $(PYTEST_ARGS)
Expand Down Expand Up @@ -147,7 +147,7 @@ docs-rust: ## Build the Rust documentation
bin/build-rust-docs.sh

docs-swift: ## Build the Swift documentation
bin/build-swift-docs.sh
bin/iosbuild build docs

docs-python: build-python ## Build the Python documentation
$(GLEAN_PYENV)/bin/python3 -m pdoc --html glean --force -o build/docs/python --config show_type_annotations=True
Expand Down
19 changes: 0 additions & 19 deletions bin/build-swift-docs.sh

This file was deleted.

86 changes: 86 additions & 0 deletions bin/iosbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

SDK_WORKSPACE="./glean-core/ios/Glean.xcodeproj/project.xcworkspace"
SDK_SCHEME="Glean"

SAMPLE_WORKSPACE="./samples/ios/app/glean-sample-app.xcodeproj/project.xcworkspace"
SAMPLE_SCHEME="glean-sample-app"

DESTINATION="platform=iOS Simulator,name=iPhone 17"

cmd="${1:-}"
target="${2:-sdk}"

function help() {
echo "Usage: bin/iosbuild cmd [target]"
echo
echo "Commands: build test update-xcode"
echo "Targets: sdk sample xcframework"
}

function xbuild() {
local workspace="$1"
local scheme="$2"
local cmd="$3"
local tee_file="$4"

set -euvx
set -o pipefail && \
xcodebuild \
-workspace "$workspace" \
-scheme "$scheme" \
-sdk iphonesimulator \
-destination "$DESTINATION" \
"$cmd" | \
tee "$tee_file" | \
xcpretty && exit "${PIPESTATUS[0]}"
}

if [[ -z "$cmd" ]]; then
help
exit 2
fi

WORKSPACE_ROOT="$( cd "$(dirname "$0")/.." ; pwd -P )"
cd "$WORKSPACE_ROOT"

case "${cmd}-${target}" in
"build-sdk")
xbuild "$SDK_WORKSPACE" "$SDK_SCHEME" build "raw_xcodebuild.log"
;;
"test-sdk")
xbuild "$SDK_WORKSPACE" "$SDK_SCHEME" test "raw_xcodetest.log"
;;
"build-sample")
xbuild "$SAMPLE_WORKSPACE" "$SAMPLE_SCHEME" build "raw_sample_xcodebuild.log"
;;
"test-sample")
xbuild "$SAMPLE_WORKSPACE" "$SAMPLE_SCHEME" test "raw_sample_xcodetest.log"
;;
"build-xcframework")
./bin/build-xcframework.sh
;;
"build-docs")
set -eo pipefail

# Requires jazzy from https://github.com/realm/jazzy
jazzy --version
jazzy \
--clean \
--config "$WORKSPACE_ROOT/.circleci/jazzy.yml" \
--output "$WORKSPACE_ROOT/build/docs/swift"
;;
update-xcode-*)
./bin/update-xcode-version.sh "$target"
;;
*)
echo "Unknown cmd/target combination."
echo
help
exit 2
;;
esac
17 changes: 0 additions & 17 deletions bin/run-ios-build.sh

This file was deleted.

17 changes: 0 additions & 17 deletions bin/run-ios-sample-app-build.sh

This file was deleted.

17 changes: 0 additions & 17 deletions bin/run-ios-sample-app-test.sh

This file was deleted.

17 changes: 0 additions & 17 deletions bin/run-ios-tests.sh

This file was deleted.

18 changes: 0 additions & 18 deletions bin/rust-wrapper-hack.sh

This file was deleted.