doc: added steps to build and debug romraider in VSCode

This commit is contained in:
Walter S 2020-02-07 21:38:43 -05:00
parent 08f8c20de8
commit 344607fac5
2 changed files with 96 additions and 0 deletions

22
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)-ECUExec<romraider>",
"request": "launch",
"mainClass": "com.romraider.ECUExec",
"projectName": "romraider"
},
{
"type": "java",
"name": "Debug (Launch)-EcuLoggerExec<romraider>",
"request": "launch",
"mainClass": "com.romraider.logger.ecu.EcuLoggerExec",
"projectName": "romraider"
}
]
}

View File

@ -0,0 +1,74 @@
Here are steps to setup Visual Studio Code to build and debug Romraider.
1) Download Git for your operating system: https://git-scm.com/downloads
a) You'll use git to clone the Romraider repository.
2) Download a Java OpenJDK 8 32bit version, several options are available: RedHat, Oracle, Adopt, etc. I use AdoptOpenJdk 8 just because I don't to register to download it.
a) https://developers.redhat.com/products/openjdk/download?extIdCarryOver=true&sc_cid=701f2000000RWTnAAO
b) https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=openj9
c) When installing if there's a option to set JAVA_HOME variable, have the installer it. You may have to do it manually later Adopt lets you set this during OpenJDK install.
3) Download ANT: https://ant.apache.org/bindownload.cgi
a) 1.10.7 release - requires minimum of Java 8 at runtime
b) Unzip ANT to a known location. For example, I use windows and decided on: 'C:\Users\<USERNAME>\ANT'
4) Add 'ANT_HOME' as a System Environment variable execluding the quotes.
a) For the value use the unzipped ANT path from the previous step. For Example: 'C:\Users\<USERNAME>\ANT'
b) If you do not know how to add a environment variable, see: https://docs.oracle.com/javase/tutorial/essential/environment/paths.html
5) Edit the existing 'PATH' System Environment, add the file directory you unzipped ANT to with the bin directory appended. For Example: 'C:\Users\<USERNAME>\ANT\bin'
6) Download & Install 'Visual Studio Code': https://code.visualstudio.com/
7) Download & Install 'Java Extension Pack' VsCode Extension: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack
8) Optional: Download & Install 'Ant Target Runner' Extension: https://marketplace.visualstudio.com/items?itemName=nickheap.vscode-ant
9) Open the Romraider folder in VS Code. Ensure the Explorer panel is open. 'View Menu > Explorer'
10) Open the terminal window 'View Menu > Terminal'
a) Type the following and press enter: ant all
b) Alternately, you can use the 'Ant Target Runner' panel, it should be underneath the files list. Right click the 'all' node and select 'Run Ant Target'
c) *You will need to do one of the above each time you make a code change.*
11) Open the Debug Panel. 'View Menu > Debug'
12) On the debug panel, click the 'create and launch.json file' link. You may get a popup asking for Environment select Java. This will generate a launch.json file and open it.
13) When this file is generated, you'll need to delete all but two json entries. You want to keep ECUExec and EcuLoggerExec. The end result should look similar to below.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)-ECUExec<romraider>",
"request": "launch",
"mainClass": "com.romraider.ECUExec",
"projectName": "romraider"
},
{
"type": "java",
"name": "Debug (Launch)-EcuLoggerExec<romraider>",
"request": "launch",
"mainClass": "com.romraider.logger.ecu.EcuLoggerExec",
"projectName": "romraider"
}
]
}
11) At the top of the debug panel, you'll see a label 'Run And Debug' and a drop down box.
a) From the dropdown box select the appropriate option depending on whether you want to debug Romraider Editor or Romraider Logger.
b) Press the play button next to the dropdown or press F5.
c) You will likely get a popup: 'Build failed, do you want to continue?' Click Proceed.
d) Romraider should launch.
12) If you're still here, Congrats! You are now able to debug Romroader. You can set breakpoints in the source code, and step through the code.
13) If the steps above didn't work, please review them to make sure you didn't miss anything. If it still doesn't work contact me via my github account below.
Thanks,
Walter Stypula
https://github.com/walterstypula