mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-20 17:41:37 +00:00
This modifies Rojo's build script to throw a fit if we're building a plugin with a semver incompatible version. In the process, it moves the version of the plugin to a file named `Version.txt` that's parsed at runtime. This should be minimally invasive but it's technically worse for performance than the hardcoded table and string we had before. This feels better than a CI check or just manually verifying because it makes it physically impossible for us to forget since Rojo won't build with it being wrong.
25 lines
662 B
Lua
25 lines
662 B
Lua
local strict = require(script.Parent.strict)
|
|
|
|
local isDevBuild = script.Parent.Parent:FindFirstChild("ROJO_DEV_BUILD") ~= nil
|
|
|
|
local Version = script.Parent.Parent.Version
|
|
local realVersion = Version.Value:split(".")
|
|
|
|
for i = 1, 3 do
|
|
local num = tonumber(realVersion[i])
|
|
if num then
|
|
realVersion[i] = num
|
|
else
|
|
error(("invalid version `%s` (field %d)"):format(realVersion[i], i))
|
|
end
|
|
end
|
|
|
|
return strict("Config", {
|
|
isDevBuild = isDevBuild,
|
|
codename = "Epiphany",
|
|
version = realVersion,
|
|
expectedServerVersionString = ("%d.%d or newer"):format(realVersion[1], realVersion[2]),
|
|
protocolVersion = 4,
|
|
defaultHost = "localhost",
|
|
defaultPort = "34872",
|
|
})
|