Changeset

491:edf078a58f25

squishy: Update for prosody.* namespace
author Matthew Wild <mwild1@gmail.com>
date Tue, 20 Jun 2023 12:59:24 +0100
parents 490:6b2f31da9610
children 492:22844ac3be4e
files squishy
diffstat 1 files changed, 77 insertions(+), 67 deletions(-) [+]
line wrap: on
line diff
--- a/squishy	Sat May 20 20:48:03 2023 +0200
+++ b/squishy	Tue Jun 20 12:59:24 2023 +0100
@@ -1,62 +1,76 @@
 Output "verse.lua"
 
--- Verse-specific versions of libraries
-Module "util.encodings"		"libs/encodings.lua"
-Module "util.hashes"		"libs/hashes.lua"
-Module "lib.adhoc"              "libs/adhoc.lib.lua"
-Module "util.table" "libs/table.lua"
-
--- Prosody libraries
-if not GetOption("prosody") then
-	AutoFetchURL "http://hg.prosody.im/0.10/raw-file/tip/?"
-else
-	AutoFetchURL(GetOption("prosody").."/?")
+local VerseModule = Module
+local function ProsodyModule(s)
+	return VerseModule("prosody."..s)
 end
 
-Module "util.sha1"		"util/sha1.lua"
-Module "util.bit"               "libs/bit.lua"
+function ProsodyModules()
+	local Module = ProsodyModule;
+	-- Verse-specific versions of libraries
+	Module "util.encodings"		"libs/encodings.lua"
+	Module "util.hashes"		"libs/hashes.lua"
+	Module "lib.adhoc"              "libs/adhoc.lib.lua"
+	Module "util.table" "libs/table.lua"
+
+	-- Prosody libraries
+	if not GetOption("prosody") then
+		AutoFetchURL "http://hg.prosody.im/0.10/raw-file/tip/?"
+	else
+		AutoFetchURL(GetOption("prosody").."/?")
+	end
+
+	Module "util.sha1"		"util/sha1.lua"
+	Module "util.bit"               "libs/bit.lua"
 
