blob: 2042a660c01601688586513eeec2b7cfb03fe317 (
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
|
---
title: Ein erstes Projekt
description: Ein Tala-Projekt in wenigen Zeilen schreiben, dann bauen, starten, formatieren und prüfen.
---
<!-- SPDX-FileCopyrightText: 2026 Progmasoft <support@progmasoft.com> -->
<!-- SPDX-License-Identifier: AGPL-3.0-or-later WITH AdditionRef-Progmasoft-Patent-Grant-1.1 -->
Ein Projekt ist ein Ordner mit einer Projektdatei. Seine Quellen sind die `.tala`-Dateien unter `Sources/`, und `entry`
nennt die Klasse, deren `public static void Main()` das Programm startet.
```kotlin [BUILD.kts]
project {
name = "Example"
}
sources {
executable {
entry = "Example.Program"
}
}
```
```tala [Sources/Main.tala]
namespace Example;
public class Program {
public static void Main() {
Console.Println("Hello from Tala!");
}
}
```
## Bauen und starten
```bash [terminal]
tazel build
tazel run -- first second
```
`tazel build` schreibt `build/debug/Example`, unter Windows `Example.exe`. `tazel run` baut das Programm und startet
es; was nach `--` folgt, geht ungelesen an das Programm. Ein zweites `tazel build` ohne Änderung meldet das Ziel als
aktuell und startet keinen Compiler.
## Formatieren und prüfen
```bash [terminal]
tazel fmt -- --check
tazel lint -- --fix
```
Optionen nach `--` gehen an talafmt und talalint, also meldet `tazel fmt -- --check` nur, und `tazel lint -- --fix`
wendet die Korrekturen an, die es kann.
::note
ViGet liefert keine Tala-Pakete aus. Ein Projekt, das eine Abhängigkeit des Builds deklariert, Bibliotheksziele und die
Erstellung von `.vipkg` werden mit Namen und Exit-Code 1 abgelehnt.
::
Weiter: jeder Block der [Projektdatei](/docs/reference/project-file) und jeder [Befehl](/docs/reference/commands).
|