OLD | NEW |
1 # Building PDFium | 1 # PDFium |
2 | 2 |
3 ## Prerequisites | 3 ## Prerequisites |
4 | 4 |
5 Get the chromium depot tools via the instructions at | 5 Get the chromium depot tools via the instructions at |
6 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides | 6 http://www.chromium.org/developers/how-tos/install-depot-tools (this provides |
7 the gclient utilty needed below). | 7 the gclient utilty needed below). |
8 | 8 |
9 Also install Python, Subversion, and Git and make sure they're in your path. | 9 Also install Python, Subversion, and Git and make sure they're in your path. |
10 | 10 |
11 Optionally, you may want to install the [Ninja](http://martine.github.io/ninja/) | |
12 build system (recommended) rather than using your platform-specific build | |
13 system. | |
14 | |
15 ## Get the code | 11 ## Get the code |
16 | 12 |
17 ``` | 13 ``` |
18 mkdir pdfium | 14 mkdir pdfium |
19 cd pdfium | 15 cd pdfium |
20 gclient config --name . --unmanaged https://pdfium.googlesource.com/pdfium.git | 16 gclient config --name . --unmanaged https://pdfium.googlesource.com/pdfium.git |
21 gclient sync | 17 gclient sync |
22 ``` | 18 ``` |
23 | 19 |
24 ## Generate the build files | 20 ## Generate the build files |
25 | 21 |
26 Now we use the GYP library to generate the build files. | 22 We use the GYP library to generate the build files. |
27 | 23 |
28 At this point, you have two options. The first option is to use the [Ninja] | 24 At this point, you have two options. The first option is to use the [Ninja] |
29 (http://martine.github.io/ninja/) build system. This is the default as of | 25 (http://martine.github.io/ninja/) build system (also included with the |
30 mid-September, 2015. Previously, the second option was the default. Most PDFium | 26 depot\_tools checkout). This is the default as of mid-September, 2015. |
31 developers use Ninja, as does our [continuous build system] | 27 Previously, the second option (platform-specific build files) was the default. |
| 28 Most PDFium developers use Ninja, as does our [continuous build system] |
32 (http://build.chromium.org/p/client.pdfium/). | 29 (http://build.chromium.org/p/client.pdfium/). |
33 | 30 |
34 On Windows: `build\gyp_pdfium | 31 * On Windows: `build\gyp\_pdfium` |
35 ` For all other platforms: `build/gyp_pdfium | 32 * For all other platforms: `build/gyp\_pdfium` |
36 ` | |
37 | 33 |
38 The second option is to generate platform-specific build files, i.e. Makefiles | 34 The second option is to generate platform-specific build files, i.e. Makefiles |
39 on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the | 35 on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the |
40 GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or | 36 GYP\_GENERATORS environment variable appropriately (e.g. "make", "msvs", or |
41 "xcode") before running the above command. | 37 "xcode") before running the above command. |
42 | 38 |
43 ## Building the code | 39 ## Building the code |
44 | 40 |
45 If you used Ninja, you can build the sample program by: `ninja -C out/Debug | 41 If you used Ninja, you can build the sample program by: `ninja -C out/Debug |
46 pdfium_test | 42 pdfium\_test` You can build the entire product (which includes a few unit |
47 ` You can build the entire product (which includes a few unit tests) by: `ninja | 43 tests) by: `ninja -C out/Debug`. |
48 -C out/Debug | |
49 ` | |
50 | 44 |
51 If you're not using Ninja, then building is platform-specific. | 45 If you're not using Ninja, then building is platform-specific. |
52 | 46 |
53 On Linux: `make pdfium_test | 47 * On Linux: `make pdfium\_test` |
54 ` | 48 * On Mac: `open build/all.xcodeproj` |
55 | 49 * On Windows: open build\all.sln |
56 On Mac, open build/all.xcodeproj | |
57 | |
58 On Windows, open build\all.sln | |
59 | 50 |
60 ## Running the sample program | 51 ## Running the sample program |
61 | 52 |
62 The pdfium\_test program supports reading, parsing, and rasterizing the pages of | 53 The pdfium\_test program supports reading, parsing, and rasterizing the pages of |
63 a .pdf file to .ppm output image files (windows supports two other formats, and | 54 a .pdf file to .ppm or .png output image files (windows supports two other |
64 .png support is available for all platforms in an alternate branch (see branches | 55 formats). For example: `out/Debug/pdfium\_test --ppm path/to/myfile.pdf`. Note |
65 section below)). For example: `out/Debug/pdfium_test --ppm path/to/myfile.pdf | 56 that this will write output images to `path/to/myfile.pdf.<n>.ppm`. |
66 ` | 57 |
| 58 ## Testing |
| 59 |
| 60 There are currently several test suites that can be run: |
| 61 |
| 62 * pdfium\_unittests |
| 63 * pdfium\_embeddertests |
| 64 * testing/tools/run\_corpus\_tests.py |
| 65 * testing/tools/run\_javascript\_tests.py |
| 66 * testing/tools/run\_pixel\_tests.py |
| 67 |
| 68 It is possible the tests in the `testing` directory can fail due to font |
| 69 differences on the various platforms. These tests are reliable on the bots. If |
| 70 you see failures, it can be a good idea to run the tests on the tip-of-tree |
| 71 checkout to see if the same failures appear. |
67 | 72 |
68 ## Waterfall | 73 ## Waterfall |
69 | 74 |
70 The current health of the source tree can be found at | 75 The current health of the source tree can be found at |
71 http://build.chromium.org/p/client.pdfium/console | 76 http://build.chromium.org/p/client.pdfium/console |
72 | 77 |
| 78 ## Community |
| 79 |
| 80 There are several mailing lists that are setup: |
| 81 |
| 82 * [PDFium](https://groups.google.com/forum/#!forum/pdfium) |
| 83 * [PDFium Reviews](https://groups.google.com/forum/#!forum/pdfium-reviews) |
| 84 * [PDFium Bugs](https://groups.google.com/forum/#!forum/pdfium-bugs) |
| 85 |
| 86 Note, the Reviews and Bugs lists are typically read-only. |
| 87 |
| 88 ## Bugs |
| 89 |
| 90 We will be using this |
| 91 [bug tracker](https://code.google.com/p/pdfium/issues/list), but for security |
| 92 bugs, please use [Chromium's security bug template] |
| 93 (https://code.google.com/p/chromium/issues/entry?template=Security%20Bug) |
| 94 and add the "Cr-Internals-Plugins-PDF" label. |
| 95 |
| 96 ## Contributing code |
| 97 |
| 98 For contributing code, we will follow |
| 99 [Chromium's process](http://dev.chromium.org/developers/contributing-code) |
| 100 as much as possible. The main exceptions are: |
| 101 |
| 102 1. Code has to conform to the existing style and not Chromium/Google style. |
| 103 2. There is no commit queue, approved committers can land their changes via |
| 104 `git cl land` |
| 105 3. Changes must be merged to the XFA branch as well (see below). |
| 106 |
73 ## Branches | 107 ## Branches |
74 | 108 |
75 There is a branch for a forthcoming feature called XFA that you can get by | 109 There is a branch for a forthcoming feature called XFA that you can get by |
76 following the steps above, then: `git checkout origin/xfa build/gyp_pdfium ninja | 110 following the steps above, then: |
77 -C out/Debug | |
78 ` | |
79 | 111 |
80 The XFA version of the sample pdfium\_test program supports rasterizing to .png | 112 ``` |
81 format files. For example: `out/Debug/pdfium_test --png path/to/myfile.pdf | 113 git checkout origin/xfa |
82 ` | 114 build/gyp_pdfium |
| 115 ninja -C out/Debug |
| 116 ``` |
| 117 |
| 118 Merging to XFA requires: |
| 119 |
| 120 ``` |
| 121 git checkout origin/xfa |
| 122 git checkout -b merge_branch |
| 123 git branch --set-upstream-to=origin/xfa |
| 124 git cherry-pick -x <commit hash> |
| 125 git commit --amend # add Merge to XFA |
| 126 git cl upload |
| 127 ``` |
| 128 |
| 129 Then wait for approval, and `git cl land` |
OLD | NEW |