Priori Tutorial 3 – Hello World

Step 1/5: Create a new project folder

Step 2/5: Set the new folder as the terminal working directory

C:\>cd C:\Users\user\Desktop\hello_priori

C:\Users\user\Desktop\hello_priori>

Step 3/5: Create a new project using the Priori Builder

Just run “haxelib run priori create” command

C:\Users\user\Desktop\hello_priori>haxelib run priori create

 __   __     __   __
|__| |__| | /  \ |__| |
|    |  \ | \__/ |  \ |

PRIORI BUILDER



>>> Running CREATE command


Creating new Project...

Project created on C:\Users\user\Desktop\hello_priori/


C:\Users\user\Desktop\hello_priori>

Step 4/5: Build your project using the Priori Builder

Just run “haxelib run priori build” command

C:\Users\user\Desktop\hello_priori>haxelib run priori build

 __   __     __   __
|__| |__| | /  \ |__| |
|    |  \ | \__/ |  \ |

PRIORI BUILDER




>>> Running BUILD command


1. Loading Libs...
------------------

- Loading PRIORI...
> Loading Priori data at C:\HaxeToolkit\haxe\lib\priori/0,7,1/\priori.json
> Template Assets found at C:\HaxeToolkit\haxe\lib\priori/0,7,1/\template

- Loading JQUERYEXTERN...
> JQUERYEXTERN is not a priori lib... Using as haxelib

- Loading C:\USERS\USER\DESKTOP\HELLO_PRIORI/...
> Loading Priori data at C:\Users\user\Desktop\hello_priori/\priori.json



2. Copying template Files...
----------------------------

- Creating build folder...
> Creating new output folder... DONE
> Copying assets from C:\HaxeToolkit\haxe\lib\priori/0,7,1/\template... DONE
> Creating index file... DONE



3. Generating javascript file from Haxe code...
-----------------------------------------------

- Running haxe command...
- haxe args: -lib jQueryExtern -lib priori -cp src -cp build\__temp_compiler -main Priori_auto_main_builder -js build\js\priori.js


- Build Success


C:\Users\user\Desktop\hello_priori>

Step 5/5: Run the builded project

Open the “build” folder and run the “index.html” file

Priori Tutorial 2 – Haxelib installation

Haxelib is the package manager for the Haxe Toolkit and you can find a lot of libraries that you can use at http://lib.haxe.org.

Step 1/2: Install Priori Lib

Just run the command “haxelib install priori” at your terminal.

C:\>haxelib install priori

Downloading priori-0,7,1.zip...
Download complete : 720251 bytes in 2.5s (276.1KB/s)
Installing priori...
Current version is now 0.7.1
Done
Installing dependency jQueryExtern 3.0.0
Downloading jQueryExtern-3,0,0.zip...
Download complete : 30522 bytes in 0.8s (34.6KB/s)
Installing jQueryExtern...
Current version is now 3.0.0
Done

C:\>

Step 2/2: Check the lib installation

If you run the command “haxelib list”, you can check all installed libs. You may find “priori” and “jQueryExtern” libraries.

C:\>haxelib list
jQueryExtern: [3.0.0]
priori: [0.7.1]

C:\>

 

At this point, you have learned to install all Priori library (and any other library). Well done!

Priori Tutorial 1 – Haxe Installation

Step 1/4: Download Haxe

Download Haxe at http://haxe.org/download. The “installer” version is the easy way!

Step 2/4: Install downloaded file

Just run the installation and follow the instructions.

Step 3/4: Check the installation.

Open your terminal and check the commands:

> haxe
C:\>haxe
Haxe Compiler 3.4.2 (git build master @ 890f8c7) - (C)2005-2017 Haxe Foundation
Usage : haxe.exe -main [-swf|-js|-neko|-php|-cpp|-cppia|-as3|-cs|-java|-python|-hl|-lua] [options]
Options :
-cp : add a directory to find source files
-js : compile code to JavaScript file
...

> haxelib
C:\>haxelib
Haxe Library Manager 3.3.0 - (c)2006-2016 Haxe Foundation
Usage: haxelib [command] [options]
Basic
install : install a given library, or all libraries from a hxml file
update : update a single library (if given) or all installed libraries
remove : remove a given library/version
...

> neko
C:\>neko
NekoVM 2.1.0 (c)2005-2016 Haxe Foundation
Usage : neko <file>

Step 4/4: Setup haxelib

Just run “haxelib setup” and config the source path (or choose the default value).

C:\>haxelib setup
Please enter haxelib repository path with write access
Hit enter for default (C:\HaxeToolkit\haxe\lib)
Path :_