Skip to content

Commit d4a54b9

Browse files
erlendnils1erlend
andauthored
Allow imports from importLocations to import from other import locations (#747)
* Allow imports from importLocations to import from other import locations * Remove redundant addition of current customImportLocation as schemaLoader.source as all customImportLocations are now added --------- Co-authored-by: erlend <erlend@scelto.no>
1 parent d10910a commit d4a54b9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

schema2proto-lib/src/main/java/no/entur/schema2proto/generateproto/ProtoSerializer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ private List<String> getFullyQualifiedTypes(String pathName) {
432432
File fileToImport = new File(path, pathName);
433433
if (fileToImport.exists()) {
434434
SchemaLoader schemaLoader = new SchemaLoader();
435-
schemaLoader.addSource(path);
435+
for (String importRootFolder : configuration.customImportLocations) {
436+
schemaLoader.addSource(new File(importRootFolder).toPath());
437+
}
436438
schemaLoader.addProto(pathName);
437439
Schema schema = schemaLoader.load();
438440
ProtoFile customImportFile = schema.protoFile(pathName);

0 commit comments

Comments
 (0)