Skip to content

Commit

Permalink
Merge pull request #6 from gogoprog/feature-dist_scripts
Browse files Browse the repository at this point in the history
Feature dist scripts
  • Loading branch information
gogoprog authored Dec 5, 2016
2 parents 510a84a + 9358679 commit 074a213
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 14 deletions.
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,51 @@ A game framework that combines Haxe, Ash, HTML5 and Urho3D.

### Distribution release

The distributed release provides an emscripten build of the gengine.
A local http server is used to run the applications.

#### Requirements

* [python3](https://www.python.org/downloads/)
* [haxe](https://haxe.org/download/)

#### Commands

Go to the directory containing the extracted files and start the environment :

cd path/to/extracted/files/
./start.sh
##### Helpers

Those are the scripts located at the root of the gengine distributed release.

./gengine.sh
# Activates the gengine commands

This will activate the environment and enable the gengine-run command :
./gengine-compile.(bat/sh) [path-to-your-application]
# Compiles the application haxe code.

./gengine-run.(bat/sh) [path-to-your-application]
# Compiles and runs the local server

##### gengine commands

gengine-run [path-to-your-application-code]
gengine-compile [path-to-your-application]
# To compile your Haxe code

This will start a local server running your application.
gengine-run [path-to-your-application]
# To compile and run the local server

### Development

Activate the gengine environment :

source path/to/gengine/scripts/activate

First time build including Urho3D :

gengine-build --urho3d [-d] [--html5] [path-to-your-application-code]

Next times build :

gengine-build [-d] [--html5] [path-to-your-application-code]

Build and run on native platforms :

gengine-run [-d] [path-to-your-application-code]

gengine-run [-d] [path-to-your-application-code]
6 changes: 6 additions & 0 deletions scripts/dist/gengine-compile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set GENGINE_DISTRIBUTED=1
set GENGINE=%~dp0

cd %GENGINE%
python scripts/gengine-compile %1
pause
9 changes: 9 additions & 0 deletions scripts/dist/gengine-compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

export GENGINE_DISTRIBUTED=1
export GENGINE=$(readlink -e .)
export PATH=${GENGINE}/scripts:${PATH}

pushd $1

${SHELL} -c 'gengine-compile'
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions scripts/gengine-gen-dist
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ shutil.copytree(common.rootPath + "/deps/common/Ash-Haxe/src", distDir + "/deps/
os.makedirs(distDir + "/src")
shutil.copytree(common.rootPath + "/src/haxe", distDir + "/src/haxe")

shutil.copy2(common.rootPath + "/scripts/dist/start.sh", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/start-server.sh", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/start-server.bat", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/gengine.sh", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/gengine-run.sh", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/gengine-run.bat", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/gengine-compile.sh", distDir)
shutil.copy2(common.rootPath + "/scripts/dist/gengine-compile.bat", distDir)

os.chdir(distDir)
version = input("Enter version: ")
Expand Down

0 comments on commit 074a213

Please sign in to comment.