blob: 53e1e2a81b20386bb623ccc0204923b041f5e1b2 [file] [log] [blame]
#!/usr/bin/lua
-------------------------------------------------------------------------------
-- Copyright (c) 2012 Sierra Wireless and others.
-- All rights reserved. This program and the accompanying materials
-- are made available under the terms of the Eclipse Public License v1.0
-- which accompanies this distribution, and is available at
-- http://www.eclipse.org/legal/epl-v10.html
--
-- Contributors:
-- Sierra Wireless - initial API and implementation
-------------------------------------------------------------------------------
-- Fetch libraries form current plugin
package.path = './?.lua;../lib/?.lua;../../../libraries/metalua/?.lua;../../../libraries/modelsbuilder/?.lua;../../../libraries/luaformatter/?.lua;'
package.mpath = '../../../libraries/metalua/?.mlua;../../../libraries/modelsbuilder/?.mlua;'
require 'metalua.loader'
--
-- Generate serialized lua API models files next to given file.
--
local apimodelbuiler = require 'models.apimodelbuilder'
local modeltransformations = require 'modeltransformations'
if #arg < 1 then
print 'No file to serialize.'
return
end
for k = 1, #arg do
-- Load source to serialize
local filename = arg[k]
local status, error = modeltransformations.codetoserialisedmodel(
filename,
'serialized',
apimodelbuiler.createmoduleapi
)
if not status then
print( error )
end
end