User Tools

Site Tools


crosswalk_development

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
crosswalk_development [2016/10/24 12:10] – kalaschnikowcrosswalk_development [2018/04/23 15:57] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Crosswalk development ======
 +
 +Here is described only development OF Crosswalk and NOT WITH Crosswalk. In other words: how do I build and develop Crosswalk package.
 +
 +===== Helpful paths =====
 +
 +/home/development/chromiumdev/crosswalk/src/xwalk/runtime/android/core_internal/src/org/xwalk/core/internal/XWalkViewInternal.java
 +
 +/home/development/chromiumdev/crosswalk/src/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera.java
 +
 +===== Helpful reading =====
 +
 +==== From Crosswalk project ====
 +
 +[[https://crosswalk-project.org/contribute/building_crosswalk.html|Building Crosswalk]]
 +
 +[[https://crosswalk-project.org/contribute/building_crosswalk/android_build.html|Android Build Instructions]]
 +
 +[[https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md|Better Android Build Instructions]] - better version of above
 +
 +[[https://crosswalk-project.org/contribute/building_crosswalk/tracking_branches.html|Tracking a different branch]]
 +==== From Chromium project ====
 +
 +[[http://www.chromium.org/developers/contributing-code|Contributing to Chromium]] - here is described how to make a Change List (CL) and upload it for review.  Apropos: [[http://stackoverflow.com/questions/11068659/what-is-a-changelist-in-intellij-idea|stackoverflow question about changelist]].
 +
 +[[https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md|Chromium Android Build Instructions]]
 +
 +[[https://www.chromium.org/developers/gn-build-configuration|GN build configuration]] 
 +
 +[[https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html|depot_tools tutorial]]
 +
 +[[http://www.chromium.org/developers/how-tos/get-the-code|How to get the code]]
 +
 +==== Misc ====
 +
 +[[https://github.com/crosswalk-project/chromium-crosswalk/tree/ee335c1f5e8887ae568a795962580d6dca069d34/media/capture/video/android/java/src/org/chromium/media|Github folder for package org.chromium.media]]
 +
 +===== Fetching sources =====
 +
 +The fetching procedure is described in [[https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up|depot_tools tutorial]]. Here is my short description.
 +
 +Fetch depot_tools:
 +
 +<code bash>
 +git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
 +</code>
 +
 +Add the path of depot_tools to PATH environment variable:
 +
 +<code bash>
 +export PATH=$PATH:/path/to/depot_tools
 +</code>
 +
 +
 +
 +After that go to an empty directory, where the source should be downloaded and fetch chromium for android:
 +
 +<code bash>
 +fetch android
 +</code>
 +
 +(''fetch chromium'' or ''fetch ios'' are possible too, but we need only android)
 +
 +
 +If you are on linux and fetching the code for the first time, then you’ll need to run:
 +
 +<code bash>
 +cd src && ./build/install-build-deps.sh
 +</code>
 +
 +And finally:
 +
 +<code bash>
 +gclient sync
 +</code>
 +
 +This will pull all dependencies of the Chromium src checkout. You will need to run this any time you update the main src checkout, including when you switch branches.
 +
 +
 +===== Crosswalk 23 and later. GN setup =====
 +
 +All things after the line were not done by me. Currently it is simply a "plan". 
 +
 +----
 +
 +The following is copied from [[https://crosswalk-project.org/contribute/building_crosswalk/android_build.html|Crosswalk - Android build instructions]]
 +
 +
 +In order to build Crosswalk, you need to have at least two lines in your settings to pull some default variables we set:
 +
 +<code bash>
 +# important: WITH 'src' at the line end (in the official guide without!) 
 +cd /path/to/crosswalk-checkout/src 
 +gn args out/Default
 +</code>
 +A text editor will be shown, where you must add the following line:
 +
 +<code bash>
 +import("//xwalk/build/android.gni")
 +target_os = "android"
 +</code>
 +
 +You can add other settings after this statement, such as is_debug = false for a release build or target_arch = "x64" to create a 64-bit IA build. By default, target_arch is set to arm, which creates a 32-bit ARM build.
 +
 +Once you have done this once, you can later call gn gen out/Default to just regenerate the ninja files based on your existing settings if you need to (most of the time, this will be done automatically for you when building).
 +
 +See Chromium's [[https://www.chromium.org/developers/gn-build-configuration|page about GN]] for more information, including other common settings.
 +
 +
 +===== Building Crosswalk =====
 +
 +Now we can build Crosswalk:
 +
 +<code bash>
 +cd C:\path\to\crosswalk-checkout\src
 +ninja -C YOUR-BUILD-DIR xwalk
 +</code>
 +
 +YOUR-BUILD-DIR can be freely choosen, for example: "out/Default".
 +
 +
 +===== Changed files =====
 +
 +Because of my wrong configuration (clang was enabled), so some files could not be compiled. This files were changed by me: 
 +
 +/home/development/chromiumdev/crosswalk/src/xwalk/runtime/browser/xwalk_content_browser_client.h\\ 
 +/home/development/chromiumdev/crosswalk/src/xwalk/runtime/browser/android/net/xwalk_url_request_job_factory.h\\ 
 +/home/development/chromiumdev/crosswalk/src/xwalk/extensions/common/android/xwalk_extension_android.h\\ 
 +/home/development/chromiumdev/crosswalk/src/xwalk/runtime/browser/android/xwalk_content.h\\ 
 +/home/development/chromiumdev/crosswalk/src/xwalk/runtime/browser/android/net/xwalk_url_request_job_factory.h\\ 
 +
 +
 +
 +<code bash>
 +</code>
 +
 +