mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
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.
93 lines
3.0 KiB
Lua
93 lines
3.0 KiB
Lua
-- This routine is called from the LDT environment to create the Moose.lua file stub for use in .miz files.
|
|
|
|
local MooseDynamicStatic = arg[1]
|
|
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 )
|
|
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" )
|
|
end
|
|
|
|
local MooseLoaderPath
|
|
if MooseDynamicStatic == "D" then
|
|
MooseLoaderPath = MooseSetupPath .. "/Moose Templates/Moose_Dynamic_Loader.lua"
|
|
end
|
|
if MooseDynamicStatic == "S" then
|
|
MooseLoaderPath = MooseSetupPath .. "/Moose Templates/Moose_Static_Loader.lua"
|
|
end
|
|
|
|
|
|
local MooseLoader = assert(io.open( PathConvert(MooseLoaderPath), "r" ))
|
|
local MooseLoaderText = MooseLoader:read( "*a" )
|
|
MooseLoader:close()
|
|
|
|
LoaderFile:write( MooseLoaderText )
|
|
|
|
local MooseSourcesFile = assert(io.open( PathConvert(MooseModulesFilePath), "r" ))
|
|
local MooseSource = MooseSourcesFile:read("*l")
|
|
|
|
while( MooseSource ) do
|
|
|
|
if MooseSource ~= "" then
|
|
MooseSource = string.match( MooseSource, "Scripts/Moose/(.+)'" )
|
|
local MooseFilePath = MooseDevelopmentPath .. "/" .. MooseSource
|
|
if MooseDynamicStatic == "D" then
|
|
print( "Load dynamic: " .. MooseFilePath )
|
|
end
|
|
if MooseDynamicStatic == "S" then
|
|
print( "Load static: " .. MooseFilePath )
|
|
local MooseSourceFile = assert(io.open( PathConvert(MooseFilePath), "r" ))
|
|
local MooseSourceFileText = MooseSourceFile:read( "*a" )
|
|
MooseSourceFile:close()
|
|
|
|
LoaderFile:write( MooseSourceFileText )
|
|
end
|
|
end
|
|
|
|
MooseSource = MooseSourcesFile:read("*l")
|
|
end
|
|
|
|
if MooseDynamicStatic == "D" then
|
|
LoaderFile:write( "BASE:TraceOnOff( true )\n" )
|
|
end
|
|
if MooseDynamicStatic == "S" then
|
|
LoaderFile:write( "BASE:TraceOnOff( false )\n" )
|
|
end
|
|
|
|
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 |