java - Dynamic Acceleo Project Plugin -


i want run acceleo project installed plugin,

i.e. have written plugin uses acceleo , want run acceleo template project in workspace.

currently, have acceleo project run eclipse plugin programmatically:

try { final file outputdir = new file("c:/outputdir/"); list<string> arguments = new arraylist<string>(); /*fc instance of emf compare comparison object  * nsuri http://www.eclipse.org/emf/compare  */ generate generator = new generate(fc, outputdir, arguments);                                              generator.dogenerate(new basicmonitor()); } catch (ioexception e) { e.printstacktrace(); } 

the template simple @ moment:

[comment encoding = utf-8 /] [module generate('http://www.eclipse.org/emf/compare')] [template public generateelement(comparison : comparison)] [comment @main/] [file ('update.sql', false, 'utf-8')] /*sql update script test*/ [comparison.getdifferences().tostring() /] [/file] [/template] 

this generates perfectly.

the issue need deploy plugin still need end users able modify templates. end goal have acceleo project in end users' workspace , let plugin call @ runtime, no matter how set up, have include acceleo project in plugin feature.

things have attempted:

  • overriding acceleo module project in end users workspace
  • various attempts java class loaders (i feel way go can't seem working example)

i running:

  • eclipse luna sr2 (4.4.2)
  • windows 7 pro - 64bitsp1
  • acceleo3.5.1.201409021433
  • jre 1.8.0_45

what trying achieve defined incorrectly. acceleo compiles templates java code , creates executable classes them. if want end users modify templates, need compile code afterwards, i.e. need build infrastructure.

i suggest parameterize sql queries , compile templates. can create utility java class exposing function "getsql...()" , call template. utility class can read sql .properties or other source please.

then compile , release binary acceleo project , teach users need configure @ runtime.


Comments