Skip to content

Commit 7515644

Browse files
committed
Build systems (framework) update
- Added support for "arguments" setting in build systems. - Added "Release" and "Final" build systems to Fallout 4.
1 parent 4a5d6b7 commit 7515644

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,17 @@ Syntax highlighting for the version of Papyrus that is used in ***Fallout 4***.
232232
Completions for core language structures (e.g. properties, functions, structs).
233233

234234
#### Build systems
235-
Single file, batch, and recursive batch build variants.
235+
Debug, release, final, batch, and recursive batch build variants.
236236

237237
## **Changelog**
238+
Version 2.3.0 - 2016/04/28:
239+
240+
**Core**
241+
- Added support for "arguments" setting in build systems.
242+
243+
**Fallout 4**
244+
- Added "Release" and "Final" build systems to Fallout 4.
245+
238246
Version 2.2.0 - 2016/04/27:
239247

240248
**Core**

Source/Core/Plugin.py

+22-2
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,30 @@ def run(self, **args):
269269
temp.append(k)
270270
else:
271271
temp.append("-%s" % k)
272-
arguments = " ".join(temp)
272+
arguments = temp
273273
else:
274274
return ShowMessage("The arguments setting has to be a list of strings.")
275-
else:
275+
buildArguments = args.get("arguments", None)
276+
if buildArguments:
277+
if isinstance(buildArguments, list) and all(isinstance(k, str) for k in buildArguments):
278+
if arguments and isinstance(arguments, list):
279+
for k in buildArguments:
280+
if k[:1] != "-":
281+
k = "-%s" % k
282+
if k not in arguments:
283+
arguments.append(k)
284+
elif not arguments:
285+
arguments = []
286+
for k in buildArguments:
287+
if k[:1] == "-":
288+
arguments.append(k)
289+
else:
290+
arguments.append("-%s" % k)
291+
else:
292+
return ShowMessage("The build system's arguments setting has to be a list of strings.")
293+
if arguments and isinstance(arguments, list):
294+
arguments = " ".join(arguments)
295+
if not arguments:
276296
arguments = ""
277297
if not batch:
278298
args = {"cmd": "\"%s\" \"%s\" -i=\"%s\" -o=\"%s\" -f=\"%s\" %s" % (compiler, fileName, imports, output, flags, arguments), "file_regex": regex}

Source/Modules/Fallout 4/Papyrus - Fallout 4.sublime-build

+14-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@
66
"selector": "source.papyrus.fallout4",
77
"variants":
88
[
9+
{
10+
"name": "Release",
11+
"cmd": "$file",
12+
"module": "fallout4",
13+
"arguments": ["-release"]
14+
},
15+
{
16+
"name": "Final",
17+
"cmd": "$file",
18+
"module": "fallout4",
19+
"arguments": ["-final"]
20+
},
921
{
1022
"name": "Batch",
1123
"cmd": "$file",
1224
"module": "fallout4",
13-
"batch": "-all -norecurse"
25+
"arguments": ["-norecurse"],
26+
"batch": "-all"
1427
},
1528
{
1629
"name": "Batch (recursive)",

0 commit comments

Comments
 (0)