Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Xtend files compile in plugin environment(Xtend files compile in plugin environment)
Xtend files compile in plugin environment [message #1708864] Tue, 22 September 2015 04:27 Go to next message
Babu M is currently offline Babu MFriend
Messages: 20
Registered: February 2012
Junior Member
In eclipse ide, I would like to programmatically compile xtend files in plugin environment (xtend logic has dependency on various plugins).

Here, I have to use 'JUNIT Plugin Test' to do this job and i have all my xtend files in 'src-accessors' which i had excluded this folder from source folder list. I would like to compile these xtend files into a different plugin's 'src-accessors' and ofcouse this folder is a source folder.

I have gone through this post and of not much help as it seems like working in standalone environment.
http://stackoverflow.com/questions/25883483/how-to-compile-xtend-sources-with-the-standalone-compiler

Any code snippet or sudo code which will help me in understanding this concept will help.
Re: Xtend files compile in plugin environment [message #1709128 is a reply to message #1708864] Thu, 24 September 2015 09:52 Go to previous message
Babu M is currently offline Babu MFriend
Messages: 20
Registered: February 2012
Junior Member
I myself solved this problem. Also its resolving the paths which are from platform but not from workspace. Any hints like where I am going wrong


@SuppressWarnings("restriction")
public void compile(ClassLoader cLoader) {
String input = getInput();
String output = getOutput();

BasicConfigurator.configure();

@SuppressWarnings("restriction")
Injector injector = XtendInjectorSingleton.INJECTOR;

XtendBatchCompiler compiler = injector
.getInstance(XtendBatchCompiler.class);

compiler.setJavaSourceVersion("1.7");
compiler.setFileEncoding("UTF-8");
compiler.setOutputPath(output);
compiler.setSourcePath(input);
compiler.setVerbose(true);

compiler.setCurrentClassLoader(cLoader);
compiler.setUseCurrentClassLoaderAsParent(true);

compiler.compile();
Previous Topic:[Acceleo] Cannot access EClass objects declared in a referenced .ecore file
Next Topic:[Solved][XPand+MWE] Execute MWE(v1.2.1) programmatically
Goto Forum:
  


Current Time: Tue Apr 23 08:39:17 GMT 2024

Powered by FUDForum. Page generated in 0.02689 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top