Changes between Version 3 and Version 4 of WebKitGTK/StartHacking


Ignore:
Timestamp:
Jun 19, 2013 8:45:07 AM (8 years ago)
Author:
Andres Gomez
Comment:

Added rebuild and testing

Legend:

Unmodified
Added
Removed
Modified
  • WebKitGTK/StartHacking

    v3 v4  
    3434
    3535
    36 == Getting the code ==
     36== Getting the source ==
    3737
    3838This is already explained in the BuildingGtk section and the instructions to use Git in UsingGitWithWebKit but, trying to give straight commands, you most probably would like to use Git as your revision control tool. WebKit actually uses SVN for its official revision control tool but tons of developers use Git and its usage is well supported.
     
    8787== Rebuilding ==
    8888
     89As you code new features and fix bugs you will need to rebuild the sources or dependencies. You have to be careful if you don't want to waste time. You don't want compiled code to be swiped by mistake given the time that it takes to build it.
    8990
     91The build result is located in the ''WebKitBuild'' directory. ''Release'' builds will be place under ''WebKitBuild/Release''' while Debug builds will be placed under ''WebKitBuil/Debug''.
     92
     93As you should know by now, building dependencies will typically be gotten with the help of ''jhbuild''. The default command for this, as explained in BuildingGtk is:
     94{{{
     95#!sh
     96$ Tools/Scripts/update-webkitgtk-libs
     97}}}
     98
     99This command will clean current dependencies tree. Therefore, if you only want to perform an action on a certain module it would be better to do it directly using jhbuild. For example:
     100{{{
     101#!sh
     102$ Tools/jhbuild/jhbuild-wrapper --gtk buildone -f cairo
     103}}}
     104
     105The result of building the dependencies will be placed under ''WebKitBuild/Dependencies''.
     106
     107Similarly, if we have peformed changes in the code, in BuildingGtk we have seen that the script to perform a build is:
     108{{{
     109#!sh
     110$ Tools/Scripts/build-webkit --gtk
     111}}}
     112
     113Now, if we want just to manuall build our changes or only certain targets, we can get into the ''jhbuild'' environment with
     114{{{
     115#!sh
     116$ Tools/jhbuild/jhbuild-wrapper --gtk shell
     117}}}
     118
     119And manually invoke ''make'':
     120{{{
     121#!sh
     122$ cd WebKitBuild/Release
     123$ make
     124}}}
     125
     126Or, if we just want to rebuild MiniBrowser:
     127{{{
     128#!sh
     129$ cd WebKitBuild/Release
     130$ make Programs/MiniBrowser
     131}}}
     132
     133
     134=== Keeping up to date ===
     135
     136WebKit development happens at a high speed. Most of the changes won't have a real impact on the feature or bug you are actually fixing while usually would mean rebuilding huge parts of the code. Therefore, it is better not to rebase master to our working branch too often.
     137
     138Usually, you would want to rebase your work only when you have completed the task, but be also aware of parallel work that may affect your code. Plan ahead when you'll have a free slot of time in which to rebase and compile again as it will probably take several minutes.
     139
     140
     141=== Testing ===
     142
     143WebKit provides a really complete set of tets to check the code and your changes. You can get more information about them in WebKitGtkLayoutTests.
     144
     145In addition, you may want to check your changes in an actual application. WebKit provides a dummy browser in which to do so. GTK+ port actually has GtkLauncher, featuring WebKit1 and MiniBrowser, featuring WebKit2.
     146
     147 * To run GtkLauncher:
     148{{{
     149#!sh
     150$ Tools/Scripts/run-launcher --gtk
     151}}}
     152 * To run @MiniBrowser@ (WebKit2):
     153{{{
     154#!sh
     155$ Tools/Scripts/run-launcher --gtk -2
     156}}}
     157
     158Of course, this can be done also manually from the ''jhbuild'' shell:
     159{{{
     160#!sh
     161$ Tools/jhbuild/jhbuild-wrapper --gtk shell
     162$ WebKitBuild/Release/Programs/GtkLauncher &
     163$ WebKitBuild/Release/Programs/MiniBrowser &
     164}}}