This repository has been archived by the owner on Sep 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New version that auto compiles for speed improvements
- Loading branch information
1 parent
bcc55c3
commit 7d92f0e
Showing
7 changed files
with
1,335 additions
and
1,254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
compile = {} | ||
|
||
|
||
local arg={...} | ||
local config = arg[1] | ||
local toolDir = config.toolDir | ||
|
||
function compile.file_exists(name) | ||
local f=io.open(name,"r") | ||
if f~=nil then io.close(f) return true else return false end | ||
end | ||
|
||
function compile.loadScript(script) | ||
|
||
|
||
if config.useCompiler == true then | ||
local cachefile | ||
cachefile = toolDir .. "compiled/" .. script:gsub( "/", "_") .. "c" | ||
if compile.file_exists(cachefile) ~= true then | ||
system.compile(script) | ||
os.rename(script .. 'c', cachefile) | ||
end | ||
print(cachefile) | ||
return loadfile(cachefile) | ||
else | ||
print(script) | ||
return loadfile(script) | ||
end | ||
|
||
|
||
end | ||
|
||
|
||
|
||
return compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This folder stores compiled cache files. | ||
|
||
Please do not delete it. | ||
|
||
-- | ||
|
||
To force a recompile of the app; simply delete all the files ending in .luac |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.