Add new scripts and machinery to make working on plugin easier

This commit is contained in:
Lucien Greathouse
2019-10-01 17:13:28 -07:00
parent 0dbbf44ab2
commit 15e848d4bf
7 changed files with 46 additions and 6 deletions

View File

@@ -2,4 +2,4 @@
set -e
watchexec -c -w plugin "rojo build plugin -o $LOCALAPPDATA/Roblox/Plugins/Rojo.rbxm"
watchexec -c -w plugin "sh -c './bin/install-dev-plugin.sh'"

View File

@@ -2,4 +2,12 @@
set -e
rojo build plugin -o $LOCALAPPDATA/Roblox/Plugins/Rojo.rbxm
DIR="$( mktemp -d )"
PLUGIN_FILE="$DIR/Rojo.rbxm"
TESTEZ_FILE="$DIR/TestEZ.rbxm"
rojo build plugin -o "$PLUGIN_FILE"
rojo build plugin/testez.project.json -o "$TESTEZ_FILE"
remodel bin/mark-plugin-as-dev.lua "$PLUGIN_FILE" "$TESTEZ_FILE" 2>/dev/null
cp "$PLUGIN_FILE" "$LOCALAPPDATA/Roblox/Plugins/Rojo.rbxm"

View File

@@ -0,0 +1,12 @@
local pluginPath, testezPath = ...
local plugin = remodel.readModelFile(pluginPath)[1]
local testez = remodel.readModelFile(testezPath)[1]
local marker = Instance.new("Folder")
marker.Name = "ROJO_DEV_BUILD"
marker.Parent = plugin
testez.Parent = plugin
remodel.writeModelFile(plugin, pluginPath)

View File

@@ -1,8 +1,13 @@
return {
local strict = require(script.Parent.strict)
local isDevBuild = script.Parent.Parent:FindFirstChild("ROJO_DEV_BUILD") ~= nil
return strict("Config", {
isDevBuild = isDevBuild,
codename = "Epiphany",
version = {0, 6, 0, "-dev"},
expectedServerVersionString = "0.6.0 or newer",
protocolVersion = 3,
defaultHost = "localhost",
defaultPort = 34872,
}
})

View File

@@ -6,6 +6,8 @@ local Environment = {
Test = "Test",
}
local DEFAULT_ENVIRONMENT = Config.isDevBuild and Environment.Dev or Environment.User
local VALUES = {
LogLevel = {
type = "IntValue",
@@ -84,7 +86,7 @@ local function getValue(name)
return stored
end
return VALUES[name].values[Environment.User]
return VALUES[name].values[DEFAULT_ENVIRONMENT]
end
local DevSettings = {}

View File

@@ -4,6 +4,7 @@ end
local Roact = require(script.Parent.Roact)
local Config = require(script.Config)
local App = require(script.Components.App)
local app = Roact.createElement(App, {
@@ -14,4 +15,10 @@ local tree = Roact.mount(app, game:GetService("CoreGui"), "Rojo UI")
plugin.Unloading:Connect(function()
Roact.unmount(tree)
end)
end)
if Config.isDevBuild then
local TestEZ = require(script.Parent.TestEZ)
TestEZ.TestBootstrap:run({script})
end

View File

@@ -0,0 +1,6 @@
{
"name": "TestEZ",
"tree": {
"$path": "modules/testez/lib"
}
}