Jump to: navigation, search

Difference between revisions of "FAQ Language integration phase 1: How do I compile and build programs?"

 
m
 
Line 1: Line 1:
''
+
Phase 1 of language integration with Eclipse focuses on compilation of source files and building projects. We can distinguish the following individual steps/approaches to obtain complete integration:
  
Phase 1 of language integration with Eclipse focuses on compilation of source
+
* ''Use no integration''. Edit and compile source code externally and load it into Eclipse. This makes it difficult for the eScript compiler to use such facilities  as the PDE plug-in  model, which is needed to discover all kinds of attributes about plug-ins to be written. In fact, using an external builder is impractical for any kind of serious integration. For more details, see [[FAQ_How_do_I_load_source_files_edited_outside_Eclipse%3F]]
files and building projects. We can distinguish the following individual
+
steps/approaches to obtain complete integration:
+
  
 +
* ''Use external builders''. Edit your files with Eclipse, and  use an Ant script to compile the source files.  A problem is that information exchange between Eclipse and the external builder is severely limited; hence, the name <i>external builder</i>, of course. However, using an Ant  script allows for some experimentation without the need to write a plug-in. For more details, see [[FAQ_How_do_I_run_an_external_builder_on_my_source_files%3F]]
  
* ''Use no integration''. Edit and compile source code externally and load it
+
* ''Implement a compiler that runs inside Eclipse''. In other words,  write the compiler in Java and run it in the same JVM as Eclipse runs inOne approach could be to add a <tt>PopupMenu</tt> command to eScript files in the Resource Navigator. Running the compiler in this fashion puts Eclipse in control.  Files are built when Eclipse wants them and Eclipse does not need to react to changes from outside. For more details, see [[FAQ_How_do_I_implement_a_compiler_that_runs_inside_Eclipse%3F]]
into Eclipse.  
+
This makes it difficult for the eScript compiler to use such facilities as the PDE plug-in  
+
model, which is needed
+
to discover all kinds of attributes about plug-ins to be written. In fact, using an
+
external builder is impractical for any kind of serious integration.
+
For more details, see[[FAQ_How_do_I_load_source_files_edited_outside_Eclipse%3F]]
+
&nbsp;
+
  
* ''Use external builders''. Edit your files with Eclipse, and
+
* ''React to workspace changes.'' Edit files by using Eclipse editors. Whenever the user saves a source file, you can be notified so that the file can be compiled. Integration is definitely improving but still is cumbersome as it does not integrate well with how Eclipse thinks about the way projects are built. For more details, see [[FAQ_How_do_I_react_to_changes_in_source_files%3F]]
use an Ant script to compile the source files.  
+
A problem is that information exchange between Eclipse and the external builder
+
is severely limited; hence, the name <i>external builder</i>, of course. However, using an Ant
+
script allows for some experimentation without the need to write a plug-in.
+
For more details, see[[FAQ_How_do_I_run_an_external_builder_on_my_source_files%3F]]
+
&nbsp;
+
  
* ''Implement a compiler that runs inside Eclipse''. In other words,
+
* ''Implement an Eclipse builder.'' Builders are invoked on a project when any of its resources are changed or when the user manually requests a project to be rebuilt. Multiple builders can be registered on a project, and integration of a compiler into a build process is worth considering owing to its many benefits. For more details, see [[FAQ_How_do_I_implement_an_Eclipse_builder%3F]]
write the compiler in Java and run it in the same JVM as Eclipse runs in.  
+
One approach could
+
be to add a <tt>PopupMenu</tt> command to eScript files in the Resource Navigator.
+
Running the compiler in this fashion puts Eclipse in control.
+
Files are built when Eclipse wants them and Eclipse does not need to react to  
+
changes from outside.  
+
For more details, see[[FAQ_How_do_I_implement_a_compiler_that_runs_inside_Eclipse%3F]]
+
  
&nbsp;
+
After following these steps, you are <i>almost</i> ready to focus on writing an editor. First, you have to look at [[FAQ_Language_integration_phase_2%3A_How_do_I_implement_a_DOM%3F]]
* ''React to workspace changes.''
+
Edit files by using Eclipse editors. Whenever the user saves a source file,
+
you can be notified so that the file can be compiled. Integration is definitely improving
+
but still is cumbersome as it does not integrate well with how Eclipse
+
thinks about the way projects are built.
+
For more details, see[[FAQ_How_do_I_react_to_changes_in_source_files%3F]]
+
 
+
&nbsp;
+
* ''Implement an Eclipse builder.''
+
Builders are invoked on a project when any of its resources are changed or
+
when the user manually requests a project to be rebuilt. Multiple builders can
+
be registered on a project, and integration of a compiler into a build
+
process is worth considering owing to its many benefits.
+
For more details, see[[FAQ_How_do_I_implement_an_Eclipse_builder%3F]]
+
 
+
 
+
 
+
After following these steps, you are <i>almost</i> ready to focus on writing an  
+
editor. First, you have to look at
+
[[FAQ_Language_integration_phase_2%3A_How_do_I_implement_a_DOM%3F]]
+
  
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Latest revision as of 22:25, 29 May 2006

Phase 1 of language integration with Eclipse focuses on compilation of source files and building projects. We can distinguish the following individual steps/approaches to obtain complete integration:

  • Use no integration. Edit and compile source code externally and load it into Eclipse. This makes it difficult for the eScript compiler to use such facilities as the PDE plug-in model, which is needed to discover all kinds of attributes about plug-ins to be written. In fact, using an external builder is impractical for any kind of serious integration. For more details, see FAQ_How_do_I_load_source_files_edited_outside_Eclipse?
  • Use external builders. Edit your files with Eclipse, and use an Ant script to compile the source files. A problem is that information exchange between Eclipse and the external builder is severely limited; hence, the name external builder, of course. However, using an Ant script allows for some experimentation without the need to write a plug-in. For more details, see FAQ_How_do_I_run_an_external_builder_on_my_source_files?
  • Implement a compiler that runs inside Eclipse. In other words, write the compiler in Java and run it in the same JVM as Eclipse runs in. One approach could be to add a PopupMenu command to eScript files in the Resource Navigator. Running the compiler in this fashion puts Eclipse in control. Files are built when Eclipse wants them and Eclipse does not need to react to changes from outside. For more details, see FAQ_How_do_I_implement_a_compiler_that_runs_inside_Eclipse?
  • React to workspace changes. Edit files by using Eclipse editors. Whenever the user saves a source file, you can be notified so that the file can be compiled. Integration is definitely improving but still is cumbersome as it does not integrate well with how Eclipse thinks about the way projects are built. For more details, see FAQ_How_do_I_react_to_changes_in_source_files?
  • Implement an Eclipse builder. Builders are invoked on a project when any of its resources are changed or when the user manually requests a project to be rebuilt. Multiple builders can be registered on a project, and integration of a compiler into a build process is worth considering owing to its many benefits. For more details, see FAQ_How_do_I_implement_an_Eclipse_builder?

After following these steps, you are almost ready to focus on writing an editor. First, you have to look at FAQ_Language_integration_phase_2:_How_do_I_implement_a_DOM?


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.