Changes between Version 3 and Version 4 of WebKitGTK/StartHacking

Jun 19, 2013 8:45:07 AM (8 years ago)
Andres Gomez

Added rebuild and testing


  • WebKitGTK/StartHacking

    v3 v4  
    36 == Getting the code ==
     36== Getting the source ==
    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 ==
     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.
     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''.
     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:
     96$ Tools/Scripts/update-webkitgtk-libs
     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:
     102$ Tools/jhbuild/jhbuild-wrapper --gtk buildone -f cairo
     105The result of building the dependencies will be placed under ''WebKitBuild/Dependencies''.
     107Similarly, if we have peformed changes in the code, in BuildingGtk we have seen that the script to perform a build is:
     110$ Tools/Scripts/build-webkit --gtk
     113Now, if we want just to manuall build our changes or only certain targets, we can get into the ''jhbuild'' environment with
     116$ Tools/jhbuild/jhbuild-wrapper --gtk shell
     119And manually invoke ''make'':
     122$ cd WebKitBuild/Release
     123$ make
     126Or, if we just want to rebuild MiniBrowser:
     129$ cd WebKitBuild/Release
     130$ make Programs/MiniBrowser
     134=== Keeping up to date ===
     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.
     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.
     141=== Testing ===
     143WebKit provides a really complete set of tets to check the code and your changes. You can get more information about them in WebKitGtkLayoutTests.
     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.
     147 * To run GtkLauncher:
     150$ Tools/Scripts/run-launcher --gtk
     152 * To run @MiniBrowser@ (WebKit2):
     155$ Tools/Scripts/run-launcher --gtk -2
     158Of course, this can be done also manually from the ''jhbuild'' shell:
     161$ Tools/jhbuild/jhbuild-wrapper --gtk shell
     162$ WebKitBuild/Release/Programs/GtkLauncher &
     163$ WebKitBuild/Release/Programs/MiniBrowser &