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

Santtu ios build #14

Open
wants to merge 68 commits into
base: module3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
9bb2e18
Streamr iOS xcframework creation script added
SanttuRantanen Aug 22, 2024
21c138a
Calling create-streamr-xcframework.pl fixed
SanttuRantanen Aug 22, 2024
1457079
iOS app example StreamrProtoRpcExampleApp added
SanttuRantanen Aug 22, 2024
8626d09
Small improvement
SanttuRantanen Aug 22, 2024
afa638a
LocationShare example iOS app
SanttuRantanen Aug 25, 2024
6d02472
Small change for LocationShare example iOS app
SanttuRantanen Aug 26, 2024
7df38fe
Some changes
SanttuRantanen Aug 26, 2024
30efb8c
Status added to the main view
SanttuRantanen Aug 26, 2024
c8c05be
Gtest unit tests can be run in iOS device using testing app
SanttuRantanen Aug 30, 2024
ee054f1
Gtest unit tests can be run in iOS device using testing app
SanttuRantanen Aug 30, 2024
1139354
One file removed
SanttuRantanen Aug 31, 2024
1a36e5e
Small changes
SanttuRantanen Aug 31, 2024
6286d2b
iostest.sh runs GTests for iOS device
SanttuRantanen Aug 31, 2024
75ee29d
iostest.sh runs GTests for iOS device
SanttuRantanen Aug 31, 2024
e7bd037
one file removed
SanttuRantanen Aug 31, 2024
356de1a
Fix for create-streamr-xcframework.pl
SanttuRantanen Aug 31, 2024
138d188
xcparse installation added
SanttuRantanen Aug 31, 2024
00d844e
Small change
SanttuRantanen Aug 31, 2024
9663e85
File renaming
SanttuRantanen Aug 31, 2024
cb54a73
small changed
SanttuRantanen Aug 31, 2024
b2c83f3
Create ios_build.yml
SanttuRantanen Aug 31, 2024
9871d76
iosbuild ci test
SanttuRantanen Aug 31, 2024
9a5dcca
Merge remote-tracking branch 'origin/santtu-ios-build' into santtu-io…
SanttuRantanen Aug 31, 2024
cfd281c
iosbuild ci test
SanttuRantanen Aug 31, 2024
def2ec5
Create action_ios.yml
SanttuRantanen Aug 31, 2024
7b01623
Delete .github/workflows/reusable/cached-install/action_ios.yml
SanttuRantanen Aug 31, 2024
5e592c9
Fix for iOS CI
SanttuRantanen Aug 31, 2024
b6b9575
iosbuild ci test
SanttuRantanen Aug 31, 2024
428fadb
xcode-select change
SanttuRantanen Aug 31, 2024
6f18a67
iosbuild ci test
SanttuRantanen Aug 31, 2024
7357610
Fix for iOS CI
SanttuRantanen Aug 31, 2024
c5b2ebe
iosbuild ci test
SanttuRantanen Aug 31, 2024
d3421fe
iosbuild ci test
SanttuRantanen Aug 31, 2024
65652ca
iosbuild ci test
SanttuRantanen Aug 31, 2024
94829fc
iosbuild ci test
SanttuRantanen Aug 31, 2024
5fbbd23
iosbuild ci test
SanttuRantanen Aug 31, 2024
f2bacbf
iosbuild ci test
SanttuRantanen Aug 31, 2024
802f1bd
iosbuild ci test
SanttuRantanen Aug 31, 2024
59e0301
iosbuild ci test
SanttuRantanen Aug 31, 2024
1483dc9
iosbuild ci test
SanttuRantanen Aug 31, 2024
6da94a6
iosbuild ci test
SanttuRantanen Aug 31, 2024
c0fc391
iosbuild ci test
SanttuRantanen Sep 21, 2024
2f7c1b6
iosbuild ci test
SanttuRantanen Sep 21, 2024
e51e8c8
iosbuild ci test
SanttuRantanen Sep 21, 2024
6f79a72
iosbuild ci test
SanttuRantanen Sep 21, 2024
9c554d2
iosbuild ci test
SanttuRantanen Sep 21, 2024
3e3c42a
iosbuild ci test
SanttuRantanen Sep 21, 2024
5672571
iosbuild ci test
SanttuRantanen Sep 21, 2024
39e60ff
iosbuild ci test
SanttuRantanen Sep 21, 2024
f4ff2d8
iosbuild ci test
SanttuRantanen Sep 21, 2024
36055b7
iosbuild ci test
SanttuRantanen Sep 22, 2024
414b1bd
iosbuild ci test
SanttuRantanen Sep 22, 2024
8c97767
iosbuild ci test
SanttuRantanen Sep 23, 2024
8f159d1
iosbuild ci test
SanttuRantanen Sep 23, 2024
a952648
iosbuild ci test
SanttuRantanen Sep 23, 2024
5bb172e
iosbuild ci test
SanttuRantanen Sep 23, 2024
c5727ce
iosbuild ci test
SanttuRantanen Sep 23, 2024
99b753c
iosbuild ci test
SanttuRantanen Sep 23, 2024
cbb03f7
iosbuild ci test
SanttuRantanen Sep 23, 2024
fe7492a
iosbuild ci test
SanttuRantanen Sep 23, 2024
f64a543
iosbuild ci test
SanttuRantanen Sep 23, 2024
2dedffe
iosbuild ci test
SanttuRantanen Sep 24, 2024
dc31a1f
iosbuild ci test
SanttuRantanen Sep 24, 2024
2509adb
iosbuild ci test
SanttuRantanen Sep 24, 2024
f6bb315
iosbuild ci test
SanttuRantanen Sep 24, 2024
37c7129
iosbuild ci test
SanttuRantanen Sep 24, 2024
2b71bc5
iOS CI actions deleted
SanttuRantanen Sep 28, 2024
cb7c723
Duplicate GTest lib directory removed
SanttuRantanen Sep 29, 2024
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
48 changes: 48 additions & 0 deletions create-streamr-xcframework.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/perl

