Skip to content

Commit ef955a8

Browse files
committed
Split up editor docs
skip-ci
1 parent 590ae78 commit ef955a8

11 files changed

+327
-212
lines changed

README_BUILD.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,19 @@ The following platforms are supported:
4040

4141
Start by setting up the build environment:
4242

43-
$ ./scripts/build.py shell
43+
```sh
44+
$ ./scripts/build.py shell
45+
```
4446

4547
This will start a new shell with all of the required environment variables set (`DYNAMO_HOME` etc).
4648

4749
### STEP 2 - Install packages and SDKs
4850

4951
Next thing you need to do is to install external packages and download required platform SDKs:
5052

51-
$ ./scripts/build.py install_ext --platform=... --package-path=...
53+
```sh
54+
$ ./scripts/build.py install_ext --platform=... --package-path=...
55+
```
5256

5357
It is important that you provide the `--platform` option to let the `install_ext` command know which platform you intend to build for (the target platform). When the `install_ext` command has finished you will find the external packages and downloaded SDKs in `./tmp/dynamo_home/ext`.
5458

@@ -69,11 +73,15 @@ Due to licensing restrictions the SDKs are not distributed with Defold. You need
6973

7074
With the setup and installation done you're ready to build the engine:
7175

72-
$ ./scripts/build.py build_engine --platform=...
76+
```sh
77+
$ ./scripts/build.py build_engine --platform=...
78+
```
7379

7480
This will build the engine and run all unit tests. In order to speed up the process you can skip running the tests:
7581

76-
$ ./scripts/build.py build_engine --platform=... --skip-tests -- --skip-build-tests
82+
```sh
83+
$ ./scripts/build.py build_engine --platform=... --skip-tests -- --skip-build-tests
84+
```
7785

7886
Anything after `--` is passed directly as arguments to Waf. The built engine ends up in `./tmp/dynamo_home/bin/%platform%`.
7987

@@ -83,20 +91,26 @@ Anything after `--` is passed directly as arguments to Waf. The built engine end
8391

8492
When you are working on a specific part of the engine there is no need to rebuild the whole thing to test your changes. You can use Waf directly to build and test your changes (see Unit tests below for more information about running tests):
8593

86-
$ cd engine/dlib
87-
$ waf
94+
```sh
95+
$ cd engine/dlib
96+
$ waf
97+
```
8898

8999
You can also use rebuild a specific part of the engine and create a new executable:
90100

91-
# Rebuild dlib and sound modules and create a new executable
92-
$ ./scripts/submodule.sh x86_64-darwin dlib sound
101+
```sh
102+
# Rebuild dlib and sound modules and create a new executable
103+
$ ./scripts/submodule.sh x86_64-darwin dlib sound
104+
```
93105

94106
---
95107

96108
## Unit tests
97109

98110
Unit tests are run automatically when invoking waf if not `--skip-tests` is specified. A typically workflow when working on a single test is to run:
99111

100-
$ waf --skip-tests && ./build/default/.../test_xxx
112+
```sh
113+
$ waf --skip-tests && ./build/default/.../test_xxx
114+
```
101115

102116
With the flag `--test-filter=` it's possible to run a single test in the suite, see [jctest documentation](https://jcash.github.io/jctest/api/03-runtime/#command-line-options)

README_ENGINE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
The engine source code can be found in the `/engine` folder. The source code is divided into a number of different modules/folders:
66

7+
### Build process
8+
9+
[Build instructions for the engine are here](/README_BUILD.md).
10+
711
### Engine libraries
812

913
To see the actual, ordered, list of engine libraries, look for `ENGINE_LIBS` in [./scripts/build.py](./scripts/build.py), and also add `dlib`, and `texc` to that list.

README_SETUP.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
(Setup instructions for the editor [here](/editor/README.md)).
44

5-
* macOS - [Setup instructions](/README_SETUP_MACOS.md)
6-
* Windows - [Setup instructions](/README_SETUP_WINDOWS.md)
7-
* Linux - [Setup instructions](/README_SETUP_LINUX.md)
5+
* macOS - [Setup instructions](README_SETUP_MACOS.md)
6+
* Windows - [Setup instructions](README_SETUP_WINDOWS.md)
7+
* Linux - [Setup instructions](README_SETUP_LINUX.md)

editor/README.md

Lines changed: 10 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -1,200 +1,22 @@
11
# Defold Editor
22

