MPROMEditor now calls its columns "Opcode" and "muPC"
[Mograsim.git] / docs / building_mograsim.md
1 # Building Mograsim
2
3 These is a very basic instruction set for building Mograsim from source. 
4
5 It assumes you know nothing about Eclipse Plug-In development, Maven, or Git.
6
7 **Note: Mograsim in built automatically by GitLab CI, packaging the repository only 
8 requires one extra **
9
10 ## Prerequisites
11
12 - [Java JDK](http://jdk.java.net/) 11 or later (or [Oracle Implementation](https://www.oracle.com/technetwork/java/javase/downloads/index.html))
13 - [Eclipse](https://www.eclipse.org/downloads/) 2019-03 or later (TODO: do earlier versions work?)
14 - _(optional)_ [Git](https://git-scm.com/downloads)
15
16 ## Install PDE (Plugin Development Environment)
17
18 1. In Eclipse, click on "Help" -> "Install New Software...".
19 2. Next to "Work With:", select "The Eclipse Project Updates".
20 3. Tick "Eclipse PDE Plug-in Developer Resources" (expand "Eclipse Plugin Development 
21    Tools" or type "PDE" in the search bar to see it).
22 4. Click on "Next >" two times, read and accept the license, and click on "Finish".
23 5. Wait for the installation to complete (may take a while). When prompted, restart 
24    Eclipse.
25
26 ## Clone the Git repository and import the projects
27
28 Can be done via Git or via EGit (Eclipse Git).
29
30 ### a) via EGit
31
32 1. In Eclipse, click on "Window" -> "Show View" -> "Other...".
33 2. Select "Git Repositories" (expand "Git" to see it); click on "Open".
34 3. In the "Git Repositories" view, click on "Clone a Git repository".
35 4. Enter the repository URL ("Host", "Repository path", and "Protocol" should fill 
36    automatically); click on "Next >".
37 5. Select only "master"; click on "Next >".
38 6. Enter the directory you want the Mograsim projects to be saved in.
39 7. Tick "Clone submodules" and "Import all existing Eclipse projects after clone 
40    finishes"; click on "Finish".
41
42 ### b) via Git (requires Git to be installed)
43
44 1. In a command prompt (Terminal on Linux; git-bash on Windows), execute `git clone 
45    --recurse-submodules --single-branch -b master <repository URL> <target directory>`.
46 2. _(optional)_ Import the repository in Eclipse:
47     1. In Eclipse, open the "Git Repositories" view as described in the first two 
48        steps in **a)**.
49     2. In the "Git Repositories" view, click on "Add an existing local Git repository".
50     3. Enter the directory of the repository and tick the repository you see in the 
51        list below; click on "Add". (If there is another repository ending with "SWTHelper", 
52        ignore it).
53 3. Import the projects into the workspace:
54     1. Click on "File" -> "Import...".
55     2. Select "Existing Projects into Workspace" (expand "General" to see it); click 
56        on "Next >".
57     3. Tick "Select root directory:" and "Search for nested projects".
58     4. Next to "Select root directory:", enter the directory of the repository; click 
59        on "Finish".
60
61 Note: After importing the projects, probably an automatic workspace build will start. 
62 Wait for it to finish before continuing.
63
64 ## Build the Update Site
65
66 1. In the project explorer or package explorer, right-click on "net.mograsim", click 
67    on "Run As" -> "Maven build...".
68 2. Make sure to run Maven with JDK 11
69 3. Next to "Goals", enter "clean verify"; click on "Run" and wait for it to finish 
70    (this will take a while).
71 4. Select all projects, right-click, and click on "Refresh".
72
73 The update site now should be built and is located in net.mograsim.plugin.updatesite/target/repository. 
74 In there you should see, among other files, a folder named "features", a folder named 
75 "plugins" containing some jar files, and two jar files called "artifacts.jar" and 
76 "content.jar".
77
78 To install Mograsim from this site, follow the [Getting Started](getting_started.md) guide,
79 but in the dialog for adding a software site, instead of using the online update site address,
80 click on "Local..." and select `<repository directory>/releng/net.mograsim.plugin.updatesite/target/repository/`.
81
82 More information about the build, structure and environment can be found in the [development environment description](development_environment.md).