Jump to: navigation, search

Difference between revisions of "EDT:Compiler Settings Introduction"

(EDT compiler settings introduction: tdr edits)
(tdr edits)
Line 1: Line 1:
= EDT compiler settings introduction<br>  =
+
In EDT 0.7, the EDT Compiler contains two generators: one for Java and one for JavaScript. The Java generator is used for generating EGL code to Java. Generally, the EGL files configured with Java generator are EGL services and programs. Interfaces, libraries, and records used in services and programs also need to be configured with the Java generator. On the other hand, the Rich UI handlers are mostly configured with the JavaScript generator, because normally they will be generated to JavaScript running in a browser. It's possible that interfaces, libraries, and records would be also used in RUI handlers; if so, then those parts should be configured with the JavaScript generator as well. Otherwise, the generated JavaScript file of a RUIHandler cannot resolve references to the interfaces, libraries or records. If a type is referenced in both services and RUI handlers, then the referenced part should be configured with both Java and JavaScript generators
  
EDT is designed for extensibility, which means that you can extend the EDT framework to customize their own compilers and generators. Currently, the EDT Compiler, and the Java and JavaScript generators are supported in EDT 0.7. We expect to have other compilers and generators available in EDT in the future. Compilers and generators should be configured when developing EGL applications. &nbsp;Since EDT 0.7 only has the EDT Compiler and it is the default, you do not need to worry about the compiler setting. &nbsp;
+
You can configure the compiler and generators for your EGL applications at a project or package level. The settings in the parent level will be inherited by the children unless they are not changed. The EGL project wizard provides generator defaults based on the project template selected.&nbsp;In most cases you can follow the default compiler settings created by the New EGL Project wizard, and you won't need to configure the settings manually if you follow the usage conventions for packages.  
  
For the generators, EDT 0.7 supports Java and JavaScript. The Java generator is used for generating EGL code to Java. Generally, the EGL files configured with Java generators are EGL services and programs.&nbsp; Interfaces, libraries, and records used in services and programs also need to be configured with the Java generator. On the other hand, the Rich UI handlers are mostly configured with the JavaScript generator, because normally they will be generated to JavaScript running in a browser. It's possible that interfaces, libraries, and records would be also used in RUI handlers; if so, then those parts should be configured with the JavaScript generator as well. Otherwise, the generated JavaScript file of a RUIHandler cannot resolve references to the interfaces, libraries or records. If a type is referenced in both services and RUI handlers, then the referenced part should be configured with both Java and JavaScript generators.  
+
In the EGL Project wizard ('''File &gt; New &gt; EGL Project'''), four types of project templates are available. The second project template is a sample which uses both the Java and JavaScript generators by default. &nbsp;The other templates allow you to specify the generators you want to use.<br>
  
EDT allows you to specify the compiler and generator settings at the project level or package level. The settings in the parent level will be inherited by the children if they are not changed by the user. In most cases you can follow the default compiler settings created by the New EGL Project wizard, and you won't need to configure the settings manually if you follow the usage conventions for packages.  
+
[[Image:Project templates.jpg]]<br>
  
In the EGL Project wizard ('''File &gt; New &gt; EGL Project'''), four types of project templates are available. The second project template is a sample.<br>  
+
=== Compiler setting in the New EGL Project Wizard<br> ===
  
[[Image:Project templates.jpg]]<br>
+
The EGL Compiler settings page of the EGL Project Wizard allows you to specify which compiler and generators you want to use. &nbsp;For EDT 0.7, only the EDT Compiler is included. &nbsp;The default generator settings depend on the project template you select. &nbsp;
  
== Basic <br> ==
+
A project created using the '''Basic '''template uses both the Java and JavaScript generators. EGL source files in a basic project will be generated into both Java and JavaScript.<br><br>
  
