Changes

Jump to navigation Jump to search
3,969 bytes removed ,  6 years ago
m
Line 123: Line 123:  
If you want to know what you can do to start or help Dolibarr development, read instead chapter [[Developer_FAQ#How_to_be_an_official_developer]]. If you already read it and want to distribute a patch, this chapter is for you.
 
If you want to know what you can do to start or help Dolibarr development, read instead chapter [[Developer_FAQ#How_to_be_an_official_developer]]. If you already read it and want to distribute a patch, this chapter is for you.
   −
== With a GIT account ==
+
For the moment, GIT write access are restricted to Yoda only ([[Developer FAQ#How to be an official developer]] for information on different grade). Because you probably don't have this role (your grade is [[Developer FAQ#Soldier|Jedi]] or [[Developer FAQ#Soldier|Admiral]] or [[Developer FAQ#Soldier|Soldier]]), it is necessary to use the fork feature of GitHub. Then you can make a "Pull Request" from GitHub to ask to have your patch merged into develop branch.
For the moment, GIT write access are restricted (number of commits is already active). If you have this access, you can use it, but if and only if you use it to commit changes you are granted to with your developer grade (See [[Developer FAQ#How to be an official developer]] for information on different grades).
  −
If you don't have GIT write access (your grade is [[Developer FAQ#Soldier|Soldier]]), it is necessary to use the fork feature of GitHub. Then you can make a "Pull Request" from GitHub to ask to have your patch merged into develop branch.
  −
 
  −
== With no GIT account ==
  −
With no GIT write access, it is necessary to generate and send by mail a patch file to the developer mailing-list '''dolibarr-dev''' ({{TemplateURLMLDev}}). This is how to generate a patch file:
  −
 
  −
''For all OS:'' [[Image:Logo_windows.png|20px]] [[Image:Logo_ubuntu.png|20px]] [[Image:Logo_apple.png|20px]]
  −
 
  −
This is the ''best method'' to work to build such a patch file:
  −
 
  −
- First, you must have a directory containing last reference version of Dolibarr (the result of a GIT update or simply the files resulting of uncompressing a dolibarr.tgz snapshot). We will call this directory '''old_dir'''. You can get this snapshot for current development version on [http://www.dolibarr.org/downloads/ Dolibarr official web site in download area - development version]. Warning: You must get "last development source code" and not "last stable version code" to build your patch, or your patch will be obsolete before you start to work on it !
  −
 
  −
- Then, you must have a second directory, from same source, that will contains Dolibarr directories, in which you will make all you files. We will call this directory '''new_dir'''.
  −
 
  −
To build the patch file, you must launch the '''diff''' command (available on all Linux, provided with [http://www.cygwin.org/cygwin cygwin] under Windows) with the following command:
  −
<source lang="bash">
  −
diff -BNaur --exclude=CVS --exclude="*.patch" --exclude=".#*" --exclude="*~" --exclude="*.rej"
  −
    --exclude="*.orig" --exclude="*.bak" --exclude=conf.php --exclude=documents 
  −
    old_dir new_dir  > mypatch.patch
  −
</source>
  −
 
  −
A ksh script to run this command is available in directory '''build/patch'''.
  −
Send your patch on Dev Mailing List to the address '''dolibarr-dev@nongnu.org''' (after subscribing to it).
  −
Inclusion of your patch is however not guaranted, no more than delay. But if patch is realized strictly with using this process, there is a very important probability (near 100%) that it will be at least "tested" (if patch is not done this way, chance are simply null).
  −
 
  −
''For Windows:'' [[Image:Logo_windows.png|20px]]
  −
 
  −
If you work on Windows, another method (not so nice than previous) is also possible. Install the open source compare tools called Winmerge (this tool is able to build patch with format ''diff -Naur''). Then compare with WinMerge the reference file and modified file and choose in menu ''"Tools - Generate patch"''. Add an output filename like ''"mypatch.patch"'', click on box ''"Append"'' and choose option ''"Format Unified"''. Then click on ''"Ok"''.
  −
Eventually restart for each modified file.
  −
Finally, you will get a file ''mypatch.patch'' that contains all changes with goode format.
  −
 
  −
''Test/Apply a patch''
  −
 
  −
If you want to apply a patch file on an old version to have a new one modified by the path file, this is possible with the '''patch''' tool.
  −
Imagine you have on non modified version somewhere on a server. Put you patch file into the root directory. Go into this root directory then launch the command:
  −
<source lang="bash">
  −
patch -u -p0 -d . < mypatch.patch
  −
</source>
  −
<nowiki>For information: -p0 is to use full path of files defined in patch file to locate them on your disk (-pn will remove the n first levels of directories)
  −
-d define the relative path do directory to patch.
  −
< is to provide source file name to use (patch must have format previsouly defined)
  −
-u is to tell that patch has unified format</nowiki>
  −
 
  −
''Send patch by mail''
  −
 
  −
Once patch file is built and successfully tested, you must submit file to the Dolibarr mailing list '''dolibarr-dev''' (See here for this {{TemplateURLMLDev}}).
  −
This mailing list is read by most Dolibarr developers, however we can't say when patch will be processed nor that if it will be included. It depends on quality of patch and priorities of moment. Some patches are added several months after beeing subimtted.
      
= How to package and deploy a module =
 
= How to package and deploy a module =

Navigation menu