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
63 changes: 63 additions & 0 deletions .github/workflows/spm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: SPM

on:
push:
branches: [ main ]
paths:
- 'Sources/**'
- 'Tests/**'
- 'UnitTesting/**'
- 'Package.swift'
- '.github/workflows/spm.yml'
- '!**/BUILD'
Comment thread
thomasvl marked this conversation as resolved.
pull_request:
branches: [ main ]
paths:
- 'Sources/**'
- 'Tests/**'
- 'UnitTesting/**'
- 'Package.swift'
- '.github/workflows/spm.yml'
- '!**/BUILD'
Comment thread
thomasvl marked this conversation as resolved.
schedule:
# Run the first and fifteenth of every month at 4:18 UTC
- cron: '18 4 1,18 * *'
# Also allow manual triggering from the github UX to revalidate things.
workflow_dispatch:

jobs:
spm:
runs-on: macos-15
strategy:
fail-fast: false
matrix:
MODE: ["Debug", "Release"]
steps:
- uses: actions/checkout@v4
- name: spm build
run: |
spm_mode=""
if [ "${{ matrix.MODE }}" == "Debug" ]; then
spm_mode="debug"
elif [ "${{ matrix.MODE }}" == "Release" ]; then
spm_mode="release"
else
echo "Invalid mode: ${{ matrix.MODE }}"
exit 1
fi
swift build -c $spm_mode
swift test -c $spm_mode
# Remove the xcodeproj so that we can build SPM with xcodebuild.
rm -rf *.xcodeproj
# For iOS and tvOS, tests are skipped for now because
# setting up a Host Application in SPM is much more complex.
xcodebuild \
-scheme GoogleToolboxForMac-Package \
-destination 'generic/platform=iOS' \
-configuration ${{ matrix.MODE }} \
build
xcodebuild \
-scheme GoogleToolboxForMac-Package \
-destination 'generic/platform=tvOS' \
-configuration ${{ matrix.MODE }} \
build
3 changes: 2 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ load("@build_bazel_rules_apple//apple:macos.bzl", "macos_build_test")

objc_library(
name = "Defines",
hdrs = ["GTMDefines.h"],
hdrs = ["Sources/Defines/Public/GTMDefines.h"],
includes = ["Sources/Defines/Public"],
visibility = ["//visibility:public"],
)