-Module "util.stanza"		"util/stanza.lua"
-Module "util.timer"		"util/timer.lua"
-Module "util.termcolours"	"util/termcolours.lua"
-Module "util.uuid"		"util/uuid.lua"
-Module "util.time" "libs/time.lua"
-Module "util.envload" "util/envload.lua"
-Module "util.id" "util/id.lua"
-Module "util.serialization" "util/serialization.lua"
-Module "util.indexedbheap" "util/indexedbheap.lua"
-Module "util.xpcall" "util/xpcall.lua"
-Module "util.array" "util/array.lua"
-Module "util.format" "util/format.lua"
-Module "util.promise" "util/promise.lua"
-Module "net.adns"              "net/unbound.lua"
-Module "util.dns" "util/dns.lua"
-Module "net.server_select"		"net/server_select.lua"
-Module "util.xmppstream"	"util/xmppstream.lua"
-Module "util.jid"		"util/jid.lua"
-Module "util.events"		"util/events.lua"
-Module "util.dataforms"		"util/dataforms.lua"
-Module "util.caps"		"util/caps.lua"
-Module "util.vcard"		"util/vcard.lua"
-Module "util.logger"		"util/logger.lua"
-Module "util.datetime"		"util/datetime.lua"
-Module "util.json"		"util/json.lua"
-Module "util.xml"		"util/xml.lua"
-Module "util.rsm"       "util/rsm.lua"
-Module "util.random"       "util/random.lua"
-Module "util.ip"       "util/ip.lua"
-Module "util.hex" "util/hex.lua"
-Module "util.net" "libs/net.lua"
-Module "util.sslconfig" "util/sslconfig.lua"
-Module "util.paths"     "util/paths.lua"
-Module "util.mathcompat" "util/mathcompat.lua"
-Module "util.dnsregistry" "util/dnsregistry.lua"
-Module "net.tls_luasec"   "net/tls_luasec.lua"
+	Module "util.stanza"		"util/stanza.lua"
+	Module "util.timer"		"util/timer.lua"
+	Module "util.termcolours"	"util/termcolours.lua"
+	Module "util.uuid"		"util/uuid.lua"
+	Module "util.time" "libs/time.lua"
+	Module "util.envload" "util/envload.lua"
+	Module "util.id" "util/id.lua"
+	Module "util.serialization" "util/serialization.lua"
+	Module "util.indexedbheap" "util/indexedbheap.lua"
+	Module "util.xpcall" "util/xpcall.lua"
+	Module "util.array" "util/array.lua"
+	Module "util.format" "util/format.lua"
+	Module "util.promise" "util/promise.lua"
+	Module "net.adns"              "net/unbound.lua"
+	Module "util.dns" "util/dns.lua"
+	Module "net.server_select"		"net/server_select.lua"
+	Module "util.xmppstream"	"util/xmppstream.lua"
+	Module "util.jid"		"util/jid.lua"
+	Module "util.events"		"util/events.lua"
+	Module "util.dataforms"		"util/dataforms.lua"
+	Module "util.caps"		"util/caps.lua"
+	Module "util.vcard"		"util/vcard.lua"
+	Module "util.logger"		"util/logger.lua"
+	Module "util.datetime"		"util/datetime.lua"
+	Module "util.json"		"util/json.lua"
+	Module "util.xml"		"util/xml.lua"
+	Module "util.rsm"       "util/rsm.lua"
+	Module "util.random"       "util/random.lua"
+	Module "util.ip"       "util/ip.lua"
+	Module "util.hex" "util/hex.lua"
+	Module "util.net" "libs/net.lua"
+	Module "util.sslconfig" "util/sslconfig.lua"
+	Module "util.paths"     "util/paths.lua"
+	Module "util.mathcompat" "util/mathcompat.lua"
+	Module "util.dnsregistry" "util/dnsregistry.lua"
+	Module "net.tls_luasec"   "net/tls_luasec.lua"
 
-Module "util.sasl.scram"       "util/sasl/scram.lua"
-Module "util.sasl.plain"       "util/sasl/plain.lua"
-Module "util.sasl.anonymous"   "util/sasl/anonymous.lua"
-Module "util.sasl.oauthbearer" "util/sasl/oauthbearer.lua"
+	Module "util.http" "util/http.lua"
+	Module "net.http.parser" "net/http/parser.lua"
+	Module "net.http" "net/http.lua"
+	Module "util.x509" "util/x509.lua"
+
+	if GetOption "internal-bit-module" then
+		Module "bit" "libs/bit.lua"
+	end
+end
+
+ProsodyModules()
 
 -- Verse plugins
 plugins = {
@@ -88,22 +102,18 @@
 }
 
 for _, plugin in ipairs(plugins) do
-	Module("verse.plugins."..plugin)("plugins/"..plugin..".lua")
-end
-	
-Module "util.http" "util/http.lua"
-Module "net.http.parser" "net/http/parser.lua"
-Module "net.http" "net/http.lua"
-Module "util.x509" "util/x509.lua"
-
-Module "verse.bosh" "bosh.lua"
-
-if GetOption "internal-bit-module" then
-	Module "bit" "libs/bit.lua"
+	VerseModule("verse.plugins."..plugin)("plugins/"..plugin..".lua")
 end
 
-Module "verse.client" "client.lua"
-Module "verse.component" "component.lua"
+-- SASL client mechanisms	
+VerseModule "verse.util.sasl.scram"       "util/sasl/scram.lua"
+VerseModule "verse.util.sasl.plain"       "util/sasl/plain.lua"
+VerseModule "verse.util.sasl.anonymous"   "util/sasl/anonymous.lua"
+VerseModule "verse.util.sasl.oauthbearer" "util/sasl/oauthbearer.lua"
+
+VerseModule "verse.client"    "client.lua"
+VerseModule "verse.component" "component.lua"
+VerseModule "verse.bosh"      "bosh.lua"
 
 -- Main verse file
 Main "init.lua"