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

Staging to main for 5.0.0 release #80

Merged
merged 21 commits into from
Mar 19, 2024
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
27 changes: 14 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: macos-13

steps:
- uses: actions/checkout@v2

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.0.1
- name: Install swiftformat
run: brew install swiftformat

Expand All @@ -42,15 +44,14 @@ jobs:
- name: Run tests
run: swift test -v --enable-code-coverage

- name: Download Codecov
run: |
curl -s https://codecov.io/bash > codecov;
VERSION=$(grep 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2);
for i in 1 256 512
do
shasum -a $i -c --ignore-missing <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM") ||
shasum -a $i -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION}/SHA${i}SUM" | grep -w "codecov")
done

- name: Prepare Code Coverage
run: make generate-lcov

- name: Upload Code Coverage
run: make generate-lcov; bash ./codecov
uses: codecov/codecov-action@v3
with:
files: info.lcov
verbose: true
name: aep-rules-engine
move_coverage_to_trash: true

9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ on:

jobs:
release_rules_engine:
runs-on: macos-latest
runs-on: macos-13
steps:
- uses: actions/checkout@v2
with:
ref: main
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 14.1
xcode-version: 15.0.1

- name: Install jq
run: brew install jq

- name: Install xcodegen
run: brew install xcodegen

- name: Check version in Podspec
run: |
Expand Down Expand Up @@ -52,7 +55,7 @@ jobs:
run: |
set -eo pipefail
gem install cocoapods
pod lib lint --allow-warnings --swift-version=5.1
pod lib lint --allow-warnings
pod trunk push AEPRulesEngine.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

6 changes: 3 additions & 3 deletions AEPRulesEngine.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AEPRulesEngine"
s.version = "4.0.0"
s.version = "5.0.0"
s.summary = "AEPRulesEngine"
s.description = <<-DESC
A simple, generic, extensible Rules Engine in Swift
Expand All @@ -12,8 +12,8 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.ios.deployment_target = '11.0'
s.tvos.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.tvos.deployment_target = '12.0'

s.pod_target_xcconfig = { 'BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }

Expand Down
7 changes: 2 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
// swift-tools-version:5.1
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.1 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarified this is 5.3 matching core


import PackageDescription

let package = Package(
name: "AEPRulesEngine",
platforms: [.iOS(.v12), .tvOS(.v12)],
products: [
.library(name: "AEPRulesEngine", targets: ["AEPRulesEngine"]),
cdhoffmann marked this conversation as resolved.
Show resolved Hide resolved
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
.target(name: "AEPRulesEngine", dependencies: []),
.testTarget(name: "AEPRulesEngineTests", dependencies: ["AEPRulesEngine"]),
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A simple, generic, extensible Rules Engine in Swift.

## Requirements
- Xcode 14.1 (or newer)
- Xcode 15 (or newer)
- Swift 5.1 (or newer)

## Installation
Expand Down Expand Up @@ -47,7 +47,7 @@ Alternatively, if your project has a `Package.swift` file, you can add AEPRulesE

```
dependencies: [
.package(url: "https://github.com/adobe/aepsdk-rulesengine-ios.git", .upToNextMajor(from: "4.0.0"))
.package(url: "https://github.com/adobe/aepsdk-rulesengine-ios.git", .upToNextMajor(from: "5.0.0"))
]
```

Expand Down
2 changes: 1 addition & 1 deletion Script/test-SPM.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let package = Package(
name: \"TestProject\",
defaultLocalization: \"en-US\",
platforms: [
.iOS(.v11), .tvOS(.v11)
.iOS(.v12), .tvOS(.v12)
],
products: [
.library(
Expand Down
56 changes: 44 additions & 12 deletions Script/test-podspec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,28 @@ mkdir -p $PROJECT_NAME && cd $PROJECT_NAME

# Create a new Xcode project.
swift package init
swift package generate-xcodeproj

# Use Xcodegen to generate the project.
echo "
name: $PROJECT_NAME
options:
bundleIdPrefix: $PROJECT_NAME
targets:
$PROJECT_NAME:
type: framework
sources: Sources
platform: iOS
deploymentTarget: "12.0"
settings:
GENERATE_INFOPLIST_FILE: YES
" >>project.yml

xcodegen generate

# Create a Podfile with our pod as dependency.
echo "
target '$PROJECT_NAME' do
platform :ios, '11.0'
platform :ios, '12.0'
use_frameworks!
pod 'AEPRulesEngine', :path => '../'
end
Expand All @@ -28,32 +44,48 @@ pod install

# Archive for generic iOS device
echo '############# Archive for generic iOS device ###############'
xcodebuild archive -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=iOS'
xcodebuild archive -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=iOS'

# Build for generic iOS device
echo '############# Build for generic iOS device ###############'
xcodebuild clean build -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=iOS'
xcodebuild clean build -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=iOS'

# Archive for x86_64 simulator
echo '############# Archive for simulator ###############'
xcodebuild archive -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=iOS Simulator'
xcodebuild archive -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=iOS Simulator'

# Build for x86_64 simulator
echo '############# Build for simulator ###############'
xcodebuild clean build -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=iOS Simulator'
xcodebuild clean build -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=iOS Simulator'

# tvOS
cd ../
rm -rf $PROJECT_NAME
mkdir -p $PROJECT_NAME && cd $PROJECT_NAME
# Create a new Xcode project.
swift package init
swift package generate-xcodeproj

# Use Xcodegen to generate the project.
echo "
name: $PROJECT_NAME
options:
bundleIdPrefix: $PROJECT_NAME
targets:
$PROJECT_NAME:
type: framework
sources: Sources
platform: tvOS
deploymentTarget: "12.0"
settings:
GENERATE_INFOPLIST_FILE: YES
" >>project.yml

xcodegen generate

# Create a Podfile with our pod as dependency.
echo "
target '$PROJECT_NAME' do
platform :tvos, '11.0'
platform :tvos, '12.0'
use_frameworks!
pod 'AEPRulesEngine', :path => '../'
end
Expand All @@ -63,19 +95,19 @@ end
pod install
# Archive for generic tvOS device
echo '############# Archive for generic tvOS device ###############'
xcodebuild archive -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS'
xcodebuild archive -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS'

# Build for generic tvOS device
echo '############# Build for generic tvOS device ###############'
xcodebuild build -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS'
xcodebuild build -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS'

# Archive for generic tvOS device
echo '############# Archive for generic tvOS device ###############'
xcodebuild archive -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS Simulator'
xcodebuild archive -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS Simulator'

# Build for generic tvOS simulator
echo '############# Build for x86_64 simulator ###############'
xcodebuild build -scheme TestProject-Package -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS Simulator'
xcodebuild build -scheme TestProject -workspace TestProject.xcworkspace -destination 'generic/platform=tvOS Simulator'

# Clean up.
cd ../
Expand Down
2 changes: 1 addition & 1 deletion Sources/AEPRulesEngine/RulesEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Foundation
public typealias RulesTracer = (Bool, Rule, Context, RulesFailure?) -> Void

public class RulesEngine<T: Rule> {
public let version = "4.0.0"
public let version = "5.0.0"
let evaluator: Evaluating
let transformer: Transforming
var tracer: RulesTracer?
Expand Down
Loading