use strict;
use warnings;
use File::Find;
use File::Path qw(make_path);
use File::Copy::Recursive qw(dircopy);
use Cwd;

my $abs_path = getcwd;
my $root_build = "build/ios";
my $build_include = "$abs_path/$root_build/include";
my $build_lib = "$abs_path/$root_build/lib";
my $dist_path = "$abs_path/dist/ios";

print "Please wait, building xcframework.\n";

`rm -rf $build_include`;
`rm -rf $build_lib`;
`rm -rf $dist_path`;

make_path($build_include);
make_path($build_lib);

# Copy streamr headers
dircopy("$abs_path/packages/streamr-proto-rpc/include", $build_include);
dircopy("$abs_path/packages/streamr-logger/include", $build_include);
dircopy("$abs_path/packages/streamr-json/include", $build_include);
dircopy("$abs_path/packages/streamr-eventemitter/include", $build_include);

# Find all include and lib directories and process them
find(\&process_dir, "./build/vcpkg_installed/arm64-ios");
dircopy("$abs_path/build/vcpkg_installed/arm64-ios/lib", $build_lib);
`libtool -static -o $build_lib/libstreamr.a $build_lib/*.a`;
`xcodebuild -create-xcframework -library $build_lib/libstreamr.a -headers $build_include -output $dist_path/streamr.xcframework`;
print "\nstreamr.xcframework was created in the directory: dist/ios.\n";

# Subroutine to process each directory
sub process_dir {
my $dir = $File::Find::name;
print "Current dir: $dir\n";
if ($dir =~ m|^\./build/vcpkg_installed/arm64-ios/include$|) {
# Copy includes from vcpkg-packages (vcpkg/packages/<Package>/include)
dircopy("$abs_path/$dir", $build_include);
print "cp $abs_path/$dir $build_include\n";
}
}

6 changes: 3 additions & 3 deletions install-prerequisities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
#PROFILE_FILE=~/.zprofile
PROFILE_FILE=./setenvs.sh

xcode-select --install
xcode-select --install || true
brew install jq
brew uninstall llvm
brew uninstall llvm || true
brew install llvm@17
brew install cmake
brew install pkg-config
Expand Down Expand Up @@ -95,7 +95,7 @@ echo $TEMP_PROFILE_CONTENTS

touch $PROFILE_FILE
# Remove old version of the block
sed -i '/# streamr-native-sdk added start/,/# streamr-native-sdk added end/d' $PROFILE_FILE
sed -i '/# streamr-native-sdk added start/,/# streamr-native-sdk added end/d' $PROFILE_FILE || true
# Add new block to profile file
echo -e "# streamr-native-sdk added start\n$TEMP_PROFILE_CONTENTS# streamr-native-sdk added end" >> $PROFILE_FILE

Expand Down
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ while [[ "$#" -gt 0 ]]; do
--prod) PROD_BUILD=true ;;
--ios) TARGET_TRIPLET="arm64-ios"; CHAINLOAD_TOOLCHAIN_FILE="$(pwd)/overlaytriplets/arm64-ios.cmake"; PLATFORM="OS64" ;;
--android) TARGET_TRIPLET="arm64-android"; CHAINLOAD_TOOLCHAIN_FILE="$(pwd)/overlaytriplets/arm64-android.cmake"; PLATFORM="android" ;;
--xcframework) CREATE_XCFRAMEWORK=true ;;
*) echo "Unknown parameter passed: $1. Usage: ./install.sh [--prod] [--ios] [--android]"; exit 1 ;;
esac
shift
Expand Down Expand Up @@ -72,3 +73,6 @@ else
cd build && cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && cmake --build . && cd ..
fi

if [ "$CREATE_XCFRAMEWORK" = true ]; then
./create-streamr-xcframework.pl
fi
40 changes: 40 additions & 0 deletions iostest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

rm -rf build/ios

brew install chargepoint/xcparse/xcparse

# Run tests
xcodebuild test -project test/ios/iOSUnitTesting/iOSUnitTesting.xcodeproj -scheme iOSUnitTesting -destination 'platform=macOS' -configuration Debug -resultBundlePath build/ios/TestResults.xcresult

# Check if xcodebuild was successful
if [ $? -ne 0 ]; then
echo "xcodebuild failed to run tests"
exit 2
fi

# Process results
RESULT=$(xcrun xcresulttool get --format json --path build/ios/TestResults.xcresult)

# Check if xcresulttool was successful
if [ $? -ne 0 ]; then
echo "Failed to process test results"
exit 3
fi

# Extract test status
TEST_STATUS=$(echo $RESULT | jq -r '.issues.testFailureSummaries | length')

if [ "$TEST_STATUS" -eq "0" ]; then
echo "All tests passed"
EXIT_CODE=0
else
echo "Some tests failed. Details:"
echo $RESULT | jq '.issues.testFailureSummaries'
EXIT_CODE=1
fi

xcparse logs build/ios/TestResults.xcresult build/ios/TestResults
find build/ios -name StandardOutputAndStandardError.txt -exec cat {} +

exit $EXIT_CODE
2 changes: 2 additions & 0 deletions packages/streamr-eventemitter/test/unit/EventEmitterTest.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define GLOG_USE_GLOG_EXPORT

#include <chrono>
#include <cstddef>
#include <future>
Expand Down
Loading