If the '''Basic''' template is selected and you click '''Next''', the second page let's you choose the compiler and generators. You can check '''Override generation settings from workspace preferences''' to override the settings for the project. If you keep the default settings, then the created project will be specified with Java and JavaScript generators, so the EGL source files under this project will be generated into both Java and JavaScript.  
+
The '''Web 2.0 client application''' template has a single package named '''client '''configured with JavaScript generator by default. Only JavaScript will be generated for the EGL source files in this project.
  
You can check the compiler and generators settings by right-clicking '''Projects '''or&nbsp;'''Packages &gt; Properties &gt; EGL Compiler'''. Also, you can specify whether the project or package is allowed to change the settings in this window. Please refer to the screen shot below to see the compiler settings for a package.<br>
 
  
[[Image:Compiler setting project.jpg]]<br>
 
  
== Web 2.0 client application ==
+
A project created with the&nbsp;'''Web 2.0 client application with services''' template contains 3 packages; client, server, and common. The client package is configured with JavaScript generator. The server package is configured with the Java generator. The common package is configured with both the Java and JavaScript generators. You can put the EGL source files in different packages depending on the purpose of each file. For example, if a type is referenced in both the client and server packages, then the type should be put into the common package.&nbsp;<br>
  
A project created by this template only has a package named '''client''' configured with JavaScript generator by default, which means that only JavaScript will be generated for the EGL source files in this project.
 
  
== <br>Web 2.0 client application with services  ==
 
  
A project created by this template will have 3 packages; you can put the EGL source files in different packages depending on the purpose of each file. For example, if a type is referenced in both the '''client''' and '''server''' packages, then the type should be put into the '''common''' package.&nbsp; <br>
 
  
*the '''client''' package is configured with JavaScript generator
+
 
*the '''server''' package is configured with the Java generator
+
You can check Override generation settings from workspace preferences to override the settings for the project.
*the '''common''' package is configured with both the Java and JavaScript generators
+
 
 +
&lt;insert image of compiler setting page&gt;<br>
 +
 
 +
=== Compiler settings in the Properties ===
 +
 
 +
You can view or edit the compiler and generator settings by right-clicking '''Projects '''or&nbsp;'''Packages &gt; Properties &gt; EGL Compiler'''. Also, you can specify whether the project or package is allowed to change the settings in this window. Please refer to the screen shot below to see the compiler settings for a package.<br>
 +
 
 +
[[Image:Compiler setting project.jpg]]<br>
  
 
== Set default compiler and generator setting for your workspace  ==
 
== Set default compiler and generator setting for your workspace  ==
Line 36: Line 38:
  
 
[[Image:Compiler preference.jpg]]  
 
[[Image:Compiler preference.jpg]]  
 +
 +
 +
 +
== Extending EDT compiler and generators ==
 +
 +
EDT is designed for extensibility, which means that you can extend the EDT framework with your own compilers and generators.&nbsp;<br>
  
 
[[Category:EDT]]
 
[[Category:EDT]]

Revision as of 18:42, 17 February 2012

In EDT 0.7, the EDT Compiler contains two generators: one for Java and one for JavaScript. The Java generator is used for generating EGL code to Java. Generally, the EGL files configured with Java generator are EGL services and programs. Interfaces, libraries, and records used in services and programs also need to be configured with the Java generator. On the other hand, the Rich UI handlers are mostly configured with the JavaScript generator, because normally they will be generated to JavaScript running in a browser. It's possible that interfaces, libraries, and records would be also used in RUI handlers; if so, then those parts should be configured with the JavaScript generator as well. Otherwise, the generated JavaScript file of a RUIHandler cannot resolve references to the interfaces, libraries or records. If a type is referenced in both services and RUI handlers, then the referenced part should be configured with both Java and JavaScript generators

You can configure the compiler and generators for your EGL applications at a project or package level. The settings in the parent level will be inherited by the children unless they are not changed. The EGL project wizard provides generator defaults based on the project template selected. In most cases you can follow the default compiler settings created by the New EGL Project wizard, and you won't need to configure the settings manually if you follow the usage conventions for packages.

In the EGL Project wizard (File > New > EGL Project), four types of project templates are available. The second project template is a sample which uses both the Java and JavaScript generators by default.  The other templates allow you to specify the generators you want to use.

Project templates.jpg

Compiler setting in the New EGL Project Wizard

The EGL Compiler settings page of the EGL Project Wizard allows you to specify which compiler and generators you want to use.  For EDT 0.7, only the EDT Compiler is included.  The default generator settings depend on the project template you select.  

A project created using the Basic template uses both the Java and JavaScript generators. EGL source files in a basic project will be generated into both Java and JavaScript.

The Web 2.0 client application template has a single package named client configured with JavaScript generator by default. Only JavaScript will be generated for the EGL source files in this project.


A project created with the Web 2.0 client application with services template contains 3 packages; client, server, and common. The client package is configured with JavaScript generator. The server package is configured with the Java generator. The common package is configured with both the Java and JavaScript generators. You can put the EGL source files in different packages depending on the purpose of each file. For example, if a type is referenced in both the client and server packages, then the type should be put into the common package. 



You can check Override generation settings from workspace preferences to override the settings for the project.

<insert image of compiler setting page>

Compiler settings in the Properties

You can view or edit the compiler and generator settings by right-clicking Projects or Packages > Properties > EGL Compiler. Also, you can specify whether the project or package is allowed to change the settings in this window. Please refer to the screen shot below to see the compiler settings for a package.

Compiler setting project.jpg

Set default compiler and generator setting for your workspace

You can set the default generator folder for the Java and JavaScript generators by clicking Windows > Preferences > EGL > Compiler > EDT.  You can specify a different generator folder for the Java and  JavaScript generators.

Compiler preference.jpg


Extending EDT compiler and generators

EDT is designed for extensibility, which means that you can extend the EDT framework with your own compilers and generators.