-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
73 lines (52 loc) · 1.83 KB
/
Earthfile
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
VERSION 0.8
FROM haxe:4.3.4-alpine3.20
WORKDIR /hxminetest
# Let Haxelib discover our library (for self-referencing)
RUN haxelib dev hxminetest .
# Install Haxe dependencies
RUN apk add --no-cache git
COPY haxelib.json .
RUN haxelib install haxelib.json --always
setup-deno:
ENV DENO_FUTURE 1
RUN apk add --no-cache deno
COPY scripts/deps.ts scripts/deps.ts
COPY deno.json deno.lock .
RUN deno cache scripts/deps.ts
lint:
RUN haxelib install formatter
COPY hxformat.json .
COPY examples examples
COPY src src
RUN haxelib run formatter --check -s examples -s src
build-examples:
FROM +setup-deno
COPY extraParams.hxml .
COPY examples examples
COPY scripts scripts
COPY src src
RUN deno run --allow-run=haxe --allow-read=examples scripts/build-examples.ts
build-docs-dump-types:
FROM +setup-deno
RUN mkdir docs && mkdir docs/reference
COPY scripts scripts
COPY src src
RUN deno run --allow-run --allow-read=docs --allow-write=docs scripts/generate-class-reference.ts
# This artifact does not have to be local to build the final HTML version,
# but we can use it for hot-reloading a dev server on a host machine (vitepress dev docs)
SAVE ARTIFACT docs/reference/generation/classes.xml AS LOCAL docs/reference/generation/classes.xml
build-docs-static-html:
FROM +setup-deno
# TODO: Figure out how to make Rollup use the musl binary
RUN apk add --no-cache gcompat
WORKDIR docs
COPY docs/deno.json docs/package.json .
RUN deno install
# Build Vitepress site
COPY docs .
COPY +build-docs-dump-types/classes.xml reference/generation/classes.xml
RUN deno run -A npm:vitepress build .
SAVE ARTIFACT .vitepress/dist AS LOCAL docs/.vitepress/dist
build-docs:
BUILD +build-docs-dump-types
BUILD +build-docs-static-html