aboutsummaryrefslogtreecommitdiff
path: root/documentation/book/the_lux_programming_language/appendix_h.md
blob: 2f83b846d13f79210608968dd75ef05f8f83ef8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Appendix H: Aedifex

Aedifex is a fairly basic build tool, but it offers the necessary commands to handle a normal Lux project.

It offers a small set of commands, and a few convenience features.

```
lux version

=>

00.06.05
```

This command tells you the version of Aedifex you're using.

This version is also the same as the version of the Lux compiler Aedifex has been designed to work with.

So, you can also think of this as being the version of the language that is best supported by Aedifex (although not necessarily the only version that is supported).

```
lux clean

=>

Successfully cleaned target directory: target
```

This command cleans up any compilation artifacts and caching artifacts left over by previous compilations/builds of your Lux project.

```
lux pom

=>

Successfully created POM file: pom.xml
```

This command generates a Maven POM file that reflects the contents of the `project.lux` file made for Aedifex.

```
lux deps

=>

[?] Fetching com.github.luxlang:lux-jvm-0.6.5 from "~/.m2/repository"
[O] Found com.github.luxlang:lux-jvm-0.6.5 at "~/.m2/repository"
 Local successes: 0: "com.github.luxlang:lux-jvm-0.6.5"
  Local failures: 
Remote successes: 
 Remote failures:
```

This commands fetches all dependencies from the available repositories (plus the local Maven repository/cache), and installs any dependencies that had to be fetched remotely into the local Maven repository/cache.

```
lux install

=>

Successfully installed the project locally.
```

This command packages your project into a TAR archive and installs it into the local Maven repository/cache, to be used as a dependency.

```
lux deploy <deploy_repository> <user_name> <password>

## For example:

lux deploy snapshots foo bar_baz_quux

=>

Successfully deployed the project.
```

This command packages your project into a TAR archive and deploys it to a remote Maven repository, to be used as a dependency.

```
lux build
```

This command build your project into an executable program, named `program.`(`jar`|`js`|`lua`|`py`|`rb`) depending on the chosen compilation target, and located under the target directory (`target` by default).

```
lux test
```

This command build your project into an executable program, and then executes it and display any STDOUT/STDERR logging output on the terminal/console.

This is the main mechanism to run automated tests for your Lux project.

```
lux auto build

## OR

lux auto test
```

This works the same as the normal versions of the command, but Aedifex also watches over the files in your source directories and every time a file changes, it automatically builds/tests the project for you.

This is extremely useful when fixing typing errors iteratively, or when debugging errors raised during your tests, as it saves you having to constantly re-build/re-run the project every time you want to try the latest changes.

```
lux with <profile> <command>

## For example:

lux with jvm with bibliotheca auto test
```

This command composes non-default profiles with the default one to generate the profile to use when executing a command.

This allows you to segregate useful configuration into different profiles and then combine them based on what you need at a given time.

---

Now that we have seen the available commands, it would be useful to see an annotated example `project.lux` file to see what bits of configuration it can contain.

```clojure
["" ... The empty text ("") is used to specify the default profile.
 [... An optional identity for the project.
  ... It can also be specified or overriden in a non-default profile.
  ... This will be the name given to the project when installed/deployed as a dependency.
  "identity" ["com.github.luxlang" "stdlib" "0.6.5"]

  ... Every piece of information, and the whole "info" bundle, are optional.
  "info" ["url" "https://github.com/LuxLang/lux"
          "scm" "https://github.com/LuxLang/lux.git"
          "licenses" [["name" "Lux License v0.1.1"
                       "url" "https://github.com/LuxLang/lux/blob/master/license.txt"
                       "type" "repo"]]
          ... "organization" [["name" "Lux Foundation"
          ...                  "url" "http://example.com/lux_foundation"]]
          "developers" [["name" "Eduardo Julian"
                         "url" "https://github.com/eduardoejp"
                         ... "organization" ["name" "Lux Foundation"
                         ...                 "url" "http://example.com/lux_foundation"]
                         ]]
          ... "contributors" [["name" "Eduardo Julian"
          ...                  "url" "https://github.com/eduardoejp"
          ...                  "organization" ["name" "Lux Foundation"
          ...                                  "url" "http://example.com/lux_foundation"]]]
          ]

  ... An optional list of repositories you can deploy to, given aliases so they're easy to refer to with the "deploy" command.
  "deploy_repositories" ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
                         "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]

  ... An optional list of repositories to use for fetching remote dependencies.
  ... Additionally, there is an implicit repository being used, which is https://repo1.maven.org/maven2/
  ... So, even if the "repositories" list were to be empty, you'd still have access to the default repository.
  "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
                  "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
  ... The different directories to look for source code. The default is described below.
  ... "sources" ["source"]
  ... The directory for storing the build artifacts. The default is described below.
  ... "target" "target"
  ]

 ... The following are alternative profiles to use in various situations.
 "jvm"
 [... "compiler" specifies the dependency to fetch and use as the compiler.
  "compiler" ["com.github.luxlang" "lux-jvm" "0.6.5" "jar"]
  ... "dependencies" is an optional list of dependencies to fetch.
  ... The dependencies have the same shape as when specifying the compiler.
  ... When omitting the packaging format of the dependency, "tar" will be assumed.
  ... "dependencies" [["org.ow2.asm" "asm-all" "5.0.3" "jar"]
  ...                 ["com.github.luxlang" "stdlib" "0.6.5"]]
  ... The OS command to use when running JVM tests. The default is described below.
  ... "java" ["java" "-jar"]
  ]

 "js"
 ["compiler" ["com.github.luxlang" "lux-js" "0.6.5" "js"]
  ... The OS command to use when running JS tests. The default is described below.
  ... "js" ["node" "--stack_size=8192"]
  ]

 "python"
 ["compiler" ["com.github.luxlang" "lux-python" "0.6.5" "jar"]
  ... The OS command to use when running Python tests. The default is described below.
  ... "python" ["python3"]
  ]

 "lua"
 ["compiler" ["com.github.luxlang" "lux-lua" "0.6.5" "jar"]
  ... The OS command to use when running Lua tests. The default is described below.
  ... "lua" ["lua"]
  ]

 "ruby"
 ["compiler" ["com.github.luxlang" "lux-ruby" "0.6.5" "jar"]
  ... The OS command to use when running Ruby tests. The default is described below.
  ... "ruby" ["ruby"]
  ]

 "bibliotheca"
 ["info" ["description" "Standard Library for the Lux programming language."]
  "test" "test/lux"]

 "scriptum"
 ["info" ["description" "Documentation for the Standard Library for the Lux programming language."]
  "program" "documentation/lux"
  "test" "documentation/lux"]

 "aedifex"
 ["info" ["description" "A build system/tool made exclusively for Lux."]
  ... Parent profiles to this one.
  ... Specifying them here is like automatically using Aedifex's "with" command.
  "parents" ["jvm"]
  ... The name of the main module of the program.
  "program" "program/aedifex"
  ... The name of the main module where the tests are located.
  "test" "test/aedifex"]]
```