mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Align Moose_Create.lua with the develop branch
Needed for later build system enhancements
This commit is contained in:
parent
75558078ee
commit
0658f6dc2b
@ -5,19 +5,32 @@ local MooseCommitHash = arg[2]
|
|||||||
local MooseDevelopmentPath = arg[3]
|
local MooseDevelopmentPath = arg[3]
|
||||||
local MooseSetupPath = arg[4]
|
local MooseSetupPath = arg[4]
|
||||||
local MooseTargetPath = arg[5]
|
local MooseTargetPath = arg[5]
|
||||||
|
local isWindows = arg[6]
|
||||||
|
|
||||||
|
if not isWindows then
|
||||||
|
isWindows = 0
|
||||||
|
end
|
||||||
print( "Moose (D)ynamic (S)tatic : " .. MooseDynamicStatic )
|
print( "Moose (D)ynamic (S)tatic : " .. MooseDynamicStatic )
|
||||||
print( "Commit Hash ID : " .. MooseCommitHash )
|
print( "Commit Hash ID : " .. MooseCommitHash )
|
||||||
print( "Moose development path : " .. MooseDevelopmentPath )
|
print( "Moose development path : " .. MooseDevelopmentPath )
|
||||||
print( "Moose setup path : " .. MooseSetupPath )
|
print( "Moose setup path : " .. MooseSetupPath )
|
||||||
print( "Moose target path : " .. MooseTargetPath )
|
print( "Moose target path : " .. MooseTargetPath )
|
||||||
|
print( "isWindows : " .. isWindows)
|
||||||
|
|
||||||
|
|
||||||
|
function PathConvert(splatnixPath)
|
||||||
|
if isWindows == 0 then
|
||||||
|
return splatnixPath
|
||||||
|
end
|
||||||
|
return splatnixPath:gsub("/", "\\")
|
||||||
|
end
|
||||||
|
|
||||||
local MooseModulesFilePath = MooseDevelopmentPath .. "/Modules.lua"
|
local MooseModulesFilePath = MooseDevelopmentPath .. "/Modules.lua"
|
||||||
local LoaderFilePath = MooseTargetPath .. "/Moose.lua"
|
local LoaderFilePath = MooseTargetPath .. "/Moose.lua"
|
||||||
|
|
||||||
print( "Reading Moose source list : " .. MooseModulesFilePath )
|
print( "Reading Moose source list : " .. MooseModulesFilePath )
|
||||||
|
print("Opening Loaderfile " .. PathConvert(LoaderFilePath))
|
||||||
local LoaderFile = io.open( LoaderFilePath, "w" )
|
local LoaderFile = assert(io.open( PathConvert(LoaderFilePath), "w+" ))
|
||||||
|
|
||||||
if MooseDynamicStatic == "S" then
|
if MooseDynamicStatic == "S" then
|
||||||
LoaderFile:write( "env.info( '*** MOOSE GITHUB Commit Hash ID: " .. MooseCommitHash .. " ***' )\n" )
|
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"
|
MooseLoaderPath = MooseSetupPath .. "/Moose Templates/Moose_Static_Loader.lua"
|
||||||
end
|
end
|
||||||
|
|
||||||
local MooseLoader = io.open( MooseLoaderPath, "r" )
|
|
||||||
|
local MooseLoader = assert(io.open( PathConvert(MooseLoaderPath), "r" ))
|
||||||
local MooseLoaderText = MooseLoader:read( "*a" )
|
local MooseLoaderText = MooseLoader:read( "*a" )
|
||||||
MooseLoader:close()
|
MooseLoader:close()
|
||||||
|
|
||||||
LoaderFile:write( MooseLoaderText )
|
LoaderFile:write( MooseLoaderText )
|
||||||
|
|
||||||
local MooseSourcesFile = io.open( MooseModulesFilePath, "r" )
|
local MooseSourcesFile = assert(io.open( PathConvert(MooseModulesFilePath), "r" ))
|
||||||
local MooseSource = MooseSourcesFile:read("*l")
|
local MooseSource = MooseSourcesFile:read("*l")
|
||||||
|
|
||||||
while( MooseSource ) do
|
while( MooseSource ) do
|
||||||
@ -50,7 +64,7 @@ while( MooseSource ) do
|
|||||||
end
|
end
|
||||||
if MooseDynamicStatic == "S" then
|
if MooseDynamicStatic == "S" then
|
||||||
print( "Load static: " .. MooseFilePath )
|
print( "Load static: " .. MooseFilePath )
|
||||||
local MooseSourceFile = io.open( MooseFilePath, "r" )
|
local MooseSourceFile = assert(io.open( PathConvert(MooseFilePath), "r" ))
|
||||||
local MooseSourceFileText = MooseSourceFile:read( "*a" )
|
local MooseSourceFileText = MooseSourceFile:read( "*a" )
|
||||||
MooseSourceFile:close()
|
MooseSourceFile:close()
|
||||||
|
|
||||||
@ -72,3 +86,8 @@ LoaderFile:write( "env.info( '*** MOOSE INCLUDE END *** ' )\n" )
|
|||||||
|
|
||||||
MooseSourcesFile:close()
|
MooseSourcesFile:close()
|
||||||
LoaderFile: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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user