Expand Down
2 changes: 1 addition & 1 deletion GTM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
8B158A6010A8BE4500C93125 /* GTMNSAnimation+Duration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GTMNSAnimation+Duration.m"; sourceTree = "<group>"; };
8B17FD18117638F400E7A908 /* GTMAppKitUnitTestingUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMAppKitUnitTestingUtilities.m; sourceTree = "<group>"; };
8B17FD19117638F400E7A908 /* GTMAppKitUnitTestingUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMAppKitUnitTestingUtilities.h; sourceTree = "<group>"; };
8B1A16050D90344B00CA1E8E /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
8B1A16050D90344B00CA1E8E /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = Sources/Defines/Public/GTMDefines.h; sourceTree = SOURCE_ROOT; };
8B21DE54117E5CB7000E004F /* GTMLocalizedString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMLocalizedString.h; path = Sources/LocalizedString/Public/Foundation/GTMLocalizedString.h; sourceTree = SOURCE_ROOT; };
8B29078411F8D1BF0064F50F /* GTMNSFileHandle+UniqueName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "GTMNSFileHandle+UniqueName.h"; path = "Sources/NSFileHandle_UniqueName/Public/Foundation/GTMNSFileHandle+UniqueName.h"; sourceTree = SOURCE_ROOT; };
8B29078511F8D1BF0064F50F /* GTMNSFileHandle+UniqueName.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "GTMNSFileHandle+UniqueName.m"; path = "Sources/NSFileHandle_UniqueName/GTMNSFileHandle+UniqueName.m"; sourceTree = SOURCE_ROOT; };
Expand Down
2 changes: 1 addition & 1 deletion GTMiPhone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
8B82CF561D9C24D9007182AA /* iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = "<group>"; };
8B82CF571D9C24D9007182AA /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
8B82CF581D9C24D9007182AA /* Unittest.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Unittest.xcconfig; sourceTree = "<group>"; };
8BC047750DAE926E00C2D1CA /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
8BC047750DAE926E00C2D1CA /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = Sources/Defines/Public/GTMDefines.h; sourceTree = SOURCE_ROOT; };
8BC0477E0DAE928A00C2D1CA /* GTMNSData+zlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "GTMNSData+zlib.h"; path = "Sources/NSData_zlib/Public/Foundation/GTMNSData+zlib.h"; sourceTree = SOURCE_ROOT; };
8BC0477F0DAE928A00C2D1CA /* GTMNSData+zlib.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "GTMNSData+zlib.m"; path = "Sources/NSData_zlib/GTMNSData+zlib.m"; sourceTree = SOURCE_ROOT; };
8BC047800DAE928A00C2D1CA /* GTMNSData+zlibTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "GTMNSData+zlibTest.m"; path = "Tests/NSData_zlibTests/GTMNSData+zlibTest.m"; sourceTree = SOURCE_ROOT; };
Expand Down
4 changes: 2 additions & 2 deletions GoogleToolboxForMac.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Pod::Spec.new do |s|
'NSString+XML', 'NSThread+Blocks'

s.subspec 'Defines' do |sp|
sp.public_header_files = 'GTMDefines.h'
sp.source_files = 'GTMDefines.h'
sp.public_header_files = 'Sources/Defines/Public/GTMDefines.h'
sp.source_files = 'Sources/Defines/Public/GTMDefines.h'
sp.resource_bundle = {
"GoogleToolboxForMac_Privacy" => "Resources/Base/PrivacyInfo.xcprivacy"
}
Expand Down
106 changes: 106 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// swift-tools-version:6.0
import PackageDescription

let package = Package(
name: "GoogleToolboxForMac",
platforms: [
.iOS(.v13),
.macOS(.v10_15),
.tvOS(.v13),
],
products: [
.library(
name: "GTMLogger",
targets: ["GTMLogger"]
),
.library(
name: "GTMNSData_zlib",
targets: ["GTMNSData_zlib"]
),
.library(
name: "GTMStringEncoding",
targets: ["GTMStringEncoding"]
),
],
targets: [
.target(
name: "GTMDefines",
path: "Sources/Defines",
publicHeadersPath: "Public"
),
.target(
name: "GTMLogger",
dependencies: [
"GTMDefines"
],
path: "Sources/Logger",
exclude: [
"BUILD",
"GTMLogger+ASL.m",
"GTMLoggerRingBufferWriter.m",
],
publicHeadersPath: "Public/Foundation"
),
.target(
name: "GTMNSData_zlib",
dependencies: [
"GTMDefines"
],
path: "Sources/NSData_zlib",
exclude: [
"BUILD"
],
publicHeadersPath: "Public/Foundation",
linkerSettings: [
.linkedLibrary("z")
]
),
.target(
name: "GTMStringEncoding",
dependencies: [
"GTMDefines"
],
path: "Sources/StringEncoding",
exclude: [
"BUILD"
],
publicHeadersPath: "Public/Foundation"
),
.target(
name: "SenTestCase",
dependencies: [
"GTMDefines"
],
path: "UnitTesting/SenTestCase",
exclude: [
"GTMSenTestCaseTest.m"
],
),
.testTarget(
name: "GTMLoggerTests",
dependencies: ["GTMLogger", "SenTestCase"],
path: "Tests/LoggerTests",
exclude: [
"BUILD",
"GTMLogger+ASLTest.m",
"GTMLoggerRingBufferWriterTest.m",
]
),
.testTarget(
name: "NSData_zlibTests",
dependencies: ["GTMNSData_zlib", "SenTestCase"],
path: "Tests/NSData_zlibTests",
exclude: [
"BUILD"
]
),
.testTarget(
name: "StringEncodingTests",
dependencies: ["GTMStringEncoding", "SenTestCase"],
path: "Tests/StringEncodingTests",
exclude: [
"BUILD"
]
),
]
)
File renamed without changes.