summaryrefslogtreecommitdiff
path: root/doc/source/modifyingandtesting.rst
blob: 972f208f5bf38c9e9b3e126ab3c335629c537647 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
.. _modifyingandtesting:

Modifying and testing code
====

Creating a workspace
----

A work space is a seperate directory containing a copy of the project sourcecode.
This would usually be used when you want to modify and test your code, without changing the original.
This is very useful for trying out new patches and changes without risking loss of work.

This example assumes you have a project that can be built (Has the appropriate .bst files in place)
`Note: The project does not need to build sucessfully, only have the ability to build` 

If not, go to :ref:`buildproject`

In this example we be using `gedit.bst`, but this will work on any buildable project

----

From the root of the project directory run:

    ``bst`` :ref:`invoking_workspace` ``open gedit.bst workspace1``

In this case, that would be core/gedit.bst

This will create a copy of your project files in the declared directory

And give you an external copy of your project to work with.


Modifying code in the workspace
----

To modify the workspace copy of your project, you will have to move to the workspace directory

    ``cd workspace1``

Here you will see the output of your build.

Move to the sourcecode directory, in this case, gedit

    ``cd gedit/``

Using the text editing tool of your choice, you can now open these files and make any modifications that you wish.


Rebuilding the workspace project
----

Return to the root of your original project

And then rebuild the project as normal.

Buildstream will redirect itself to the workspace that you opened before

and build that instead of the original.


Verifying changes
----

You can now use the shell command from the project root to run your project again.

E.G:

    ``bst`` :ref:`invoking_shell` ``core/gedit``

You should now see any changes that you made.