Skip to content

Commit dc4b84b

Browse files
committed
urcheon/action: add compile_obj
1 parent 90a7cd2 commit dc4b84b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Urcheon/Action.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def list():
178178
CopyBsp,
179179
CompileBsp,
180180
CompileAse,
181+
CompileObj,
181182
# perhaps one day MergeBsp will be run on a copied bsp
182183
# so it must be called after that
183184
MergeBsp,
@@ -1123,6 +1124,7 @@ def getFileNewName(self):
11231124
class CompileAse(DumbTransient):
11241125
keyword = "compile_ase"
11251126
description = "compile to ase format"
1127+
extension = "ase"
11261128

11271129
def effective_run(self):
11281130
source_path = self.getSourcePath()
@@ -1132,15 +1134,15 @@ def effective_run(self):
11321134

11331135
self.createTransientPath()
11341136

1135-
Ui.laconic("Compiling to ase: " + self.file_path)
1137+
Ui.laconic("Compiling to " + self.extension + ": " + self.file_path)
11361138

11371139
# Do not copy the map source when building in the source directory as a prepare step.
11381140
if self.source_dir == self.build_dir:
11391141
stage_done = ["copy"]
11401142
else:
11411143
stage_done = []
11421144

1143-
map_compiler = MapCompiler.Compiler(self.source_tree, map_profile="ase")
1145+
map_compiler = MapCompiler.Compiler(self.source_tree, map_profile=self.extension)
11441146
map_compiler.compile(source_path, self.transient_maps_path, stage_done=stage_done)
11451147

11461148
os.remove(os.path.join(self.transient_path, bsp_path))
@@ -1155,4 +1157,10 @@ def getFileBspName(self):
11551157
return self.switchExtension("bsp")
11561158

11571159
def getFileNewName(self):
1158-
return self.switchExtension("ase")
1160+
return self.switchExtension(self.extension)
1161+
1162+
1163+
class CompileObj(CompileAse):
1164+
keyword = "compile_obj"
1165+
description = "compile to obj format"
1166+
extension = "obj"

0 commit comments

Comments
 (0)