Skip to content

Commit

Permalink
add default plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhou committed Feb 17, 2019
1 parent ebfbb87 commit 75143cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Sources/ImmutableSwift/generating/Generator.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
class Generator {
static func Generate(_ datamodel: DataModel) -> String {
var output = ""
let pluginList = datamodel.plugins
let pluginList : PluginList?
if datamodel.plugins != nil{
pluginList = datamodel.plugins
} else{
pluginList = PluginList(Plugins.defaultPlugins)
}

// optional imports
if datamodel.imports != nil {
Expand Down
8 changes: 7 additions & 1 deletion Sources/ImmutableSwift/generating/plugins/PluginUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ struct Plugins {
ISCodable.Name: ISCodable(),
ISCopying.Name: ISCopying(),
]
}

static let defaultPlugins : [String] = [
ISHashable.Name,
ISCodable.Name,
ISCopying.Name,
]
}

0 comments on commit 75143cc

Please sign in to comment.