Jump to: navigation, search

Difference between revisions of "EDT:Compiler Settings Introduction"

Line 1: Line 1:
 
= EDT compiler settings introduction<br>  =
 
= EDT compiler settings introduction<br>  =
  
EDT is designed for extension, which means that the 3rd party can extend the EDT framework to customize their own compilers and generators. Currently, 'EDT Compiler', and 'Java/JavaScript Generator' are supported in EDT 0.7. It would have other compilers &amp; generators available in EDT in future. Compiler and generators should be configured when developing EGL applications.  
+
EDT is designed for extensibility, which means that 3rd parties can extend the EDT framework to customize their own compilers and generators. Currently,&nbsp; the EDT Compiler, and the Java and JavaScript generators are supported in EDT 0.7.&nbsp; We exptect to have other compilers and generators available in EDT in the future.&nbsp; Compilers and generators should be configured when developing EGL applications.  
  
For the compilers, currently EDT 0.7 only has 'EDT Compiler' and it's the default compiler in the EDT 0.7, so users do not need care about the compilers.  
+
For the compilers, currently EDT 0.7 only has the EDT Compiler and it is the default compiler in the EDT 0.7, so users do not need care about the compilers.  
  
For the generators, EDT 0.7 supports Java &amp; JavaScript generators. Java generator is used for generating the EGL code to Java. Generally, the EGL files configured with Java generators are EGL services and programs. Also the interfaces, libraries &amp; records used in services &amp; programs are also need to configured with Java generators. On the other hand, the RUI handlers are mostly configured with JavaScript generator, because normally it will be generated to JavaScript running in browser. It's possible that the interfaces, libraries &amp; records would be also used in RUI handlers, so those parts should be configured JavaScript generator as well. Otherwise, the generated JavaScript file of RUIHandler cannot resolve the generated JavaScript of interfaces, libraries or records. From the previous introduction, you can know that if a type is reference in both service &amp; RUI handlers, then the referenced part should be configured with both Java &amp; JavaScript generators.  
+
For the generators, EDT 0.7 supports Java and JavaScript generators. 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 configured with the Java generator.&nbsp; 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 the interfaces, libraries, and records would be also used in RUI handlers, so those parts should be configured with the JavaScript generator as well. Otherwise, the generated JavaScript file of a RUIHandler cannot resolve the generated JavaScript for interfaces, libraries or records. From the previous introduction, you know that 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 also supports to specify the compiler &amp; generators setting by project or package level. The settings in parent will be inherited to the children if they are not changed by user. It looks like that configuring the compiler &amp; generators are not easy work for you. But fortunately, in most of cases, you can follow the default compiler settings created by project wizard and without need configure them manually if following the usage of convention for packages.  
+
EDT also allows you to specify the compiler and generators settings at the project or package level. The settings in the parent will be inherited by the children if they are not changed by user. It might seem like configuring the compiler and generators would not be an easy task for you. But fortunately, in most cases, you can follow the default compiler settings created by the New EGL Project wizard, and you won't need to configure them manually if you follow the usage of conventions for packages.  
  
In the project creation wizard (File &gt; New &gt; EGL Project), 4 types of project templates are available as in below picture. The 2nd project template is only for a sample, so actually the wizard provides 3 kinds of project templates.<br>  
+
In the project creation wizard ('''File &gt; New &gt; EGL Project'''), 4 types of project templates are available, as shown in the picture below. The 2nd project template is only for a sample, so actually the wizard provides 3 kinds of project templates.<br>  
  
[[Image:Project_templates.jpg]]<br>  
+
[[Image:Project templates.jpg]]<br>  
  
 
== Basic <br>  ==
 
== Basic <br>  ==
  
If the 'Basic' template is selected and click 'Next' button, then the 2nd page of the wizard will let you choose compiler &amp; generators. You can check the 'Override generation settings from workspace preferences' to override the setting for the project. If keeping the default settings, then the created project will specified with Java &amp; JavaScript generators. So if EGL source files under this project will be generated in both Java &amp; JavaScript.  
+
If the '''Basic''' template is selected and you click '''Next''', then the 2nd page of the wizard will let 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.  
  
