File tree 1 file changed +19
-0
lines changed
Sources/ImmutableSwift/generating
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ class Generator {
8
8
output = output + Generator. ImportsToString ( datamodel. imports!) + " \n "
9
9
}
10
10
11
+ if pluginList != nil {
12
+ let importsFromPlugins = Generator . GenerateImportsWithPluginList ( pluginList!)
13
+ if importsFromPlugins. count > 0 {
14
+ output = output + importsFromPlugins + " \n "
15
+ }
16
+ }
17
+
11
18
// optional accesscontrol
12
19
if datamodel. accessControlLevel != nil {
13
20
output = output + Generator. AccessControlLevelToString ( datamodel. accessControlLevel!) + " "
@@ -76,6 +83,18 @@ class Generator {
76
83
return output
77
84
}
78
85
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
+
79
98
static func AccessControlLevelToString( _ accessControl: AccessControl ) -> String {
80
99
switch accessControl {
81
100
case AccessControl . levelPublic:
You can’t perform that action at this time.
0 commit comments