3-
## Requirements
4-
* [Java 11](https://jdk.java.net/11/) ([installation instructions](#installing-jdk11) - Note that we do not yet officially support development with a newer version of Java than 11.
5-
* Leiningen ([install instructions](#install-leiningen))
3+
## Overview
4+
Editor overview [here](README_SYSTEMS_OVERVIEW.md).
65

7-
## Installing JDK 11
8-
### macOS
9-
10-
* Download the [macOS](https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz) version and extract it
11-
* Run `sudo cp -R <path-to-extracted-folder>/jdk-11.0.2.jdk /Library/Java/JavaVirtualMachines/`
12-
* Verify that the jdk version is available by running `/usr/libexec/java_home -V`
13-
* Switch to the new version by running `/usr/libexec/java_home -v 11.0.2`
14-
15-
### Linux
16-
17-
* Download [Linux](https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz) version and extract it somewhere
18-
* Run `sudo update-alternatives --install "/usr/bin/java" "java" "/path/to/jdk/bin/java" 1102`
19-
* Run `sudo update-alternatives --install "/usr/bin/javac" "javac" "/path/to/jdk/bin/javac" 1102`
20-
* If require, switch to new version using `sudo update-alternatives --config java` and `sudo update-alternatives --config javac`
21-
22-
### Notes
23-
24-
If you are using IntelliJ for lein tasks, you will need to first add the new SDK (file->project structure/SDKs)
25-
and then set the project SDK setting (file->project structure/Project) to the new version.
26-
27-
## Installing Leiningen
28-
### Windows
29-
30-
First of all, follow the Windows instructions in [Defold Readme](../README.md)
31-
32-
* Start `msys.bat` as described
33-
* Download the [lein.sh script](https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein) from [Leiningen.org](http://leiningen.org) Put it somewhere in your (msys) path - if you're lazy, put it in `C:\MinGW\msys\1.0\bin`. You might need to `chmod a+x lein.sh`.
34-
* Run `lein` in the `editor` subdirectory
35-
This will attempt to download leiningen and dependencies to your home directory.
36-
37-
- If this fails with message
38-
39-
Could not find or load main class clojure.main
40-
41-
Try pointing your `HOME` environment variable to your “windows home”. For instance change it from `/home/Erik.Angelin` (msys) to `/c/Users/erik.angelin`:
42-
43-
export HOME="/c/Users/erik.angelin"
44-
45-
The problem seems to be that the (windows) java class path points to an invalid home directory.
46-
47-
- If this fails because the github certificate cannot be verified:
48-
49-
export HTTP_CLIENT='wget --no-check-certificate -O'
50-
51-
### macOS/Linux
52-
53-
* Install Leiningen `brew install leiningen`
546

557
## Setup
56-
* Open a terminal/console and change directory to `defold`.
57-
58-
`cd defold`
59-
60-
* Setup the shell environment (consider putting it in an alias in your bash profile):
61-
62-
`./scripts/build.py shell --platform=...`
63-
64-
* Run install_ext for the correct platform:
65-
66-
`./scripts/build.py install_ext --platform=...`
67-
68-
* Build the engine:
69-
70-
`./scripts/build.py build_engine --platform=... --skip-tests -- --skip-build-tests`
71-
72-
* Build builtins:
73-
74-
`scripts/build.py build_builtins`
75-
76-
* Build reference documentation:
77-
78-
`scripts/build.py build_docs`
79-
80-
* Build Bob:
81-
82-
`scripts/build.py build_bob --skip-tests`
83-
84-
* Change directory to the editor directory
85-
86-
`cd editor`
87-
88-
* Run:
89-
90-
`lein init`
8+
(Setup instructions for the engine [here](../README_SETUP.md)).
919

92-
## Cursive IDE Setup
93-
Some of the remaining instructions are about EMACS. If instead you want to use the Cursive IDE, read the [Cursive setup guide](README_CURSIVE.md).
10+
* macOS - [Setup instructions](README_SETUP_MACOS.md)
11+
* Windows - [Setup instructions](README_SETUP_WINDOWS.md)
12+
* Linux - [Setup instructions](README_SETUP_LINUX.md)
9413

95-
## Running Tests
96-
`lein test` will run all the tests including the integration tests.
14+
If you want to use the Cursive IDE, read the [Cursive setup guide](README_CURSIVE.md).
9715

98-
If you are using a repl, you can also run the tests by calling `(suite/suite)`.
9916

100-
## Setup NREPL for debugging
17+
## Build and debug/REPL
18+
Build and debug/REPL instructions [here](README_BUILD.md).
10119

102-
If you want to work on the editor chances are you want to `connect` or `jack-in` to a REPL as described below.
103-
104-
For this to work you will need a `~/.lein/profiles.clj` file and put the nREPL, Cider (etc) dependencies there;
105-
106-
```
107-
{:user {:plugins [[cider/cider-nrepl "0.10.2"]
108-
[refactor-nrepl "1.1.0" :exclusions [org.clojure/clojure]]]
109-
:dependencies [[org.clojure/tools.nrepl "0.2.12"]]}}
110-
```
111-
112-
Please note that Lein will introduce a nREPL dependency automagically, but its a good idea to override to your preferred version here anyway.
113-
114-
## Running the Editor
115-
`lein run` will launch the editor as well as providing a nrepl port
116-
for you to jack into
117-
118-
## Building the Editor
119-
120-
Use `scripts/bundle.py` to produce a bundled version of the editor.
121-
122-
There are a few different scenarios in which you might want to build the editor locally:
123-
124-
- Local editor sources, archived engine artifacts based on HEAD:
125-
- `./scripts/bundle.py --platform=x86_64-win32 --version=1.2.3.4 --engine-artifacts=archived`
126-
- This will fetch engine and launcher artifacts using the `HEAD` revision.
127-
- Local editor sources, archived engine artifacts based on a different revision:
128-
- `./scripts/bundle.py --platform=x86_64-win32 --version=1.2.3.4 --engine-artifacts=archived-stable`
129-
- This will fetch engine and launcher artifacts using the latest stable revision and is handy if you are on a branch where no engine artifacts have been archived.
130-
- Local editor sources, local engine artifacts, local launcher:
131-
- `./scripts/bundle.py --platform=x86_64-win32 --version=1.2.3.4 --engine-artifacts=dynamo-home`
132-
- This will use local engine artifacts from `$DYNAMO_HOME`, with the exception of the launcher.
133-
- Local editor sources, archived engine artifacts, local launcher:
134-
- `./scripts/bundle.py --platform=x86_64-win32 --version=1.2.3.4 --engine-artifacts=archived --launcher ../tmp/dynamo_home/bin/x86_64-darwin/launcher`
135-
- This will fetch engine artifacts using the `HEAD` revision.
136-
137-
138-
## Jacking into a REPL
139-
140-
You can also use `M-x cider-jack-in` or launch the editor inside Cursive for debugging with breakpoints etc.
141-
142-
First set the environment variable `DYNAMO_HOME`. Example of a value `/Users/martin/work/defold/tmp/dynamo_home`.
143-
144-
After you jacked in do the following to load and start the app;
145-
146-
```
147-
user=> (dev)
148-
dev=> (go)
149-
```
150-
151-
## Running Benchmarks
152-
`lein benchmark` will run the benchmarks and put the results to the
153-
`test/benchmark/bench-result.txt` file. Make sure to have everything
154-
on your system closed down
155-
156-
## Generating the docs
157-
Running `lein doc` will generate the codox to the target/docs directory
15820

15921
## Styling
160-
A single stylesheet is set on the root node (by convention) in the scene. The stylesheet `editor.css` is loaded as a regular java resource, from the uberjar or from the file-system in dev-mode. If an `editor.css` is found in the current working directory that file will take precedence over the aforementioned java resource.
161-
162-
The stylesheet can be reloaded with the function key `F5`.
163-
164-
The `editor.css` stylesheet is generated from the the sass/scss files in `styling/stylesheets`. To generate the file you can use either leiningen or gulp:
165-
166-
**leiningen**
167-
168-
- `lein sass once` to generate once
169-
- `lein sass watch` to watch and re-generate css on changes
170-
171-
**nodejs**
172-
173-
In the `styling` directory:
174-
- `npm install`
175-
176-
- `gulp` to generate once
177-
- `gulp watch` to watch and re-generate css on changes
178-
179-
See `styling/README.md` for details.
180-
181-
182-
### JavaFX Styling
183-
184-
The best way to understand how JavaFX styling works is by studying the default stylesheet `modena.css` included in `jfxrt.jar`
185-
186-
## Bundling games and running in browser
187-
188-
As a temporary solution, we use Bob (from Editor1) as the content pipeline for bundling and running in the browser. In order to setup Bob locally, you need to:
189-
190-
- Build the engine for the specific platform, e.g. `python scripts/build.py build_engine --platform=js-web --skip-tests -- --skip-build-tests`
191-
- For android, you also need to `build_go` through `build.py` to obtain `apkc`
192-
- Build Bob with local artifacts, `python scripts/build.py build_bob`
193-
- `lein init`, which will install `bob.jar` as a local maven package
194-
195-
## Using a local bob.jar
196-
197-
When developing it can be convenient to use a local bob.jar instead of the one bundled with the editor. This can by adding `,-Ddefold.dev=true` to the end of the `vmargs =` field of the editor config.
198-
199-
* On macOS the config is inside the application file: `Defold.app/Contents/Resources/config`
200-
* On Windows and Linux the config file is located next to the Defold executable.
22+
Editor styling documentation [here](README_STYLING.md).

0 commit comments

Comments
 (0)