add goplugin for exec generators and transformers

This commit is contained in:
Jingfang Liu
2019-04-09 11:19:33 -07:00
parent ee68a9c450
commit ba43ecbcb7
7 changed files with 180 additions and 10 deletions

View File

@@ -47,14 +47,13 @@ func (l generatorLoader) Load(
}
var result []transformers.Generator
for id, res := range rm {
fileName := pluginFileName(l.pc, id)
c, err := loadAndConfigurePlugin(fileName, l.ldr, l.rf, res)
c, err := loadAndConfigurePlugin(l.pc.DirectoryPath, id, l.ldr, l.rf, res)
if err != nil {
return nil, err
}
g, ok := c.(transformers.Generator)
if !ok {
return nil, fmt.Errorf("plugin %s not a generator", fileName)
return nil, fmt.Errorf("plugin %s not a generator", id.String())
}
result = append(result, g)
}