Browse Source

JavaNativeModule: CompiledModules now retrieve all compiled information from parent modules

kindlich 4 years ago
parent
commit
959618f7fb
No known key found for this signature in database

+ 4
- 3
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java View File

@@ -73,14 +73,15 @@ public class JavaNativeModule {
73 73
 		this.basePackage = basePackage;
74 74
 		module = new Module(name);
75 75
 		this.registry = registry;
76
-
76
+        
77
+        compiled = new JavaCompiledModule(module, FunctionParameter.NONE);
78
+        
77 79
 		for (JavaNativeModule dependency : dependencies) {
78 80
 			definitionByClass.putAll(dependency.definitionByClass);
79 81
 			context.typeVariables.putAll(dependency.context.typeVariables);
82
+			compiled.addAllFrom(dependency.compiled);
80 83
 		}
81 84
 
82
-		compiled = new JavaCompiledModule(module, FunctionParameter.NONE);
83
-
84 85
 		typeByClass.put(void.class, BasicTypeID.VOID);
85 86
 		typeByClass.put(boolean.class, BasicTypeID.BOOL);
86 87
 		typeByClass.put(byte.class, BasicTypeID.SBYTE);

+ 12
- 0
JavaShared/src/main/java/org/openzen/zenscript/javashared/JavaCompiledModule.java View File

@@ -185,4 +185,16 @@ public class JavaCompiledModule {
185 185
 		
186 186
 		return info;
187 187
 	}
188
+    
189
+    public void addAllFrom(JavaCompiledModule compiled) {
190
+        this.classes.putAll(compiled.classes);
191
+        this.expansionClasses.putAll(compiled.expansionClasses);
192
+        this.nativeClasses.putAll(compiled.nativeClasses);
193
+        this.implementations.putAll(compiled.implementations);
194
+        this.fields.putAll(compiled.fields);
195
+        this.methods.putAll(compiled.methods);
196
+        this.typeParameters.putAll(compiled.typeParameters);
197
+        this.parameters.putAll(compiled.parameters);
198
+        this.variantOptions.putAll(compiled.variantOptions);
199
+    }
188 200
 }

Loading…
Cancel
Save