Skip to content

Commit dedba3d

Browse files
authored
Documentation - Add more tips to CONTRIBUTING.md (#4611)
* DOCS: Mention forcing dev mode off in CONTRIBUTING.md and building emmylua from source * DOCS: Add more tips * FIX: Spelling and typos. Mention adding java path in settings.json
1 parent d44e59e commit dedba3d

File tree

1 file changed

+74
-27
lines changed

1 file changed

+74
-27
lines changed

CONTRIBUTING.md

Lines changed: 74 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,49 @@ You can now use the shortcut to run the program from the repository. Running the
7474
* While in the Tree tab, holding `Alt` also highlights nodes that have unrecognised modifiers.
7575
* Holding `Ctrl` while launching the program will rebuild the mod cache.
7676

77-
Note that automatic updates are disabled in Dev Mode, so you must update manually.
77+
Note that automatic updates are disabled in Dev Mode.
78+
79+
### Forcing Dev Mode OFF when using dev branch
80+
81+
Sometimes you may need to force Dev mode OFF when running from the dev branch to debug a specific part of Path of Building (e.g. the update system).
82+
83+
To do so [comment out Line 54 to line 58](./src/Launch.lua#L54-L58) of the [Launch.lua](./src/Launch.lua) file:
84+
```
85+
--if localManXML and not self.versionBranch and not self.versionPlatform then
86+
-- -- Looks like a remote manifest, so we're probably running from a repository
87+
-- -- Enable dev mode to disable updates and set user path to be the script path
88+
-- self.devMode = true
89+
--end
90+
```
91+
92+
and create a valid mainfest.xml file in the ./src directory. Then run the `./runtime/Path{space}of{space}Building.exe` as usual. You should get the typical update popup in the bottom left corner.
93+
94+
The manifest.xml file deserves its own in depth document, but usually copying from release and editing accordingly works well enough.
95+
96+
## Keeping your fork up to date
97+
98+
Note: This tutorial assumes that you are already familiar with Git and basic command line tools.
99+
100+
Note: If you've configured a remote already, you can skip ahead to step 3.
101+
102+
1. Add a new remote repository and name it `upstream`.
103+
104+
git remote add upstream https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
105+
2. Verify that adding the remote worked.
106+
107+
git remote -v
108+
3. Fetch all branches and their commits from upstream.
109+
110+
git fetch upstream
111+
4. Check out your local `dev` branch if you haven't already.
112+
113+
git checkout dev
114+
5. Merge all changes from `upstream/dev` into your local `dev` branch.
115+
116+
git rebase upstream/dev
117+
6. Push your updated branch to GitHub.
118+
119+
git push -f origin dev
78120

79121
## Setting up a development environment
80122

@@ -86,7 +128,11 @@ They are all free and support [EmmyLua](https://github.com/EmmyLua), a Lua plugi
86128
It is recommended to use it over the built-in Lua plugins.
87129

88130
Please note that EmmyLua is not available for other editors based on Visual Studio Code,
89-
such as [VSCodium](https://vscodium.com) or [Eclipse Theia](https://theia-ide.org).
131+
such as [VSCodium](https://vscodium.com) or [Eclipse Theia](https://theia-ide.org) but can be built from source if needed.
132+
133+
Note that you will need to have java installed to use emmyLua, and have either the JAVA_HOME environment variable correctly setup or have the path to java added to the `settings.json` file. Example:
134+
135+
```"emmylua.java.home": "C:/Program Files (x86)/Java/jre1.8.0_201/"```
90136

91137
### Visual Studio Code
92138

@@ -106,6 +152,26 @@ dbg.tcpListen("localhost", 9966)
106152
5. Start Path of Building Community
107153
6. Attach the debugger
108154

155+
#### Excluding directories from emmyLua
156+
157+
Depending on the amount of system ram you have available and the amount that gets assigned to the jvm running the emmylua language server you might run into issues when trying to debug Path of building.
158+
Files in /Data /Export and /TreeData can be massive and cause the emmyLua language server to use a significant amount of memory. Sometimes causing the language server to crash. To avoid this and speed up initialization consider adding an `emmy.config.json` file to the .vscode folder in the root of the Path of building repository with the following content:
159+
160+
```
161+
{
162+
"source": [
163+
{
164+
"dir": "../",
165+
"exclude": [
166+
"src/Export/**.lua",
167+
"src/Data/**.lua",
168+
"src/TreeData/**.lua"
169+
]
170+
}
171+
]
172+
}
173+
```
174+
109175
### PyCharm Community / IntelliJ Idea Community
110176

111177
1. Create a new "Debug Configuration" of type "Emmy Debugger(NEW)".
@@ -115,6 +181,12 @@ dbg.tcpListen("localhost", 9966)
115181
5. Start Path of Building Community
116182
6. Attach the debugger
117183

184+
#### Miscellaneous tips
185+
If you're on windows, consider downloading [git for windows](https://git-scm.com/downloads) and installing git bash. Git bash comes with a variety of typical linux tools such as grep that can make navigating the code base much easier.
186+
187+
If you're using linux you can run the ./runtime/Path{space}of{space}Building.exe executable with wine. You will need to provide a valid wine path to the emmy lua debugger directory.
188+
189+
118190
## Testing
119191

120192
PoB uses the [Busted](https://olivinelabs.com/busted/) framework to run its tests. Tests are stored under `spec/System` and run automatically when a PR is modified.
@@ -143,31 +215,6 @@ Docker alternative:
143215
1. Add the new build XML (if applicable) to the `TestBuilds` folder
144216
2. Run `docker-compose up -d` to generate a LUA file that contains the current stats of that build and run the tests
145217

146-
## Keeping your fork up to date
147-
148-
Note: This tutorial assumes that you are already familiar with Git and basic command line tools.
149-
150-
Note: If you've configured a remote already, you can skip ahead to step 3.
151-
152-
1. Add a new remote repository and name it `upstream`.
153-
154-
git remote add upstream https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
155-
2. Verify that adding the remote worked.
156-
157-
git remote -v
158-
3. Fetch all branches and their commits from upstream.
159-
160-
git fetch upstream
161-
4. Check out your local `dev` branch if you haven't already.
162-
163-
git checkout dev
164-
5. Merge all changes from `upstream/dev` into your local `dev` branch.
165-
166-
git rebase upstream/dev
167-
6. Push your updated branch to GitHub.
168-
169-
git push -f origin dev
170-
171218
## Path of Building development tutorials
172219

173220
* [How are mods parsed?](docs/addingMods.md)

0 commit comments

Comments
 (0)