File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Sources/ImmutableSwift/generating Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ class Generator {
88 output = output + Generator. ImportsToString ( datamodel. imports!) + " \n "
99 }
1010
11+ if pluginList != nil {
12+ let importsFromPlugins = Generator . GenerateImportsWithPluginList ( pluginList!)
13+ if importsFromPlugins. count > 0 {
14+ output = output + importsFromPlugins + " \n "
15+ }
16+ }
17+
1118 // optional accesscontrol
1219 if datamodel. accessControlLevel != nil {
1320 output = output + Generator. AccessControlLevelToString ( datamodel. accessControlLevel!) + " "
@@ -76,6 +83,18 @@ class Generator {
7683 return output
7784 }
7885
86+ static func GenerateImportsWithPluginList( _ pluginList: PluginList ) -> String {
87+ var imports : Set < String > = [ ]
88+ for pluginName in pluginList. plugins {
89+ if Plugins . PLUGIN_MAP [ pluginName] != nil {
90+ for importFromPlugin in Plugins . PLUGIN_MAP [ pluginName] !. imports ( ) {
91+ imports. insert ( " import " + importFromPlugin)
92+ }
93+ }
94+ }
95+ return imports. joined ( separator: " \n " ) + " \n "
96+ }
97+
7998 static func AccessControlLevelToString( _ accessControl: AccessControl ) -> String {
8099 switch accessControl {
81100 case AccessControl . levelPublic:
You can’t perform that action at this time.
0 commit comments