This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpymo-ykm.pipe
149 lines (120 loc) · 4.12 KB
/
cpymo-ykm.pipe
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
- operation Clean-Build-Dir %build-dir%
if (dir-exists %build-dir%) {
delete-dir %build-dir%
}
- task Pack-Files %dir-to-pack% %output-pak-file%
set %files-to-pack% (get-files %dir-to-pack%)
if (not (is-empty %files-to-pack%)) {
output %output-pak-file%
for %i% in %files-to-pack% {
input "%dir-to-pack%/%i%"
}
}
- operation Pack-Files %dir-to-pack% %output-pak-file%
set %list-file% (change-extension ".txt" %output-pak-file%)
write-text %input% %list-file%
cpymo-tool pack %output% --file-list %list-file%
delete-file %list-file%
- task Copy-File %src-file% %dest-file%
input %src-file%
output %dest-file%
- operation Copy-File %src-file% %dest-file%
copy-file (fst %input%) (fst %output%)
- task Copy-Dir %src% %dst%
if (dir-exists %src%) {
ensure-dir %dst%
for %i% in (get-files %src%) {
Copy-File "%src%/%i%" "%dst%/%i%"
}
}
- task Compile-Script %src-file% %dst-file% %opts% %deps%
input %src-file%
output %dst-file%
for %i% in %deps% {
if (file-exists %i%) {
input %i%
} else {
for %j% in (get-files %i%) {
input "%i%/%j%"
}
}
}
- operation Compile-Script %src-file% %dst-file% %opts% %deps%
ykmc %src-file% --target-pymo %dst-file% %opts%
- task Compile-Scripts %dst-dir% %src-dirs% %opts% %deps%
ensure-dir %dst-dir%
for %src-dir% in %src-dirs% {
for %src-file% in (get-files %src-dir%) {
set %dst-file% (change-extension ".txt" %src-file%)
Compile-Script "%src-dir%/%src-file%" "%dst-dir%/%dst-file%" %opts% %deps%
}
}
- action Install-Library %url% %target-dir% %target-filename%
ensure-dir %target-dir%
if (not (file-exists "%target-dir%/%target-filename%")) {
PowerShell curl %url% -OutFile "%target-dir%/%target-filename%"
}
- action Install-libpymo %target-dir%
set %url% "https://raw.githubusercontent.com/Strrationalism/CPyMO/main/libpymo.ykm"
Install-Library %url% %target-dir% "libpymo.ykm"
- task Scale-Image %ratio-x% %ratio-y% %src-file% %dst-file%
input %src-file%
output %dst-file%
- operation Scale-Image %ratio-x% %ratio-y% %src-file% %dst-file%
cpymo-tool resize %src-file% %dst-file% %ratio-x% %ratio-y%
- task Convert-Image %src-file% %dst-file%
Scale-Image 1 1 %src-file% %dst-file%
- task Convert-Images %format% %dst-dir% %src-dirs%
for %src-dir% in %src-dirs% {
for %src-file% in (get-files %src-dir%) {
set %dst-file% (change-extension ".%format%" %src-file%)
Convert-Image %format% "%src-dir%/%src-file%" "%dst-dir%/%dst-file%"
}
}
- task Pack-Images %col% %dst% %srcs%
output %dst%
for %i% in %srcs% {
input %i%
}
- operation Pack-Images %col% %dst% %srcs%
cpymo-tool pack-images %dst% %col% %srcs%
- operation Generate-Album-Cache %gamedir%
cpymo-tool gen-album-cache "%gamedir%"
- task Copy-Source-To-Build-Dir %dirs-to-copy% %src-dir% %build-dir%
for %i% in %dirs-to-copy% {
ensure-dir "%build-dir%/%i%"
Copy-Dir "%src-dir%/%i%" "%build-dir%/%i%"
}
if (file-exists "%src-dir%/gameconfig.txt") {
Copy-File "%src-dir%/gameconfig.txt" "%build-dir%/gameconfig.txt"
}
if (file-exists "%src-dir%/icon.png") {
Copy-File "%src-dir%/icon.png" "%build-dir%/icon.png"
}
- task Publish-Game %build-dir% %dst-dir% %dirs-to-pack% %dirs-to-copy%
ensure-dir %dst-dir%
for %i% in %dirs-to-pack% {
ensure-dir "%dst-dir%/%i%"
Pack-Files "%build-dir%/%i%" "%dst-dir%/%i%/%i%.pak"
}
for %i% in %dirs-to-copy% {
ensure-dir "%dst-dir%/%i%"
Copy-Dir "%build-dir%/%i%" "%dst-dir%/%i%"
}
if (file-exists "%build-dir%/icon.png") {
Copy-File "%build-dir%/icon.png" "%dst-dir%/icon.png"
}
if (file-exists "%build-dir%/gameconfig.txt") {
Copy-File "%build-dir%/gameconfig.txt" "%dst-dir%/gameconfig.txt"
}
- task Publish-Game-To-Platform %zip% %platform% %default-publish-dir% %dst-dir%
dirty
- operation Publish-Game-To-Platform %zip% %platform% %default-publish-dir% %dst-dir%
PowerShell pymo-convert.ps1 %platform% %default-publish-dir% %dst-dir%
if %zip% {
Zip-Dir %dst-dir% "%dst-dir%.zip"
}
- operation Zip-Dir %dirs% %out%
PowerShell Compress-Archive -Path %dirs% -DestinationPath %out% -Force
- operation Strip-Publish %publish-dir%
PowerShell pymo-strip.ps1 %publish-dir%