OLD | NEW |
(Empty) | |
| 1 # GYP Hacking |
| 2 |
| 3 Note that the instructions below assume that you have the Chromium |
| 4 [depot tools](http://dev.chromium.org/developers/how-tos/depottools) |
| 5 installed and configured. |
| 6 If you don't, you do not pass go, and you cannot collect your $200. |
| 7 |
| 8 ## Getting the sources |
| 9 |
| 10 Best is to use git to hack on anything, you can set up a git clone of GYP |
| 11 as follows: |
| 12 |
| 13 ``` |
| 14 git clone https://chromium.googlesource.com/external/gyp.git |
| 15 cd gyp |
| 16 git svn init --prefix=origin/ -T trunk http://gyp.googlecode.com/svn/ |
| 17 git config --replace-all svn-remote.svn.fetch trunk:refs/remotes/origin/master |
| 18 git svn fetch |
| 19 ``` |
| 20 |
| 21 At this point you should get a quick stream of output as git-svn rebuilds |
| 22 it's SVN version->SHA1 database: |
| 23 |
| 24 ``` |
| 25 Rebuilding .git/svn/refs/remotes/origin/master/... |
| 26 r1 = 880a7f243635258fa4938bb7ebf9b4d5f46e3e48 |
| 27 r2 = 24a2a4ceedce0ae16d0a107d9898e4828775c633 |
| 28 r3 = 41276136692399ac4bb84c6664d02384fcad70ad |
| 29 ``` |
| 30 |
| 31 If you get slow trickling output with a bunch of file names as such: |
| 32 |
| 33 ``` |
| 34 r1 = 880a7f243635258fa4938bb7ebf9b4d5f46e3e48 (refs/remotes/git-svn) |
| 35 A xc.py |
| 36 ``` |
| 37 |
| 38 then these instructions are out of date, and you're re-downloading |
| 39 the entire version history from SVN. Please update these instructions |
| 40 once you've figured out what's up. |
| 41 |
| 42 If you intend to commit your changes back to the GYP SVN repository, |
| 43 you need to configure git-svn's commit url. |
| 44 |
| 45 ``` |
| 46 git config svn-remote.svn.commiturl https://gyp.googlecode.com/svn/trunk |
| 47 ``` |
| 48 |
| 49 ## Testing your change |
| 50 |
| 51 GYP has a suite of tests which you can run with the provided test driver |
| 52 to make sure your changes aren't breaking anything important. |
| 53 |
| 54 You run the test driver with e.g. |
| 55 |
| 56 ``` |
| 57 python gyptest.py |
| 58 python gyptest.py test/win # Only run Windows-related tests. |
| 59 python gyptest.py -a -f ninja # Only run ninja-related tests. |
| 60 ``` |
| 61 |
| 62 See [Testing](Testing) for more details on the test framework. |
| 63 |
| 64 Note that it can be handy to look at the project files output by the tests |
| 65 to diagnose problems. The easiest way to do that is by kindly asking the |
| 66 test driver to leave the temporary directories it creates in-place. |
| 67 This is done by setting the enviroment variable "PRESERVE", e.g. |
| 68 |
| 69 ``` |
| 70 set PRESERVE=all # On Windows |
| 71 export PRESERVE=all # On saner platforms. |
| 72 ``` |
| 73 |
| 74 ## Reviewing your change |
| 75 |
| 76 All changes to GYP must be code reviewed before submission, GYP uses rietveld. |
| 77 |
| 78 Upload your change with: |
| 79 |
| 80 ``` |
| 81 git cl upload |
| 82 ``` |
| 83 |
| 84 ## Submitting |
| 85 |
| 86 Once you're ready to submit, you can use the GYP try bots to test your change |
| 87 with e.g. |
| 88 |
| 89 ``` |
| 90 git try |
| 91 ``` |
| 92 |
| 93 Once the change has been approved (LGTMed) and passes trybots, you can submit |
| 94 it with: |
| 95 |
| 96 ``` |
| 97 git cl dcommit |
| 98 ``` |
| 99 |
| 100 To be allowed to submit, you will need committer rights in the project, and |
| 101 your password for the SVN server. You can get that password here: |
| 102 https://code.google.com/hosting/settings |
OLD | NEW |