15
15
16
16
import enum
17
17
import logging
18
+ import os
18
19
from typing import List , Set , Union
19
20
20
21
from matter_idl .generators import CodeGenerator , GeneratorStorage
@@ -405,7 +406,7 @@ def __init__(self, storage: GeneratorStorage, idl: Idl, **kargs):
405
406
Inintialization is specific for java generation and will add
406
407
filters as required by the java .jinja templates to function.
407
408
"""
408
- super ().__init__ (storage , idl )
409
+ super ().__init__ (storage , idl , fs_loader_searchpath = os . path . dirname ( __file__ ) )
409
410
410
411
self .jinja_env .filters ['attributesWithCallback' ] = attributesWithSupportedCallback
411
412
self .jinja_env .filters ['callbackName' ] = CallbackName
@@ -434,7 +435,7 @@ def internal_render_all(self):
434
435
"""
435
436
436
437
self .internal_render_one_output (
437
- template_path = "java/ CHIPCallbackTypes.jinja" ,
438
+ template_path = "CHIPCallbackTypes.jinja" ,
438
439
output_file_name = "jni/CHIPCallbackTypes.h" ,
439
440
vars = {
440
441
'idl' : self .idl ,
@@ -449,7 +450,7 @@ def internal_render_all(self):
449
450
continue
450
451
451
452
self .internal_render_one_output (
452
- template_path = "java/ ChipClustersRead.jinja" ,
453
+ template_path = "ChipClustersRead.jinja" ,
453
454
output_file_name = "jni/%sClient-ReadImpl.cpp" % cluster .name ,
454
455
vars = {
455
456
'cluster' : cluster ,
@@ -458,7 +459,7 @@ def internal_render_all(self):
458
459
)
459
460
460
461
self .internal_render_one_output (
461
- template_path = "java/ ChipClustersCpp.jinja" ,
462
+ template_path = "ChipClustersCpp.jinja" ,
462
463
output_file_name = "jni/%sClient-InvokeSubscribeImpl.cpp" % cluster .name ,
463
464
vars = {
464
465
'cluster' : cluster ,
@@ -482,7 +483,7 @@ def internal_render_all(self):
482
483
c for c in self .idl .clusters if c .side == ClusterSide .CLIENT ]
483
484
484
485
self .internal_render_one_output (
485
- template_path = "java/ ClusterReadMapping.jinja" ,
486
+ template_path = "ClusterReadMapping.jinja" ,
486
487
output_file_name = "java/chip/devicecontroller/ClusterReadMapping.java" ,
487
488
vars = {
488
489
'idl' : self .idl ,
@@ -491,7 +492,7 @@ def internal_render_all(self):
491
492
)
492
493
493
494
self .internal_render_one_output (
494
- template_path = "java/ ClusterWriteMapping.jinja" ,
495
+ template_path = "ClusterWriteMapping.jinja" ,
495
496
output_file_name = "java/chip/devicecontroller/ClusterWriteMapping.java" ,
496
497
vars = {
497
498
'idl' : self .idl ,
0 commit comments