Logo

index : jinit

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/jinit.git/html/templates/minimal/rules_minimal.jai blob: 2a014f4fa5a5781a2cbcde82c643b959b4865598 [raw] [clear marker]

        
0/*
1
2This file acts as configuration for your templates.
3
4Sometimes it might be useful to create all necessary files
5upfront, instead of bloating the build script with one-time code.
6
7Here you can declare what files and directories should be created
8at project initialization.
9
10This file gets consumed at compile time, hence the anonymous procedure here.
11It also allows you to shift some verbosity to distinct constants or variables.
12
13You could even do more sophisticated things, as long it returns the
14`Rules` struct, defined in `src/main.jai`.
15
16*/
17
18
19() -> Rules {
20
21 // You can even delcare the exact file contents.
22 // For example the `.gitignore` file:
23 gitignore :: #string STR_END
24# Jai
25.build
26/bin
27 STR_END;
28
29 main_jai :: #string STR_END
30#import "Basic";
31
32
33main :: () {
34 log("Hello, Sailor!");
35}
36
37 STR_END;
38
39 return .{
40 // This is how you would call the template via arguments.
41 // In this case: `jinit -t min`
42 arg_name = "min",
43
44 // Some description, could be also a empty string.
45 description = "Minimal template",
46
47 // The relative or absolute filepath to your template.
48 // This allows you to keep your templates where you want.
49 template = "templates/minimal/template.jai",
50
51 // Which directories should be created. It won't create parents
52 // automatically. They must be created first like this:
53 // `.[ "test", "test/foo", "test/foo/bar" ]`
54 dirs_in_workplace = .[ "src" ],
55
56 // Which files should be created. And you can declare the content, too.
57 files = .[
58 .{ ".gitignore", gitignore },
59 .{ "src/main.jai", main_jai },
60 .{ "README.md", "" },
61 ],
62
63 // You could specify the exact file name for the build file here.
64 // But you can also omit it and it will fall back to the default name.
65 //build_file_name = "build.jai",
66 };
67}();
68
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit