From 344607fac56aad11f1e6f438c18bc29ab9db8a81 Mon Sep 17 00:00:00 2001 From: Walter S Date: Fri, 7 Feb 2020 21:38:43 -0500 Subject: [PATCH] doc: added steps to build and debug romraider in VSCode --- .vscode/launch.json | 22 +++++++++++ Building_RomRaider_VSCode.txt | 74 +++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 Building_RomRaider_VSCode.txt diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..de7fa5b9 --- /dev/null +++ b/.vscode/launch.json @@ -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", + "request": "launch", + "mainClass": "com.romraider.ECUExec", + "projectName": "romraider" + }, + { + "type": "java", + "name": "Debug (Launch)-EcuLoggerExec", + "request": "launch", + "mainClass": "com.romraider.logger.ecu.EcuLoggerExec", + "projectName": "romraider" + } + ] +} \ No newline at end of file diff --git a/Building_RomRaider_VSCode.txt b/Building_RomRaider_VSCode.txt new file mode 100644 index 00000000..70b7b73e --- /dev/null +++ b/Building_RomRaider_VSCode.txt @@ -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\\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\\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\\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", + "request": "launch", + "mainClass": "com.romraider.ECUExec", + "projectName": "romraider" + }, + { + "type": "java", + "name": "Debug (Launch)-EcuLoggerExec", + "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 \ No newline at end of file