mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
Add RunContext support for script outputs (#765)
Resolves #667 This PR: - Introduces a new field in the project file: `scriptType` which has the default value of `Class` (in parity with previous versions), but can also be `RunContext`. - This is then passed to `InstanceContext` from the `Project` struct. - This then changes the RunContext in the lua `snapshot_middleware` --------- Co-authored-by: Micah <dekkonot@rocketmail.com>
This commit is contained in:
parent
539cd0d418
commit
bb8dd1402d
56 changed files with 602 additions and 95 deletions
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">nested_runcontext</string>
|
||||
</Properties>
|
||||
<Item class="Folder" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">folder1</string>
|
||||
</Properties>
|
||||
<Item class="Script" referent="2">
|
||||
<Properties>
|
||||
<string name="Name">test</string>
|
||||
<token name="RunContext">1</token>
|
||||
<string name="Source"></string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
<Item class="Folder" referent="3">
|
||||
<Properties>
|
||||
<string name="Name">folder2</string>
|
||||
</Properties>
|
||||
<Item class="Script" referent="4">
|
||||
<Properties>
|
||||
<string name="Name">test</string>
|
||||
<token name="RunContext">0</token>
|
||||
<string name="Source"></string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</Item>
|
||||
</Item>
|
||||
</roblox>
|
||||
|
|
@ -11,6 +11,7 @@ expression: contents
|
|||
<Properties>
|
||||
<string name="Name">hello</string>
|
||||
<bool name="Disabled">true</bool>
|
||||
<token name="RunContext">0</token>
|
||||
<string name="Source">-- This script should be marked 'Disabled'</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ expression: contents
|
|||
<Item class="Script" referent="1">
|
||||
<Properties>
|
||||
<string name="Name">serverScript</string>
|
||||
<token name="RunContext">0</token>
|
||||
<string name="Source">-- This is a Lua server script</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ expression: contents
|
|||
<Item class="Script" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">server_init</string>
|
||||
<token name="RunContext">0</token>
|
||||
<string name="Source">return "From folder/init.server.lua"</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
|
|
|
|||
13
rojo-test/build-tests/nested_runcontext/default.project.json
Normal file
13
rojo-test/build-tests/nested_runcontext/default.project.json
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"name": "nested_runcontext",
|
||||
"emitLegacyScripts": false,
|
||||
"tree": {
|
||||
"$className": "Folder",
|
||||
"folder1": {
|
||||
"$path": "folder1"
|
||||
},
|
||||
"folder2": {
|
||||
"$path": "folder2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "nested_runcontext",
|
||||
"emitLegacyScripts": true,
|
||||
"tree": {
|
||||
"$path": "folder3"
|
||||
}
|
||||
}
|
||||
|
|
@ -24,6 +24,8 @@ instances:
|
|||
Name: bar
|
||||
Parent: id-2
|
||||
Properties:
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: "-- Hello, from bar!"
|
||||
id-4:
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ instances:
|
|||
Name: bar
|
||||
Parent: id-2
|
||||
Properties:
|
||||
RunContext:
|
||||
Enum: 0
|
||||
Source:
|
||||
String: "-- Hello, from bar!"
|
||||
id-4:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue