HadesLang Doc
Search…
Tools

Hades project initializer

The Hades project initializer pretty much does what the name implies. It initializes a Hades project, lets you choose a project template and lets you add packages through a CLI.

Example

Create without organization name
Create with organization name

Initialize the project

1
$ hades new demoproject demo
Copied!

The project structure will look like this

1
demo/ - Working name of the project
2
project.json - Contains the project configuration, initial data (config, connection keys, etc...) and meta-data of libraries installed via Hermes.
3
libs/ - Source files of libraries
4
src/ - Upper most directory for source files
5
demoproject/ - Project name
6
main.hd - Entrypoint
Copied!

Initialize the project

1
$ hades new demoproject.example.org demo
Copied!

The project structure will look like this

1
demo/ - Working name of the project
2
project.json - Contains the project configuration, initial data (config, connection keys, etc...) and meta-data of libraries installed via Hermes.
3
libs/ - Source files of libraries
4
src/ - Upper most directory for source files
5
org/ - Organization tld
6
example/ - Organization name
7
demoproject/ - Project name
8
main.hd - Entrypoint
Copied!

Hermes

Hermes is the Hades package manager. Similar to maven or nuget, Hermes has a package file which contains a list of dependencies. Hermes doesn't have its own dedicated package server, but uses Github (if not specified otherwise) as a package server instead. The version of a package specified in the project.json file translates to the git branch.

Examples

Add a package to your Hades project

1
$ hermes add hades/xml master
Copied!

project.json

A project.json file defines a Hades project. The project.json file contains meta-data of all packages installed through Hermes, initial data (like configuration or connection keys), information about the project itself and even a basic pipeline to execute commands/scripts before and after the execution of a Hades project.
1
{
2
"name" : "demoproject", // name of the project
3
"version" : "0.1", // version of the project
4
5
"config" : { // initial config/connectionkeys of the project
6
"motd" : "Hello world",
7
"logo" : "resources/logo.png",
8
"default-lang" : "en-US",
9
"db1" : "Server=localhost;Database=demo;User Id=demo;Password=myPassword;"
10
},
11
12
"before-exec" : [ // will be executed before the project starts up
13
{
14
"execute" : "script/bash",
15
"target" : "install.sh"
16
},
17
{
18
"execute" : "command",
19
"target" : "kill $(lsof -t -i:8080)"
20
}
21
],
22
23
"after-exec" : [ // will be executed after the project has been killed
24
{
25
"execute" : "script/hades",
26
"target" : "clean.hd"
27
}
28
],
29
30
"dependencies" : [ // dependencies installed via Hermes
31
{
32
"name" : "hades/web",
33
"version" : "3.2.4",
34
"from" : "github.com"
35
},
36
{
37
"name" : "hades/json",
38
"version" : "master",
39
"from" : "github.com"
40
},
41
{
42
"name" : "hades/xml",
43
"version" : "master",
44
"from" : "github.com"
45
}
46
]
47
}
Copied!
Last modified 2yr ago