Skip to content

Commit

Permalink
Only first number in target is illegal character
Browse files Browse the repository at this point in the history
  • Loading branch information
Vermeer, Edwin authored and Vermeer, Edwin committed Dec 13, 2017
1 parent 66f0d97 commit d00c72f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
16 changes: 8 additions & 8 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
1A8B0F00D6903A046FE40BCE /* Pods-Demo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Demo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Demo/Pods-Demo.debug.xcconfig"; sourceTree = "<group>"; };
306F6BF61D22BCEB00F727A6 /* Repository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Repository.swift; sourceTree = "<group>"; };
306F6BF81D22BCF400F727A6 /* Owner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Owner.swift; sourceTree = "<group>"; };
5EC197E01A1BB16D00F4DFD4 /* 4Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 4Demo.app; sourceTree = BUILT_PRODUCTS_DIR; };
5EC197E01A1BB16D00F4DFD4 /* 44Demo5.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 44Demo5.app; sourceTree = BUILT_PRODUCTS_DIR; };
5EC197E41A1BB16D00F4DFD4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
5EC197E51A1BB16D00F4DFD4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
5EC197E71A1BB16D00F4DFD4 /* MoyaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoyaViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -98,7 +98,7 @@
5EC197E11A1BB16D00F4DFD4 /* Products */ = {
isa = PBXGroup;
children = (
5EC197E01A1BB16D00F4DFD4 /* 4Demo.app */,
5EC197E01A1BB16D00F4DFD4 /* 44Demo5.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -154,9 +154,9 @@
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
5EC197DF1A1BB16D00F4DFD4 /* 4Demo */ = {
5EC197DF1A1BB16D00F4DFD4 /* 44Demo5 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5EC198011A1BB16D00F4DFD4 /* Build configuration list for PBXNativeTarget "4Demo" */;
buildConfigurationList = 5EC198011A1BB16D00F4DFD4 /* Build configuration list for PBXNativeTarget "44Demo5" */;
buildPhases = (
9B2248C62406490041BDC8AD /* [CP] Check Pods Manifest.lock */,
5EC197DC1A1BB16D00F4DFD4 /* Sources */,
Expand All @@ -169,9 +169,9 @@
);
dependencies = (
);
name = 4Demo;
name = 44Demo5;
productName = Demo;
productReference = 5EC197E01A1BB16D00F4DFD4 /* 4Demo.app */;
productReference = 5EC197E01A1BB16D00F4DFD4 /* 44Demo5.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
Expand Down Expand Up @@ -205,7 +205,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
5EC197DF1A1BB16D00F4DFD4 /* 4Demo */,
5EC197DF1A1BB16D00F4DFD4 /* 44Demo5 */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -472,7 +472,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5EC198011A1BB16D00F4DFD4 /* Build configuration list for PBXNativeTarget "4Demo" */ = {
5EC198011A1BB16D00F4DFD4 /* Build configuration list for PBXNativeTarget "44Demo5" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5EC198031A1BB16D00F4DFD4 /* Release */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5EC197DF1A1BB16D00F4DFD4"
BuildableName = "4Demo.app"
BlueprintName = "4Demo"
BuildableName = "44Demo5.app"
BlueprintName = "44Demo5"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -34,8 +34,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5EC197DF1A1BB16D00F4DFD4"
BuildableName = "4Demo.app"
BlueprintName = "4Demo"
BuildableName = "44Demo5.app"
BlueprintName = "44Demo5"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand All @@ -58,8 +58,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5EC197DF1A1BB16D00F4DFD4"
BuildableName = "4Demo.app"
BlueprintName = "4Demo"
BuildableName = "44Demo5.app"
BlueprintName = "44Demo5"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -77,8 +77,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5EC197DF1A1BB16D00F4DFD4"
BuildableName = "4Demo.app"
BlueprintName = "4Demo"
BuildableName = "44Demo5.app"
BlueprintName = "44Demo5"
ReferencedContainer = "container:Demo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
2 changes: 1 addition & 1 deletion EVReflection.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "EVReflection"
s.version = "5.3.0"
s.version = "5.3.1"
s.summary = "Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift"

s.description = <<-EOS
Expand Down
Binary file not shown.
7 changes: 6 additions & 1 deletion Source/EVReflection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,11 @@ final public class EVReflection {
appName = appName.characters.split(whereSeparator: {$0 == "."}).map({ String($0) }).last ?? ""
}

// First character may not be a number
if appName.prefix(1) >= "0" && appName.prefix(1) <= "9" {
appName = "_" + String(appName.characters.dropFirst())
}

// Clean up special characters
return appName.components(separatedBy: illegalCharacterSet).joined(separator: "_")
}
Expand Down Expand Up @@ -1089,7 +1094,7 @@ final public class EVReflection {
}

/// Character that will be replaced by _ from the keys in a dictionary / json
fileprivate static let illegalCharacterSet = CharacterSet(charactersIn: " -&%#@!$^*()<>?.,:;1234567890")
fileprivate static let illegalCharacterSet = CharacterSet(charactersIn: " -&%#@!$^*()<>?.,:;")
/// processIllegalCharacters Cache
fileprivate static var processIllegalCharactersCache = NSCache<NSString, NSString>()

Expand Down

0 comments on commit d00c72f

Please sign in to comment.