Skip to content

Commit

Permalink
Merge pull request #6 from Igor-Palaguta/ArgumentParser
Browse files Browse the repository at this point in the history
Argument parser
  • Loading branch information
Igor-Palaguta authored Apr 13, 2020
2 parents aef147b + 7f8bf2c commit 9a15413
Show file tree
Hide file tree
Showing 21 changed files with 418 additions and 394 deletions.
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# file options
--exclude Tests/MotoSwiftFrameworkTests/Generated,.build,.git,.swiftpm
--exclude Tests/MotoSwiftFrameworkTests/Generated,SampleOutput,.build,.git,.swiftpm

# format options
--indent 4
Expand Down
18 changes: 9 additions & 9 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
{
"object": {
"pins": [
{
"package": "Commander",
"repositoryURL": "https://github.com/kylef/Commander.git",
"state": {
"branch": null,
"revision": "e5b50ad7b2e91eeb828393e89b03577b16be7db9",
"version": "0.8.0"
}
},
{
"package": "PathKit",
"repositoryURL": "https://github.com/kylef/PathKit.git",
Expand Down Expand Up @@ -46,6 +37,15 @@
"version": "2.7.2"
}
},
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "8d31a0905c346a45c87773ad50862b5b3df8dff6",
"version": "0.0.4"
}
},
{
"package": "SWXMLHash",
"repositoryURL": "https://github.com/drmohundro/SWXMLHash.git",
Expand Down
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/SwiftGen/StencilSwiftKit.git", from: "2.7.0"),
.package(url: "https://github.com/kylef/Commander.git", from: "0.8.0"),
.package(url: "https://github.com/drmohundro/SWXMLHash.git", from: "4.7.0"),
.package(url: "https://github.com/kylef/Spectre", from: "0.8.0")
.package(url: "https://github.com/kylef/Spectre", from: "0.8.0"),
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.0.1"))
],
targets: [
.target(name: "MotoSwiftFramework", dependencies: ["StencilSwiftKit", "SWXMLHash"]),
.target(name: "motoswift", dependencies: ["MotoSwiftFramework", "Commander"]),
.target(name: "motoswift", dependencies: ["MotoSwiftFramework", "ArgumentParser"]),
.testTarget(
name: "MotoSwiftFrameworkTests",
dependencies: ["MotoSwiftFramework", "Spectre"]
Expand Down
90 changes: 45 additions & 45 deletions SampleOutput/Model/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,53 +9,53 @@ import Foundation
// swiftlint:disable nesting
// swiftlint:disable trailing_newline
public struct CoreDataEntity {
public struct AllTypes {
public static let name = "AllTypes"
public struct AllTypes {
public static let name = "AllTypes"

public class Field: NumericTypes.Field {
public static let data = "data"
public static let date = "date"
public static let string = "string"
public static let transformable = "transformable"
public static let properties = "properties"
}
}
public struct NumericTypes {
public static let name = "NumericTypes"
public class Field: NumericTypes.Field {
public static let data = "data"
public static let date = "date"
public static let string = "string"
public static let transformable = "transformable"
public static let properties = "properties"
}
}
public struct NumericTypes {
public static let name = "NumericTypes"

public class Field {
public static let boolean = "boolean"
public static let decimal = "decimal"
public static let double = "double"
public static let float = "float"
public static let int16 = "int16"
public static let int32 = "int32"
public static let int64 = "int64"
public static let scalars = "scalars"
}
}
public struct Property {
public static let name = "Property"
public class Field {
public static let boolean = "boolean"
public static let decimal = "decimal"
public static let double = "double"
public static let float = "float"
public static let int16 = "int16"
public static let int32 = "int32"
public static let int64 = "int64"
public static let scalars = "scalars"
}
}
public struct Property {
public static let name = "Property"

public class Field {
public static let name = "name"
public static let value = "value"
public static let types = "types"
}
}
public struct ScalarTypes {
public static let name = "ScalarTypes"
public class Field {
public static let name = "name"
public static let value = "value"
public static let types = "types"
}
}
public struct ScalarTypes {
public static let name = "ScalarTypes"

public class Field {
public static let boolean = "boolean"
public static let double = "double"
public static let float = "float"
public static let int16 = "int16"
public static let int32 = "int32"
public static let int64 = "int64"
public static let numerics = "numerics"
public static let eqTrue = "eqTrue"
public static let gt100 = "gt100"
}
}
public class Field {
public static let boolean = "boolean"
public static let double = "double"
public static let float = "float"
public static let int16 = "int16"
public static let int32 = "int32"
public static let int64 = "int64"
public static let numerics = "numerics"
public static let eqTrue = "eqTrue"
public static let gt100 = "gt100"
}
}
}
26 changes: 13 additions & 13 deletions SampleOutput/Mogenerator/Machine/_AllTypesClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ import Foundation
// swiftlint:disable vertical_whitespace
// swiftlint:disable implicit_return
public enum AllTypesClassAttributes: String {
case data
case date
case string
case transformable
case data
case date
case string
case transformable
}

public enum AllTypesClassRelationships: String {
case properties
case properties
}


// swiftlint:disable type_name
public class _AllTypesClass: NumericTypesClass {
@objc override public class var entityName: String {
return "AllTypes"
}
@objc override public class var entityName: String {
return "AllTypes"
}

@NSManaged public var data: NSData?
@NSManaged public var date: NSDate?
@NSManaged public var string: String?
@NSManaged public var transformable: NSObject?
@NSManaged public var data: NSData?
@NSManaged public var date: NSDate?
@NSManaged public var string: String?
@NSManaged public var transformable: NSObject?

@NSManaged public var properties: NSSet
@NSManaged public var properties: NSSet
}
38 changes: 19 additions & 19 deletions SampleOutput/Mogenerator/Machine/_NumericTypesClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ import Foundation
// swiftlint:disable vertical_whitespace
// swiftlint:disable implicit_return
public enum NumericTypesClassAttributes: String {
case boolean
case decimal
case double
case float
case int16
case int32
case int64
case boolean
case decimal
case double
case float
case int16
case int32
case int64
}

public enum NumericTypesClassRelationships: String {
case scalars
case scalars
}


// swiftlint:disable type_name
public class _NumericTypesClass: NSManagedObject {
@objc public class var entityName: String {
return "NumericTypes"
}
@objc public class var entityName: String {
return "NumericTypes"
}

@NSManaged public var boolean: NSNumber?
@NSManaged public var decimal: NSDecimalNumber?
@NSManaged public var double: NSNumber?
@NSManaged public var float: NSNumber?
@NSManaged public var int16: NSNumber?
@NSManaged public var int32: NSNumber?
@NSManaged public var int64: NSNumber?
@NSManaged public var boolean: NSNumber?
@NSManaged public var decimal: NSDecimalNumber?
@NSManaged public var double: NSNumber?
@NSManaged public var float: NSNumber?
@NSManaged public var int16: NSNumber?
@NSManaged public var int32: NSNumber?
@NSManaged public var int64: NSNumber?

@NSManaged public var scalars: ScalarTypesClass
@NSManaged public var scalars: ScalarTypesClass
}
18 changes: 9 additions & 9 deletions SampleOutput/Mogenerator/Machine/_PropertyClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import Foundation
// swiftlint:disable vertical_whitespace
// swiftlint:disable implicit_return
public enum PropertyClassAttributes: String {
case name
case value
case name
case value
}

public enum PropertyClassRelationships: String {
case types
case types
}


// swiftlint:disable type_name
public class _PropertyClass: NSManagedObject {
@objc public class var entityName: String {
return "Property"
}
@objc public class var entityName: String {
return "Property"
}

@NSManaged public var name: String
@NSManaged public var value: String
@NSManaged public var name: String
@NSManaged public var value: String

@NSManaged public var types: AllTypesClass?
@NSManaged public var types: AllTypesClass?
}
78 changes: 39 additions & 39 deletions SampleOutput/Mogenerator/Machine/_ScalarTypesClass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,53 @@ import Foundation
// swiftlint:disable vertical_whitespace
// swiftlint:disable implicit_return
public enum ScalarTypesClassAttributes: String {
case boolean
case double
case float
case int16
case int32
case int64
case boolean
case double
case float
case int16
case int32
case int64
}

public enum ScalarTypesClassRelationships: String {
case numerics
case numerics
}

public enum ScalarTypesClassFetchedProperties: String {
case eqTrue
case gt100

public var predicateString: String {
switch self {
case .eqTrue:
return "boolean == YES"
case .gt100:
return "int16 > 100"
}
}

public var entityName: String {
switch self {
case .eqTrue:
return "ScalarTypes"
case .gt100:
return "ScalarTypes"
}
}
case eqTrue
case gt100

public var predicateString: String {
switch self {
case .eqTrue:
return "boolean == YES"
case .gt100:
return "int16 > 100"
}
}

public var entityName: String {
switch self {
case .eqTrue:
return "ScalarTypes"
case .gt100:
return "ScalarTypes"
}
}
}

// swiftlint:disable type_name
public class _ScalarTypesClass: NSManagedObject {
@objc public class var entityName: String {
return "ScalarTypes"
}

@NSManaged public var boolean: Bool
@NSManaged public var double: Double
@NSManaged public var float: Float
@NSManaged public var int16: Int16
@NSManaged public var int32: Int32
@NSManaged public var int64: Int64

@NSManaged public var numerics: NumericTypesClass
@objc public class var entityName: String {
return "ScalarTypes"
}

@NSManaged public var boolean: Bool
@NSManaged public var double: Double
@NSManaged public var float: Float
@NSManaged public var int16: Int16
@NSManaged public var int32: Int32
@NSManaged public var int64: Int64

@NSManaged public var numerics: NumericTypesClass
}
Loading

0 comments on commit 9a15413

Please sign in to comment.