From 09d1532fbb3c2044cb649fec47408ae473bcdf99 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Wed, 20 Jan 2021 10:58:34 -0800 Subject: [PATCH] Initial Build and CI --- .github/workflows/spm.yml | 19 ++++++++++++ GoogleAppMeasurementWrapper/dummy.m | 17 +++++++++++ GoogleAppMeasurementWrapper/include/dummy.h | 18 ++++++++++++ Package.swift | 32 ++++++++------------- 4 files changed, 66 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/spm.yml create mode 100644 GoogleAppMeasurementWrapper/dummy.m create mode 100644 GoogleAppMeasurementWrapper/include/dummy.h diff --git a/.github/workflows/spm.yml b/.github/workflows/spm.yml new file mode 100644 index 0000000..88c5f82 --- /dev/null +++ b/.github/workflows/spm.yml @@ -0,0 +1,19 @@ +name: spm + +on: + pull_request: + schedule: + # Run every day at 11pm (PST) - cron uses UTC times + - cron: '0 7 * * *' + +jobs: + swift-build-run: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Scripts Directory + run: ./setup-scripts.sh + - name: Initialize xcodebuild + run: xcodebuild -list + - name: Verify build + run: xcodebuild -sdk 'iphonesimulator' -destination 'platform=iOS Simulator,name=iPhone 11' -scheme GoogleAppMeasurement diff --git a/GoogleAppMeasurementWrapper/dummy.m b/GoogleAppMeasurementWrapper/dummy.m new file mode 100644 index 0000000..f340cb7 --- /dev/null +++ b/GoogleAppMeasurementWrapper/dummy.m @@ -0,0 +1,17 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Swift Package Manager needs at least one source file. diff --git a/GoogleAppMeasurementWrapper/include/dummy.h b/GoogleAppMeasurementWrapper/include/dummy.h new file mode 100644 index 0000000..4fe40eb --- /dev/null +++ b/GoogleAppMeasurementWrapper/include/dummy.h @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Swift Package Manager needs at least one header to prevent a warning. See +// https://github.com/firebase/firebase-ios-sdk/pull/6504. diff --git a/Package.swift b/Package.swift index 7b0f526..f70a8be 100644 --- a/Package.swift +++ b/Package.swift @@ -1,7 +1,7 @@ // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ import PackageDescription -let firebaseVersion = "7.3.1" - let package = Package( name: "GoogleAppMeasurement", platforms: [.iOS(.v10)], @@ -34,26 +32,21 @@ let package = Package( url: "https://github.com/google/GoogleUtilities.git", "7.2.0" ..< "8.0.0" ), + .package( + name: "nanopb", + url: "https://github.com/firebase/nanopb.git", + "2.30907.0" ..< "2.30908.0" + ), ], targets: [ .target( name: "GoogleAppMeasurementTarget", dependencies: [ - .target(name: "GoogleAppMeasurementWrapper - ], - path: "SwiftPM-PlatformExclude/GoogleAppMeasurementWrap" - ), - - .target( - name: "GoogleAppMeasurement", - dependencies: [ - .target(name: "GoogleAppMeasurementBinary", condition: .when(platforms: [.iOS])), - "FirebaseCore", - "FirebaseInstallations", - "GoogleUtilities_AppDelegateSwizzler", - "GoogleUtilities_MethodSwizzler", - "GoogleUtilities_NSData", - "GoogleUtilities_Network", + "GoogleAppMeasurement", + .product(name: "AppDelegateSwizzler", package: "GoogleUtilities"), + .product(name: "MethodSwizzler", package: "GoogleUtilities"), + .product(name: "NSData", package: "GoogleUtilities"), + .product(name: "Network", package: "GoogleUtilities"), .product(name: "nanopb", package: "nanopb"), ], path: "GoogleAppMeasurementWrapper", @@ -65,11 +58,10 @@ let package = Package( ] ), .binaryTarget( - name: "GoogleAppMeasurementBinary", + name: "GoogleAppMeasurement", url: "https://dl.google.com/firebase/ios/swiftpm/7.4.0/GoogleAppMeasurement.zip", checksum: "5c4e13589e8b5c357309dd8e5f57d81ab3e3ee5a731b034c4703e700d60d667a" ), - ], cLanguageStandard: .c99, cxxLanguageStandard: CXXLanguageStandard.gnucxx14