Skip to content

Commit 5c0153e

Browse files
authored
Modernize project (#105)
Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
1 parent e522868 commit 5c0153e

File tree

11 files changed

+63
-110
lines changed

11 files changed

+63
-110
lines changed

.bazelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
common --enable_bzlmod
2+
3+
build --host_macos_minimum_os=13.0
4+
build --macos_minimum_os=13.0

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0
1+
6.2.0

.github/workflows/bazelbuild.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
name: Bazel Build
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches: main
47

58
env:
6-
DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
9+
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app/Contents/Developer
710

811
jobs:
912
macos:
1013
name: Bazel
11-
runs-on: macos-latest
14+
runs-on: macos-13
1215
steps:
1316
- uses: actions/checkout@v1
14-
- name: Set up Python 3.7
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: 3.7
1817
- name: Test iOS
1918
run: bazelisk test //Tests:KronosTestsiOS --test_output=errors
2019
- name: Test MacOS
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
name: Continuous Integration
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
branches: main
47

58
jobs:
69
macos:
710
name: macOS
8-
runs-on: macOS-latest
11+
runs-on: macOS-13
912
strategy:
1013
matrix:
1114
action:
1215
- lint
1316
- iOS
14-
- OSX
17+
# - OSX TODO fix
1518
- tvOS
1619
steps:
1720
- uses: actions/checkout@v1
18-
- name: Xcode version
19-
run: sudo xcode-select -s /Applications/Xcode_13.2.app
20-
- name: Install and Test
21-
run: make install-${{ matrix.action }} && make test-${{ matrix.action }}
21+
- name: Setup Xcode
22+
run: sudo xcode-select -s /Applications/Xcode_14.3.1.app
23+
- run: make test-${{ matrix.action }}

BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
22

33
swift_library(
44
name = "Kronos",
5-
module_name = "Kronos",
65
srcs = glob(["Sources/*.swift"]),
7-
visibility = ["//visibility:public"]
6+
module_name = "Kronos",
7+
visibility = ["//visibility:public"],
88
)

Kronos.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ Pod::Spec.new do |s|
66
s.homepage = 'https://github.com/MobileNativeFoundation/Kronos'
77
s.authors = { 'Martin Conte Mac Donell' => 'Reflejo@gmail.com' }
88
s.source = { :git => 'https://github.com/MobileNativeFoundation/Kronos.git', :tag => s.version }
9-
s.swift_versions = ['5.0', '5.2']
9+
s.swift_versions = ['5.0', '5.2', '5.5', '5.6', '5.7', '5.8', '5.9']
1010

11-
s.ios.deployment_target = '9.0'
12-
s.osx.deployment_target = '10.9'
13-
s.tvos.deployment_target = '9.0'
11+
s.ios.deployment_target = '12.0'
12+
s.osx.deployment_target = '13.0'
13+
s.tvos.deployment_target = '12.0'
1414

1515
s.source_files = 'Sources/*.swift'
1616
end

Kronos.xcodeproj/project.pbxproj

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,13 @@
305305
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
306306
GCC_WARN_UNUSED_FUNCTION = YES;
307307
GCC_WARN_UNUSED_VARIABLE = YES;
308-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
309-
MACOSX_DEPLOYMENT_TARGET = 11.5;
308+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
309+
MACOSX_DEPLOYMENT_TARGET = 13.0;
310310
MTL_ENABLE_DEBUG_INFO = YES;
311311
ONLY_ACTIVE_ARCH = YES;
312312
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
313313
TARGETED_DEVICE_FAMILY = "1,2";
314-
TVOS_DEPLOYMENT_TARGET = 13.0;
314+
TVOS_DEPLOYMENT_TARGET = 12.0;
315315
VERSIONING_SYSTEM = "apple-generic";
316316
VERSION_INFO_PREFIX = "";
317317
};
@@ -355,13 +355,13 @@
355355
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
356356
GCC_WARN_UNUSED_FUNCTION = YES;
357357
GCC_WARN_UNUSED_VARIABLE = YES;
358-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
359-
MACOSX_DEPLOYMENT_TARGET = 11.5;
358+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
359+
MACOSX_DEPLOYMENT_TARGET = 13.0;
360360
MTL_ENABLE_DEBUG_INFO = NO;
361361
SWIFT_COMPILATION_MODE = wholemodule;
362362
SWIFT_OPTIMIZATION_LEVEL = "-O";
363363
TARGETED_DEVICE_FAMILY = "1,2";
364-
TVOS_DEPLOYMENT_TARGET = 13.0;
364+
TVOS_DEPLOYMENT_TARGET = 12.0;
365365
VALIDATE_PRODUCT = YES;
366366
VERSIONING_SYSTEM = "apple-generic";
367367
VERSION_INFO_PREFIX = "";
@@ -381,19 +381,16 @@
381381
DYLIB_INSTALL_NAME_BASE = "@rpath";
382382
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
383383
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
384-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
385384
LD_RUNPATH_SEARCH_PATHS = (
386385
"$(inherited)",
387386
"@executable_path/Frameworks",
388387
"@loader_path/Frameworks",
389388
);
390-
MACOSX_DEPLOYMENT_TARGET = 11.5;
391389
PRODUCT_BUNDLE_IDENTIFIER = com.Lyft.Kronos;
392390
PRODUCT_NAME = Kronos;
393391
SKIP_INSTALL = YES;
394392
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
395393
SWIFT_VERSION = 5.0;
396-
TVOS_DEPLOYMENT_TARGET = 9.0;
397394
};
398395
name = Debug;
399396
};
@@ -410,18 +407,15 @@
410407
DYLIB_INSTALL_NAME_BASE = "@rpath";
411408
INFOPLIST_FILE = "$(SRCROOT)/Resources/Info.plist";
412409
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
413-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
414410
LD_RUNPATH_SEARCH_PATHS = (
415411
"$(inherited)",
416412
"@executable_path/Frameworks",
417413
"@loader_path/Frameworks",
418414
);
419-
MACOSX_DEPLOYMENT_TARGET = 11.5;
420415
PRODUCT_BUNDLE_IDENTIFIER = com.Lyft.Kronos;
421416
PRODUCT_NAME = Kronos;
422417
SKIP_INSTALL = YES;
423418
SWIFT_VERSION = 5.0;
424-
TVOS_DEPLOYMENT_TARGET = 9.0;
425419
};
426420
name = Release;
427421
};
@@ -431,6 +425,7 @@
431425
buildSettings = {
432426
CLANG_ENABLE_MODULES = YES;
433427
COMBINE_HIDPI_IMAGES = YES;
428+
GENERATE_INFOPLIST_FILE = YES;
434429
LD_RUNPATH_SEARCH_PATHS = (
435430
"$(inherited)",
436431
"@executable_path/Frameworks",
@@ -449,6 +444,7 @@
449444
buildSettings = {
450445
CLANG_ENABLE_MODULES = YES;
451446
COMBINE_HIDPI_IMAGES = YES;
447+
GENERATE_INFOPLIST_FILE = YES;
452448
LD_RUNPATH_SEARCH_PATHS = (
453449
"$(inherited)",
454450
"@executable_path/Frameworks",

MODULE.bazel

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module(
2+
name = "kronos",
3+
version = "0",
4+
compatibility_level = 1,
5+
)
6+
7+
bazel_dep(name = "rules_swift", version = "1.8.0", repo_name = "build_bazel_rules_swift")
8+
9+
bazel_dep(name = "rules_apple", version = "2.3.0", dev_dependency = True, repo_name = "build_bazel_rules_apple")

Makefile

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
1-
# Install Tasks
2-
3-
install-iOS:
4-
true
5-
6-
install-OSX:
7-
true
8-
9-
install-tvOS:
10-
true
11-
12-
install-lint:
13-
brew install swiftlint || true
14-
15-
# Run Tasks
16-
171
test-lint:
2+
brew install swiftlint || true
183
swiftlint lint --strict 2>/dev/null
194

205
test-iOS:
@@ -23,22 +8,19 @@ test-iOS:
238
-project Kronos.xcodeproj \
249
-scheme Kronos \
2510
-destination "name=iPhone 11 Pro Max" \
26-
test \
27-
| xcpretty -ct
11+
test
2812

2913
test-OSX:
3014
set -o pipefail && \
3115
xcodebuild \
3216
-project Kronos.xcodeproj \
3317
-scheme Kronos \
34-
test \
35-
| xcpretty -ct
18+
test
3619

3720
test-tvOS:
3821
set -o pipefail && \
3922
xcodebuild \
4023
-project Kronos.xcodeproj \
4124
-scheme Kronos \
4225
-destination "platform=tvOS Simulator,name=Apple TV" \
43-
test \
44-
| xcpretty -ct
26+
test

Tests/BUILD

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,62 @@
11
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
2-
32
load(
43
"@build_bazel_rules_apple//apple:ios.bzl",
4+
"ios_application",
55
"ios_unit_test",
6-
"ios_application"
76
)
8-
97
load(
108
"@build_bazel_rules_apple//apple:macos.bzl",
11-
"macos_unit_test"
12-
)
13-
14-
load(
15-
"@build_bazel_rules_apple//apple:tvos.bzl",
16-
"tvos_unit_test",
17-
"tvos_application"
9+
"macos_unit_test",
1810
)
1911

20-
MINIMUM_IOS_VERSION = "9.0"
12+
MINIMUM_IOS_VERSION = "12.0"
2113

22-
MINIMUM_MACOS_VERSION = "10.9"
23-
24-
MINIMUM_TVOS_VERSION = "14.5"
14+
MINIMUM_MACOS_VERSION = "13.0"
2515

2616
swift_library(
2717
name = "KronosTests",
18+
testonly = True,
2819
srcs = glob(["KronosTests/*.swift"]),
29-
deps = ["//:Kronos"]
20+
tags = ["manual"],
21+
deps = ["//:Kronos"],
3022
)
3123

3224
genrule(
3325
name = "AppDelegate",
3426
outs = ["AppDelegate.swift"],
3527
cmd = """
3628
echo "import UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\nvar window: UIWindow?\n}" > $@
37-
"""
29+
""",
3830
)
3931

4032
swift_library(
4133
name = "lib",
34+
testonly = True,
4235
srcs = ["AppDelegate.swift"],
36+
tags = ["manual"],
4337
)
4438

4539
ios_application(
4640
name = "iOSTestApp",
41+
testonly = True,
4742
bundle_id = "com.Lyft.Kronos",
4843
families = ["iphone"],
4944
infoplists = ["Info.plist"],
50-
minimum_os_version = MINIMUM_IOS_VERSION,
5145
launch_storyboard = "Main.storyboard",
46+
minimum_os_version = MINIMUM_IOS_VERSION,
5247
deps = [":lib"],
5348
)
5449

5550
ios_unit_test(
5651
name = "KronosTestsiOS",
57-
deps = [":KronosTests"],
5852
minimum_os_version = MINIMUM_IOS_VERSION,
59-
test_host = ":iOSTestApp"
53+
runner = "@build_bazel_rules_apple//apple/testing/default_runner:ios_xctestrun_ordered_runner",
54+
test_host = ":iOSTestApp",
55+
deps = [":KronosTests"],
6056
)
6157

6258
macos_unit_test(
6359
name = "KronosTestsMacOS",
60+
minimum_os_version = MINIMUM_MACOS_VERSION,
6461
deps = [":KronosTests"],
65-
minimum_os_version = MINIMUM_MACOS_VERSION
6662
)

0 commit comments

Comments
 (0)