User can check the compiler &amp; generators settings by right clicking projects or packages &gt; Properties &gt; EGL Compiler. Also, user can modify the generator settings if the project or package is allowed to change the settings in this window. Please refer to below screen-shot the compiler settings for a package.<br>  
+
You can check the compiler and generators settings by right-clicking '''Projects '''or'''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 below screen-shot the compiler settings for a package.<br>  
  
 
[[Image:Compiler setting project.jpg]]<br>  
 
[[Image:Compiler setting project.jpg]]<br>  
Line 23: Line 23:
 
== Web 2.0 client application  ==
 
== Web 2.0 client application  ==
  
The 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.  
+
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  ==
 
== <br>Web 2.0 client application with services  ==
  
The project created by this template will have 3 packages, user can put the EGL source files to different packages with different purpose of the file. For example, if a type which is referenced in both 'client' &amp; 'server' package, then the type should be put into 'common' package.<br>- 'client' package configured with JavaScript generator only. <br>- 'common' package configured with both Java &amp; JavaScript generator.<br>- 'server' package configured with Java generator only.
+
A project created by this template will have 3 packages; you can put the EGL source files to 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>
  
== Set default compiler and generator setting for workspace  ==
+
*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
  
User can set the default generator folder for Java &amp; JavaScript generators by clicking 'Windows &gt; Preference &gt; EGL &gt; Compiler &gt; EDT', please refer to below picture. You can specify a different generator folder for Java &amp; JavaScript generators.<br>
+
== Set default compiler and generator setting for your workspace  ==
  
[[Image:Compiler_preference.jpg]]
+
You can set the default generator folder for the Java and JavaScript generators by clicking '''Windows &gt; Preference &gt; EGL &gt; Compiler &gt; EDT'''.&nbsp; You can specify a different generator folder for the Java and&nbsp; JavaScript generators.<br>
 +
 
 +
[[Image:Compiler preference.jpg]]
 +
 
 +
[[Category:EDT]]

Revision as of 16:38, 19 January 2012

EDT compiler settings introduction

EDT is designed for extensibility, which means that 3rd parties 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 exptect to have other compilers and generators available in EDT in the future.  Compilers and generators should be configured when developing EGL applications.

For the compilers, currently EDT 0.7 only has the EDT Compiler and it is the default compiler in the EDT 0.7, so users do not need care about the compilers.

For the generators, EDT 0.7 supports Java and JavaScript generators. The Java generator is used for generating EGL code to Java. Generally, the EGL files configured with Java generators are EGL services and programs.  Interfaces, libraries, and records used in services and programs also need to 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 the interfaces, libraries, and records would be also used in RUI handlers, so those parts should be configured with the JavaScript generator as well. Otherwise, the generated JavaScript file of a RUIHandler cannot resolve the generated JavaScript for interfaces, libraries or records. From the previous introduction, you know that 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 also allows you to specify the compiler and generators settings at the project or package level. The settings in the parent will be inherited by the children if they are not changed by user. It might seem like configuring the compiler and generators would not be an easy task for you. But fortunately, in most cases, you can follow the default compiler settings created by the New EGL Project wizard, and you won't need to configure them manually if you follow the usage of conventions for packages.

In the project creation wizard (File > New > EGL Project), 4 types of project templates are available, as shown in the picture below. The 2nd project template is only for a sample, so actually the wizard provides 3 kinds of project templates.

Project templates.jpg

Basic

If the Basic template is selected and you click Next, then the 2nd page of the wizard will let 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.

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

Compiler setting project.jpg

Web 2.0 client application

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.


Web 2.0 client application with services

A project created by this template will have 3 packages; you can put the EGL source files to 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. 

  • 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

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 > Preference > EGL > Compiler > EDT.  You can specify a different generator folder for the Java and  JavaScript generators.

Compiler preference.jpg