Skip to content

Commit

Permalink
-updates for rules engine changes (#494)
Browse files Browse the repository at this point in the history
* -updates for rules engine changes

* -revert Package.resolved
  • Loading branch information
sbenedicadb authored Jan 7, 2021
1 parent 7cd24c4 commit f78bf6b
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 21 deletions.
20 changes: 14 additions & 6 deletions AEPCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
24543A1424E1DAFC002D8D9A /* MockURLService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24543A1324E1DAFC002D8D9A /* MockURLService.swift */; };
24543A1524E1DC8E002D8D9A /* MockDiskCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2467E43B24CB54B70022F6BE /* MockDiskCache.swift */; };
24543A1624E1DC95002D8D9A /* MockUnzipper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2467E43C24CB54B70022F6BE /* MockUnzipper.swift */; };
2462374025A78D4100056EB9 /* AEPRulesEngine in Frameworks */ = {isa = PBXBuildFile; productRef = 2462373F25A78D4100056EB9 /* AEPRulesEngine */; };
2467E43A24CA4DE20022F6BE /* Unzipping.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2467E43924CA4DE20022F6BE /* Unzipping.swift */; };
247FBD7D24E331A600FA6505 /* Event+SignalTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 247FBD7C24E331A600FA6505 /* Event+SignalTests.swift */; };
249498E2254A0C920045E392 /* Date+FormatTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 249498E0254A0C910045E392 /* Date+FormatTests.swift */; };
Expand Down Expand Up @@ -151,7 +152,6 @@
3F16762824F031A00041B970 /* EventHubContractTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F16762724F031A00041B970 /* EventHubContractTests.swift */; };
3F16762A24F032C60041B970 /* ContractExtensionOne.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F16762924F032C60041B970 /* ContractExtensionOne.swift */; };
3F16762C24F032E60041B970 /* ContractExtensionTwo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F16762B24F032E60041B970 /* ContractExtensionTwo.swift */; };
3F1D71DD253DF0E900A11D84 /* AEPRulesEngine in Frameworks */ = {isa = PBXBuildFile; productRef = 3F1D71DC253DF0E900A11D84 /* AEPRulesEngine */; };
3F2F12BB24F6D07E00600CB4 /* AEPIdentity.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FE6DE2F24C642330065EA05 /* AEPIdentity.framework */; };
3F2F12BC24F6D07E00600CB4 /* AEPLifecycle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3FE6DDD124C62EE60065EA05 /* AEPLifecycle.framework */; };
3F2F12BD24F6D07E00600CB4 /* AEPServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F03978724BE5DD30019F095 /* AEPServices.framework */; };
Expand Down Expand Up @@ -878,7 +878,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3F1D71DD253DF0E900A11D84 /* AEPRulesEngine in Frameworks */,
2462374025A78D4100056EB9 /* AEPRulesEngine in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1788,7 +1788,7 @@
);
name = AEPCore;
packageProductDependencies = (
3F1D71DC253DF0E900A11D84 /* AEPRulesEngine */,
2462373F25A78D4100056EB9 /* AEPRulesEngine */,
);
productName = AEPCore;
productReference = 21CAC0D62422917600C11388 /* AEPCore.framework */;
Expand Down Expand Up @@ -2111,7 +2111,7 @@
);
mainGroup = 21CAC0CC2422917600C11388;
packageReferences = (
3F1D71DB253DF0E900A11D84 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */,
2462373E25A78D4100056EB9 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */,
);
productRefGroup = 21CAC0D72422917600C11388 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -3810,6 +3810,14 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
2462373E25A78D4100056EB9 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/adobe/aepsdk-rulesengine-ios.git";
requirement = {
branch = main;
kind = branch;
};
};
3F1D71DB253DF0E900A11D84 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/adobe/aepsdk-rulesengine-ios.git";
Expand All @@ -3821,9 +3829,9 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
3F1D71DC253DF0E900A11D84 /* AEPRulesEngine */ = {
2462373F25A78D4100056EB9 /* AEPRulesEngine */ = {
isa = XCSwiftPackageProductDependency;
package = 3F1D71DB253DF0E900A11D84 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */;
package = 2462373E25A78D4100056EB9 /* XCRemoteSwiftPackageReference "aepsdk-rulesengine-ios" */;
productName = AEPRulesEngine;
};
3F1D71EC253DF0FC00A11D84 /* AEPRulesEngine */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"repositoryURL": "https://github.com/adobe/aepsdk-rulesengine-ios.git",
"state": {
"branch": "main",
"revision": "7f2b7ec53048212d3507bcd15b4aa6262143758f",
"revision": "4b08e1ee31a8c03145427a6afd4a2c23810efd37",
"version": null
}
}
Expand Down
12 changes: 6 additions & 6 deletions AEPCore/Sources/rules/LaunchRuleTransformer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import Foundation
class LaunchRuleTransformer {

static func createTransforming() -> Transforming {
let transform = Transform()
addConsequnceTransform(to: transform)
addTypeTransform(to: transform)
return transform
let transformer = Transformer()
addConsequnceTransform(to: transformer)
addTypeTransform(to: transformer)
return transformer
}

private static func addConsequnceTransform(to transform: Transform) {
private static func addConsequnceTransform(to transform: Transformer) {
transform.register(name: RulesConstants.Transform.URL_ENCODING_FUNCTION_IN_RULES, transformation: { value in
if let valueString = value as? String {
return URLEncoder.encode(value: valueString)
Expand All @@ -33,7 +33,7 @@ class LaunchRuleTransformer {
})
}

private static func addTypeTransform(to transform: Transform) {
private static func addTypeTransform(to transform: Transformer) {
transform.register(name: RulesConstants.Transform.TRANSFORM_TO_INT, transformation: { value in
switch value {
case is String:
Expand Down
12 changes: 6 additions & 6 deletions AEPCore/Sources/rules/RulesEngineNativeLogging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import AEPServices
import Foundation
@_implementationOnly import AEPRulesEngine

class RulesEngineNativeLogging: RulesEngineLogging {
/// Converts `RulesEngineLogLevel` to Core `LogLevel`
/// - Parameter logLevel: a `RulesEngineLogLevel` object
/// - Returns: a `LogLevel` object
private func convert(_ logLevel: RulesEngineLogLevel) -> LogLevel {
class RulesEngineNativeLogging: AEPRulesEngine.Logging {
/// Converts RulesEngine `LogLevel` to Core `LogLevel`
/// - Parameter logLevel: a RulesEngine `LogLevel` object
/// - Returns: a Core `LogLevel` object
private func convert(_ logLevel: AEPRulesEngine.LogLevel) -> AEPServices.LogLevel {
switch logLevel {
case .error:
return .error
Expand All @@ -31,7 +31,7 @@ class RulesEngineNativeLogging: RulesEngineLogging {
}
}

func log(level: RulesEngineLogLevel, label: String, message: String) {
func log(level: AEPRulesEngine.LogLevel, label: String, message: String) {
if Log.logFilter >= convert(level) {
ServiceProvider.shared.loggingService.log(level: convert(level), label: label, message: message)
}
Expand Down
2 changes: 1 addition & 1 deletion AEPCore/Tests/RulesTests/JSONRulesParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class JSONRulesParserTests: XCTestCase {
XCTAssertTrue(levelThreeGroupAnd.operands[0] is ComparisonExpression<String, String>)
let levelFourMatcherEQ = levelThreeGroupAnd.operands[0] as! ComparisonExpression<String, String>
XCTAssertEqual("equals", levelFourMatcherEQ.operationName)
XCTAssertEqual("<Value:com.adobe.eventType.lifecycle>", levelFourMatcherEQ.rhs.description)
XCTAssertEqual("<Value: com.adobe.eventType.lifecycle>", levelFourMatcherEQ.rhs.description)
}

func testGenerateLaunchRulesEmpty() {
Expand Down
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"package": "AEPRulesEngine",
"repositoryURL": "https://github.com/adobe/aepsdk-rulesengine-ios.git",
"state": {
"branch": "dev",
"branch": "main",
"revision": "0feb3174c8f835ecd2f79889d060ba088d9022aa",
"version": null
}
Expand Down

0 comments on commit f78bf6b

Please sign in to comment.