mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixes broken external tools
Several small changes that should hopefully be a nice QoL upgrade for generating the imports and lead to less newbie confusion. * Adds a lua binary directly to the repository instead of just expecting the user to have installed it via choco. Added binary is 5.4 as that's the lowest 5.x exe that's easily downloaded, and it works fine for what we need. * Modifies the launch targets to use workspace_loc macros instead of resource_loc macros. Workspace_loc requires the user to have correctly set the name of their project, but that is already stressed in the documentation. resource_loc was just wrong. (project_loc would cause problems if the user had selected something outside of the moose project before running). * Modifies launch targets to use the folder structure that the project is actually structured with. * Adds the include folder and files so Eclipse doesn't explode when they are missing. * Small modifications to Moose_Create, also includes a path conversion function that in my testing doesn't make a difference eitherway on Windows, but is there for a troubleshooting option. * Adds courtesy instructions when generating the dynamic include file.
This commit is contained in:
parent
300e3f2f58
commit
c3f7deb602
24
MOOSE_INCLUDE/Moose_Include_Dynamic/Moose.lua
Normal file
24
MOOSE_INCLUDE/Moose_Include_Dynamic/Moose.lua
Normal file
@ -0,0 +1,24 @@
|
||||
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
|
||||
|
||||
local base = _G
|
||||
|
||||
__Moose = {}
|
||||
|
||||
__Moose.Include = function( IncludeFile )
|
||||
if not __Moose.Includes[ IncludeFile ] then
|
||||
__Moose.Includes[IncludeFile] = IncludeFile
|
||||
local f = assert( base.loadfile( IncludeFile ) )
|
||||
if f == nil then
|
||||
error ("Moose: Could not load Moose file " .. IncludeFile )
|
||||
else
|
||||
env.info( "Moose: " .. IncludeFile .. " dynamically loaded." )
|
||||
return f()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
__Moose.Includes = {}
|
||||
|
||||
__Moose.Include( 'Scripts/Moose/Modules.lua' )
|
||||
BASE:TraceOnOff( true )
|
||||
env.info( '*** MOOSE INCLUDE END *** ' )
|
||||
190282
MOOSE_INCLUDE/Moose_Include_Static/Moose.lua
Normal file
190282
MOOSE_INCLUDE/Moose_Include_Static/Moose.lua
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:\ProgramData\chocolatey\lib\lua51\tools\lua5.1.exe"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=""Moose Setup\Moose_Create.lua" "D" "LOCAL" "${resource_loc:/MOOSE/Moose Development/Moose}" "${resource_loc:/MOOSE/Moose Setup}" ${resource_loc:/MOOSE_INCLUDE/Moose_Include_Dynamic}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/MOOSE}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Moose_Framework/lua54/lua54.exe}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=""Moose Setup/Moose_Create.lua" "D" "LOCAL" "${workspace_loc:/Moose_Framework/Moose Development/Moose}" "${workspace_loc:/Moose_Framework/Moose Setup}" "${workspace_loc:/Moose_Framework/MOOSE_INCLUDE\Moose_Include_Dynamic}" 1"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Moose_Framework}"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="C:\ProgramData\chocolatey\lib\lua51\tools\lua5.1.exe"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=""Moose Setup\Moose_Create.lua" "S" "LOCAL" "${resource_loc:/MOOSE/Moose Development/Moose}" "${resource_loc:/MOOSE/Moose Setup}" ${resource_loc:/MOOSE_INCLUDE/Moose_Include_Static}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/MOOSE}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Moose_Framework/lua54/lua54.exe}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value=""Moose Setup\Moose_Create.lua" "S" "LOCAL" "${workspace_loc:/Moose_Framework/Moose Development/Moose}" "${workspace_loc:/Moose_Framework/Moose Setup}" "${workspace_loc:/Moose_Framework/MOOSE_INCLUDE\Moose_Include_Static}" 1"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/Moose_Framework}"/>
|
||||
</launchConfiguration>
|
||||
|
||||
@ -5,19 +5,32 @@ local MooseCommitHash = arg[2]
|
||||
local MooseDevelopmentPath = arg[3]
|
||||
local MooseSetupPath = arg[4]
|
||||
local MooseTargetPath = arg[5]
|
||||
local isWindows = arg[6]
|
||||
|
||||
if not isWindows then
|
||||
isWindows = 0
|
||||
end
|
||||
print( "Moose (D)ynamic (S)tatic : " .. MooseDynamicStatic )
|
||||
print( "Commit Hash ID : " .. MooseCommitHash )
|
||||
print( "Moose development path : " .. MooseDevelopmentPath )
|
||||
print( "Moose setup path : " .. MooseSetupPath )
|
||||
print( "Moose target path : " .. MooseTargetPath )
|
||||
print( "isWidows : " .. isWindows)
|
||||
|
||||
|
||||
function PathConvert(splatnixPath)
|
||||
if isWindows == 0 then
|
||||
return splatnixPath
|
||||
end
|
||||
return splatnixPath:gsub("/", "\\")
|
||||
end
|
||||
|
||||
local MooseModulesFilePath = MooseDevelopmentPath .. "/Modules.lua"
|
||||
local LoaderFilePath = MooseTargetPath .. "/Moose.lua"
|
||||
|
||||
print( "Reading Moose source list : " .. MooseModulesFilePath )
|
||||
|
||||
local LoaderFile = io.open( LoaderFilePath, "w" )
|
||||
print("Opening Loaderfile " .. PathConvert(LoaderFilePath))
|
||||
local LoaderFile = assert(io.open( PathConvert(LoaderFilePath), "w+" ))
|
||||
|
||||
if MooseDynamicStatic == "S" then
|
||||
LoaderFile:write( "env.info( '*** MOOSE GITHUB Commit Hash ID: " .. MooseCommitHash .. " ***' )\n" )
|
||||
@ -31,13 +44,14 @@ if MooseDynamicStatic == "S" then
|
||||
MooseLoaderPath = MooseSetupPath .. "/Moose Templates/Moose_Static_Loader.lua"
|
||||
end
|
||||
|
||||
local MooseLoader = io.open( MooseLoaderPath, "r" )
|
||||
|
||||
local MooseLoader = assert(io.open( PathConvert(MooseLoaderPath), "r" ))
|
||||
local MooseLoaderText = MooseLoader:read( "*a" )
|
||||
MooseLoader:close()
|
||||
|
||||
LoaderFile:write( MooseLoaderText )
|
||||
|
||||
local MooseSourcesFile = io.open( MooseModulesFilePath, "r" )
|
||||
local MooseSourcesFile = assert(io.open( PathConvert(MooseModulesFilePath), "r" ))
|
||||
local MooseSource = MooseSourcesFile:read("*l")
|
||||
|
||||
while( MooseSource ) do
|
||||
@ -50,7 +64,7 @@ while( MooseSource ) do
|
||||
end
|
||||
if MooseDynamicStatic == "S" then
|
||||
print( "Load static: " .. MooseFilePath )
|
||||
local MooseSourceFile = io.open( MooseFilePath, "r" )
|
||||
local MooseSourceFile = assert(io.open( PathConvert(MooseFilePath), "r" ))
|
||||
local MooseSourceFileText = MooseSourceFile:read( "*a" )
|
||||
MooseSourceFile:close()
|
||||
|
||||
@ -72,3 +86,8 @@ LoaderFile:write( "env.info( '*** MOOSE INCLUDE END *** ' )\n" )
|
||||
|
||||
MooseSourcesFile:close()
|
||||
LoaderFile:close()
|
||||
|
||||
print("Moose include generation complete.")
|
||||
if MooseDynamicStatic == "D" then
|
||||
print("To enable dynamic moose loading, add a soft or hard link from \"<YOUR_DCS_INSTALL_DIRECTORY>\\Scripts\\Moose\" to the \"Moose Development\\Moose\" subdirectory of the Moose_Framework repository.")
|
||||
end
|
||||
BIN
lua54/lua54.dll
Normal file
BIN
lua54/lua54.dll
Normal file
Binary file not shown.
BIN
lua54/lua54.exe
Normal file
BIN
lua54/lua54.exe
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user