wiki:en/sources
developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Version 2 (modified by laurentj, 9 years ago) (diff)

--

Working with jelix sources

These are important informations for those who want to contribute or to retrieve sources directly from the repository.

Principles

Sources stored in the subversion repository are not ready to be performed by PHP. There are some preprocessing instructions in some php files, so, sources should be parsed by a preprocessor in order to be used by PHP. This preprocessing instruction allow to build packages for some specific PHP configurations, or some specific jelix editions.

So, here is the process :

  1. get sources of jelix from the subversion repository (svn checkout)
  2. create an ini file which contains options for the builder
  3. launch the build/buildjelix.php script by giving the ini file, then you have in an other directory the php files of jelix
  4. copy this files into your application, or package them etc..

For a contributeur of course he will do :

  1. gets sources of jelix from the subversion repository (svn checkout)
  2. makes modification in sources (bug fix, new feature..)
  3. creates an ini file which contains options for the builder
  4. launches the build/buildjelix.php script by giving the ini file
  5. in the target directory, he have the php files of jelix : he can test jelix.
  6. when it works well, he send a patch or commit his modification.

Getting sources

We use Subversion to store sources of jelix and to follow the history of modifications. So you have to install a subversion client on your machine. Then you can access to the repository by giving the address of the repository to subversion commands.

For "anonymous" contributors, the address is:

   http://svn.jelix.org/jelix/trunk

For contributors who have the right to commit into the repository :

   svn+ssh://svnjelix@svn.jelix.org/jelix/trunk

Note: the username to give is always "svnjelix". The server recognize automatically your real login with your ssh key.

So, in a command line, you type

svn checkout http://svn.jelix.org/jelix/trunk

ou

svn checkout svn+ssh://svnjelix@svn.jelix.org/jelix/trunk

Directories

The 'trunk' directory contains latest improvements for the next major release, and the 'branches' directory contains a directory for each minor releases. In this directory, we only fix bugs. No major new features are commited in them.

The directories you find in this directories are:

  • build: the scripts to build jelix sources
  • ext: the extension for PHP (in C language), for the gold edition of Jelix
  • lib: all the files of jelix itself
  • temp: temporary directory for the testapp application
  • testapp: an application which contains all unit tests, and some example

How to build

After you retrieve the sources, you need to "build" jelix. There is a script, build/buildjelix.php, which do this build. this is like a "makefile", and it takes a ini file name as a first parameter. This ini file contains options for the build. You have some examples of this files into build/config/.

Building

Before doing modifications, you should prepare an working environment: a directory where the built files of jelix will be stored. In this "target" directory, you could use jelix in your applications. Example:

Your local copy of the subversion repository could be at:

   /home/laurent/projects/jelix/svn/ 

And the target directory where you will have usable files:

   /home/laurent/projects/jelix/tests/

Create a ini file mybuild.ini. You can copy from one of those which are in build/config, jelix-test.ini for example. It will contain this parameters:

MAIN_TARGET_PATH = /home/laurent/projects/jelix/tests/
EDITION_NAME = 
PHP_VERSION_TARGET =

ENABLE_PHP_FILTER =
ENABLE_PHP_JSON =
ENABLE_PHP_XMLRPC =
ENABLE_PHP_JELIX =
WITH_BYTECODE_CACHE = auto

ENABLE_DEVELOPER = 1

STRIP_COMMENT = 
ENABLE_OPTIMIZED_SOURCE = 

PACKAGE_TAR_GZ = 
PACKAGE_ZIP = 

TARGET_REPOSITORY = 

You can have a full list of availabled parameters by doing:

  php build/buildjelix.php -h

To generate the sources:

  php build/buildjelix.php mybuild.ini

If you want to build the testapp application, use an other provided script, build/buildapp.php with an other ini file, (see build/config/testapp-test.ini)

  php build/buildapp.php mytestapp.ini

Note: Of course, you should run the build after each modification in the sources of jelix, on order to test this changes.

Generating a package

The principle is the same as previous. You just have to indicate a directory where the packages will be generated, and you have to activate the flags (PACKAGE_TAR_GZ and/or PACKAGE_ZIP) in your ini file (mypackages.ini for example).

MAIN_TARGET_PATH = /home/laurent/projects/jelix/dist/
EDITION_NAME = 
PHP_VERSION_TARGET =

ENABLE_PHP_FILTER =
ENABLE_PHP_JSON =
ENABLE_PHP_XMLRPC =
ENABLE_PHP_JELIX =
WITH_BYTECODE_CACHE = auto

ENABLE_DEVELOPER = 1
STRIP_COMMENT = 
ENABLE_OPTIMIZED_SOURCE = 

PACKAGE_TAR_GZ = 1
PACKAGE_ZIP = 1

And then:

  php build/buildjelix.php mypackages.ini