Logo

index : jinit

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/jinit.git/html/templates/lib/rules_lib.jai blob: 1923ae9bb1198b6dfa1dddd1a3a2d89561e6f3c7 [raw] [clear marker]

        
0/*
1
2If you're looking the first time into those files, I recommend
3to view the documentation at `templates/minimal/rules_minimal.jai` first.
4
5This template is a special one, because it contains a
6placeholder: `__RENAME_PLACEHOLDER__`
7
8Which you can replace via `jinit -t lib -r foo_bar`.
9
10You can place the placeholder inside those places:
11- Your `template.jai`
12- rules.dirs_in_workplace
13- rules.files
14
15You cannot place it in `rules.template`, because this pathstring gets
16replaced with the template at compile time.
17
18*/
19
20
21() -> Rules {
22 gitignore :: #string STR_END
23# Jai
24.build
25/bin
26 STR_END;
27
28 main_jai :: #string STR_END
29#import "Basic"()(
30 MEMORY_DEBUGGER = MEMORY_DEBUGGER_ENABLED
31);
32#import "__RENAME_PLACEHOLDER__";
33
34
35main :: () {
36 #if MEMORY_DEBUGGER_ENABLED defer report_memory_leaks();
37
38 log("Hello from test.jai");
39
40 f();
41}
42
43 STR_END;
44
45 lib_jai :: #string STR_END
46#import "Basic";
47
48
49f :: () {
50 log("Hello from lib");
51}
52
53 STR_END;
54
55 module_jai :: #string STR_END
56#load "lib.jai";
57 STR_END;
58
59 return .{
60 arg_name = "lib",
61 description = "Lib starter pack. Pass `-r <lib name>` to Jinit, to give it a name",
62 template = "templates/lib/template.jai",
63 dirs_in_workplace = .[ "test", "__RENAME_PLACEHOLDER__" ],
64 files = .[
65 .{ ".gitignore", gitignore },
66 .{ "test/test.jai", main_jai },
67 .{ "__RENAME_PLACEHOLDER__/lib.jai", lib_jai },
68 .{ "__RENAME_PLACEHOLDER__/module.jai", module_jai },
69 .{ "README.md", "" },
70 ],
71 };
72}();
73
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit