codekingpro/portable-devtools
115k
1# Hacking
2
3## Getting the sources
4
5Git is required to hack on anything, you can set up a git clone of GYP
6as follows:
7
8```
9mkdir foo
10cd foo
11git clone git@github.com:nodejs/gyp-next.git
12cd gyp
13```
14
15(this will clone gyp underneath it into `foo/gyp`.
16`foo` can be any directory name you want. Once you've done that,
17you can use the repo like anything other Git repo.
18
19## Testing your change
20
21GYP has a suite of tests which you can run with the provided test driver
22to make sure your changes aren't breaking anything important.
23
24You run the test driver with e.g.
25
26``` sh
27$ python -m pip install --upgrade pip
28$ pip install --editable ".[dev]"
29$ python -m pytest
30```
31
32See [Testing](Testing.md) for more details on the test framework.
33
34Note that it can be handy to look at the project files output by the tests
35to diagnose problems. The easiest way to do that is by kindly asking the
36test driver to leave the temporary directories it creates in-place.
37This is done by setting the environment variable "PRESERVE", e.g.
38
39```
40set PRESERVE=all # On Windows
41export PRESERVE=all # On saner platforms.
42```
43
44## Reviewing your change
45
46All changes to GYP must be code reviewed before submission.
47 