forked from museumsvictoria/nodel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: added "building from scratch" doco; better integration of grun…
…t and lodash into nodel-webui-js component
- Loading branch information
1 parent
c8c94d7
commit a83e91c
Showing
3 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# Building from scratch | ||
* **gradle** is the primary build tool for the main Java project (runs on **Java**) | ||
* **grunt** (runs on **Node.js**, installed via **npm**) is used by the **nodel-webui-js** project component | ||
|
||
The steps below describe usage on both Windows and Linux | ||
* The example refers to **Windows** | ||
* The section further below shows complete example for **Linux** | ||
|
||
--- | ||
|
||
## STEP 1: ENSURE PRIMARY DEPENDENCIES ARE PRESENT | ||
1. **Java JDK 8**, see [latest versions](https://adoptopenjdk.net/releases.html) | ||
* latest Windows [OpenJDK8U-jdk_x64_windows_hotspot_8u242b08.zip](https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_windows_hotspot_8u242b08.zip) | ||
* latest Linux [OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz](https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz) | ||
2. **Node.js**, see [latest versions](https://nodejs.org/en/download/) | ||
* latest Windows [node-v12.16.2-win-x64.zip](https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip) | ||
* latest Linux [node-v12.16.2-linux-x64.tar.xz](https://nodejs.org/dist/v12.16.2/node-v12.16.2-linux-x64.tar.xz) | ||
3. **Git**, see [latest versions](https://git-scm.com/download) | ||
* latest Windows [PortableGit-2.26.0-64-bit.7z.exe](https://github.com/git-for-windows/git/releases/download/v2.26.0.windows.1/PortableGit-2.26.0-64-bit.7z.exe) | ||
* Linux install `apt-get install git` | ||
|
||
* all support "portable" installation, examples here are extracted to `C:\Apps` | ||
|
||
## STEP 2: ENSURE SECONDARY DEPENDENCIES ARE 'INSTALLED' | ||
* ensure primary dependencies, above, are on path, e.g. on Windows: | ||
```bat | ||
set PATH=%PATH%;C:\Apps\node-v12.16.2-win-x64;C:\Apps\git\bin;C:\Apps\jdk8u242-b08\bin | ||
``` | ||
* install **grunt** and **lodash** into the "global" location (sits alongside **Node.js** binaries) | ||
* `npm install -g grunt-cli lodash-cli` | ||
|
||
## STEP 3: ENSURE REPOSITORY IS CLONED | ||
* ensure primary dependencies, above, are on path (see example in STEP 2, above) | ||
* then Clone! e.g. cloning into `c:\temp\nodel-build` directory: | ||
```bat | ||
git clone https://github.com/museumsvictoria/nodel c:\temp\nodel-build | ||
``` | ||
|
||
## STEP 4: EXECUTE BUILD | ||
* Build! Example, from the `c:\temp\nodel-build` directory: | ||
```bat | ||
cd c:\Temp\nodel-build | ||
gradlew build | ||
``` | ||
* check `nodel-jyhost/build/distributions/standalone` directory for binary release e.g. `nodelhost-dev-2.2.1-rev407.jar` | ||
|
||
--- | ||
|
||
**Full example using clean Linux environment¹** | ||
|
||
```bash | ||
# download and extract Java | ||
wget https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u242-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz | ||
tar xf OpenJDK8U-jdk_x64_linux_hotspot_8u242b08.tar.gz | ||
# ends up in ./jdk8u242-b08 | ||
|
||
# download and extract Node.js (and npm) | ||
wget https://nodejs.org/dist/v12.16.2/node-v12.16.2-linux-x64.tar.xz | ||
tar xf node-v12.16.2-linux-x64.tar.xz | ||
# ends up in ./node-v12.16.2-linux-x64 | ||
|
||
# (git is normally already available) | ||
|
||
# adjust PATH | ||
export PATH=$PATH:~/jdk8u242-b08/bin/:~/node-v12.16.2-linux-x64/bin/ | ||
|
||
# install 'grunt' and 'lodash' in "global" location | ||
npm install -g grunt-cli lodash-cli | ||
|
||
# quickly verify versions of all dependencies | ||
java -version | ||
# e.g. >> openjdk version "1.8.0_242" | ||
node --version | ||
# e.g. >> v12.16.2 | ||
git version | ||
# e.g. >> git version 2.25.1 | ||
grunt --version | ||
# e.g. >> grunt-cli v1.3.2 | ||
lodash --version | ||
# e.g. >> 4.17.5 | ||
|
||
# clone repo | ||
git clone https://github.com/museumsvictoria/nodel nodel-build | ||
|
||
# execute full build | ||
cd ~/nodel-build | ||
./gradlew build | ||
|
||
# check output (standalone JAR file) | ||
ls ~/nodel-build/nodel-jyhost/build/distributions/standalone/ | ||
|
||
# run Nodel (optional) | ||
java -jar ~/nodel-build/nodel-jyhost/build/distributions/standalone/nodelhost-dev-2.2.1-rev407.jar -p 0 | ||
``` | ||
|
||
**Source update, clean and build re-run** | ||
``` | ||
cd ~/nodel-build | ||
git pull | ||
./gradlew clean | ||
# or | ||
git clean -fxd | ||
./gradlew build | ||
``` | ||
|
||
**Full cleanup** | ||
```bash | ||
rm -fr ~/jdk8u242-b08 | ||
rm -fr ~/node-v12.16.2-linux-x64 | ||
rm -fr ~/nodel-build | ||
``` | ||
|
||
--- | ||
¹ For OSX, adjust to suit. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters