- Use
npm ci
instead ofnpm install
- Do not call
npm update
unless you want to update all packages (and know what you are doing). This changes thepackage-lock.json
file. - Update TypeScript to the latest version using
npm install -g typescript@latest
(globally installs the latest TypeScript version)
- Clone Repository
- Open IntelliJ (but not the cloned project)
- File -> New -> Open from existing sources
- Choose
Maven
- If there is some IntelliJ which says
load maven configuration
, then click on it - Go to
'Maven tab'
- Press
Reload All Maven Projects
- Got to
OpenRobertaParent (root) -> Lifecycle
and clickclean
and theninstall
- Press
- Go to
Module Settings
- Go to
Project
and set theProjectSDK
toJava 1.8
- Go to
Modules -> OpenRobertaServer -> Dependencies
and set thescope
of all directories fromTest
toCompile
(the directories have not 'Maven' in their name and a folder symbol)
- Go to
- Open terminal and execute
./ora.sh create-empty-db
inopenroberta-lab
- Go to
OpenRobertaServer/src/main/java/de/fhg/iais/roberta/main/ServerStarter.java
and press the play button next to the declaration - In the
Run/Debug Configurations
(orRun -> Edit Configurations…
) set...- ... JDK or JRE to
java 8 1.8
- ... Module to
OpenRobertaServer
- ... CLI arguments to
-d server.staticresources.dir=./OpenRobertaServer/staticResources -d robot.crosscompiler.resourcebase=../ora-cc-rsc
- ... JDK or JRE to
- (Check again in
Module Settings
that all settings are still correct. If not, then set them again and proceed) - Then start the server by pressing the play button
- Open VSCode
File -> Open… -> 'openroberta-lab/TypeScriptSources'
Terminal -> New Terminal
- Setup TypeScript and other packages using the terminal
npm ci
installs all necessary packages
- Manual installation (normally not required)
npm install -g typescript
globally installs TypeScriptnpm install matter-js
installs matter.js which is the physics enginenpm install tslib
installs tslib which is the helper librarynpm install --save dat.gui
installs dat.guinpm install --save @types/dat-gui
installs typescript types for dat.gui
When changing something in openroberta-lab/TypeScriptSources/ts
in VSCode:
- In the terminal. Type and press enter:
tsc
which compiles the TypeScript source files toopenroberta-lab/OpenRobertaServer/staticResources/js/...
- If files were added/removed
- Open
openroberta-lab/OpenRobertaServer/staticResources/js/imports.js
- The second argument of
addPaths({...}, [...])
has to reflect the directory structure ofopenroberta-lab/OpenRobertaServer/staticResources/js/app/simulation/simulationLogic/
- Open
- When running
tsc
and the error occurs e.g.Cannot find module ...
you might have to executenpm install
first
When you want to add a new library using npm:
- Install the library using npm
- Copy the minified build of the library to
OpenRobertaServer/staticResources/js/libs/[library name]/[minified library js file]
- Add the library to
imports.js
in the first argument ofaddPaths({...}, [...])
When compiling TypeScript using tsc
Cannot find module ...
: Checkout the latest commit and runnpm ci
When compiling the server
- A java package cannot be found:
- Go to the
'Maven tab'
pressReload All Maven Projects
- Go to
Module Settings -> Modules -> OpenRobertaServer -> Dependencies
and set thescope
of all directories fromTest
toCompile
(the directories have not 'Maven' in their name and a folder symbol) - Recompile the project
- Go to the