Use the left or right arrow key to walk through the modifications.
first | last ![]() |
| Changes from: | |
| to: | |
| Type: | |
first | last ![]() |
Restlet is becoming an ubiquitous Web development framework. This has led us to provide various adaptations (ports) of the main Restlet code. So far we have been handling this process manually, but time has come to industrialize this process.
Overall file hierarchy, with XML files descriptors:
svn/trunk
+ build
| + project.xml
+ modules
| + org.restlet/module.xml
| + org.restlet.ext.freemarker/module.xml
| + ...
+ libraries
+ org.mortbay.jetty_6.1/library.xml
Overall build schema:
<editions>
<edition id="android|gae|gwt|jee|jse">
<label>
<full></full>
<medium></medium>
<short></short>
</label>
<description></description>
<javadocs>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/" />
[...]
</javadocs>
<distributions>
<distribution id="classic" />
<distribution id="maven" />
</distributions>
</edition>
</editions>
|
Name |
Description |
Notes |
values |
|---|---|---|---|
|
edition |
Describes a single edition | ||
|
edition#id |
Identifier of the current edition |
attribute |
one of the following: android, gae, gwt, jee, jse |
|
label.full |
Full label for this edition |
text |
sample value: Java Standard Edition |
|
label.medium |
Shorter label |
text |
sample value: Java SE |
|
label.short |
Short label |
text |
JSE |
|
description |
Description of the current edition |
text | |
|
javadocs |
List of standard "link" entries for the and javadocs task | ||
|
distributions |
List of supported distributions for this edition | ||
|
distribution#id |
Identifier of a distribution |
attribute |
one of the following: classic, maven |
Necessary data:
<module id="" type="core|standard|integration|connector" package="org.restlet[...]" includes="" excludes="">
<label></label>
<description></description>
<distributions>
<distribution id="classic" />
<distribution id="maven" />
</distributions>
<dependencies>
<dependency includes excludes="" type="library|module" id="" />
</dependencies>
<osgi>
<export includes="" excludes=""></export>
<import includes="" excludes=""></import>
<activator includes="" excludes="" />
</osgi>
<source edition="android|gae|gwt|jee|jse">
<files-mappers>
<![CDATA[
]]>
</files-mappers>
<files-sets>
<![CDATA[
]]>
</files-sets>
</source>
<stage edition="gwt" includesource="true">
<files-filters>
<![CDATA[
]]>
</files-filters>
<files-sets>
<![CDATA[
]]>
</files-sets>
<files-mappers>
<![CDATA[
]]>
</files-mappers>
</stage>
</module>
|
Name |
Description |
Notes |
values |
|---|---|---|---|
|
module |
Describes a single module | ||
|
module#id |
Identifier of the current module |
attribute |
sample values: core, freemarker, etc |
|
module#type |
Distinguish a core module from an extension, and specify also the kind of extension. |
attribute |
one of the following: core, standard, connector, integration |
|
module#package |
Name of the corresponding package |
attribute |
sample value: org.restlet.ext.freemarker |
|
includes |
List of editions this modules is included in. It uses ',' as separator. |
attribute |
can be '*' for all editions |
|
excludes |
List of editions this modules is not included in. It uses ',' as separator. |
attribute |
can be '*' for all editions (won't be part of any edition |
|
label |
Full label for this module |
text |
sample value: Integration with Grizzly NIO framework. |
|
distributions |
List of supported distributions for this module | ||
|
distribution.id |
Identifier of a distribution |
attribute |
one of the following: classic, maven |
|
dependencies |
List of libraries and modules, this module depends on. | ||
|
dependency#id |
Identifier of the library or module |
attribute |
sample values: core, freemarker |
|
dependency#type |
Type of the dependency |
attribute |
one of the following: library, module |
|
dependency#includes |
List of editions this dependency is valid. |
attribute | |
|
dependency#excludes |
List of editions this dependency is invalid |
attribute | |
|
osgi |
Not used for the moment | ||
|
source |
A collection of ant file sets, file mappers and file filter used during the generation of the source code for one specific edition from the unique source repository | ||
|
source#edition |
Identifier of the edition |
attribute | |
|
source.file-mappers |
Container of ant file mappers used to rename source files |
text |
sample value of one item: |
|
source.file-sets |
Container of ant file file-set rules used generally to exclude source file for the target edition |
text |
sample value of one item: |
|
stage |
A collection of ant file sets, file mappers and file filter used for completing the final jar of this module | ||
|
stage#edition |
Identifier of the edition |
attribute | |
|
stage#includesource |
Indicates if the source code must be included inside the final jar. |
attribute |
one of the following: true, false |
|
stage.file-mappers |
Container of ant file mappers used to rename files | ||
|
stage.file-sets |
Container of ant file file-set rules | ||
|
stage.file-filters |
Container of ant file file-filter rules used for text filtering during the copy of the source files |
sample value of one item: <tokenfilter> |
Necessary data:
<library id="">
<package id="" name="">
<maven>
<groupId /> optional (default to "org.restlet")
<artifactId /> optional (default to package, always concatenated with "org.restlet.lib")
<version /> optional (default to version.release or version)
</maven>
</package>
<version></version>
<release></release>
<distributions>
<distribution id="classic|maven" includes="" excludes="" />
</distributions>
<homeUri></homeUri>
<downloadUri></downloadUri>
</library>
|
Name |
Description |
Notes |
values |
|---|---|---|---|
|
library |
Describes a single library | ||
|
library#id |
Identifier of the current library |
attribute |
sample values: db4o, freemarker, etc |
|
package |
Description one jar inside this library module | ||
|
package#id |
Identifier of this package |
attribute |
sample value: db4o-nativequery |
|
package#name |
Optional name of the jar file |
attribute |
sample value: com.db4o.nativequery |
|
package.maven |
Specifies a set of properties values for the generation of the Maven artifact | ||
|
package.maven.groupId |
Only if distinct from the default value ("org.restlet") |
sample value: com.db4o |
|
|
package.maven.artifactId |
Only if distinct from the default value ("org.restlet.lib.<packagename>") | ||
|
package.maven.version |
Only if distinct from the default value ("<version>.<release>" or "<version>") | ||
|
version |
Minor version of this library |
text |
sample value: 7.7 |
|
release |
Release number of this library |
text |
sample value: 67 |
|
distributions |
List of supported distributions for this module | ||
|
distribution |
Describes a distribution | ||
|
distribution#id |
Identifier of a distribution |
attribute |
one of the following: classic, maven |
|
homeUri |
Uri of the home page of the library's project |
text | |
|
downloadUri |
Uri of the download page |
text |
Sources of diagrams: buildEditions
Current supported editions:
Maven group id: org.restlet.<edition>
Files distributions
The aim of this set of code annotations is to provide text transformation rules in order to generate a new version of a class for a specific edition. Basically the following transformations are supported:
The implementation is not incarnated by a set of Java annotations which are not flexible enough. The idea was taken from the concept of conditional compilation used for other languages such as C. It consists only of simple Java comments:
The avantage of such comments is that they can be put everywhere in the source code, and still remain even if the source code is automatically formatted by the development environment. Note that unfortunately, Eclipse does not allow such comments in the section where are declared the "import" classes.
The "ifdef" and "ifndef" annotations mark the beginning of a block. Such blocks target a list of editions specified with a simple coma-separated list of editions id. According to the optional keywords, they may require the end block marker: "enddef".
As sample code says a lot more than a flow of explanations, here is the way to indicates that the a block code apply only for the jee and jse editions:
// [ifdef jee,jse] instructions1; instructions2; // [enddef]
On the contrary, the following code will be removed for the gwt edition, but will be applied for any other:
// [ifndef gwt] instructions1; instructions2; // [enddef]
Now, imagine that the gwt edition requires a set of instructions that must not be be included in the unique source code. This code must be commented in the unique source code, but uncommented for the gwt edition. Let's introduce the "uncomment" keyword:
// [ifdef gwt] uncomment // instructions1; // instructions2; // [enddef]
Note that the "uncomment" keyword applies for both ifdef and ifndef block markers.
Finally, let's introduce the other available keywords. They aim at lighten the unique source code and get ride of the "enddef" blowk marker. At this time, three keywords are at disposal: member, method and instruction.
| Mime type | text/xml | ![]() | text/xml |
| File name | ![]() | ||
| Size (bytes) | 19551 | ![]() | 19778 |
|
Version 58 by Thierry Boileau
on 7/31/09 10:52:51 AM Name: Restlet editions Variant: main - en State: publish | ![]() |
Version 59 by Thierry Boileau
on 7/31/09 10:57:09 AM Name: Restlet editions Variant: main - en State: publish |