From 26f306726c00af0d5d5a3dccfa964b043007e0a9 Mon Sep 17 00:00:00 2001 From: RodrigoDornelles Date: Thu, 31 Oct 2024 17:29:39 -0300 Subject: [PATCH] change: move ginga do enterprise edition --- README.md | 3 --- docs/cli_build_ginga.txt | 2 ++ ee/README.md | 3 +++ {src => ee}/engine/core/ginga/draw.lua | 0 {src => ee}/engine/core/ginga/keys.lua | 0 {src => ee}/engine/core/ginga/main.lua | 6 +++--- {src/engine/core => ee/engine/meta}/ginga/main.ncl | 0 {src => ee}/lib/protocol/http_ginga.lua | 0 src/cli/commands/build.lua | 4 ++-- src/cli/commands/cli.lua | 2 +- src/lib/cli/builder.lua | 10 +++++++++- src/lib/util/http.lua | 10 +++++----- tests/bug_lib_protocol_http_ginga.lua | 2 +- tests/test_lib_protocol_http_ginga.lua | 2 +- tools/doxygen_filter.lua | 8 ++++++++ 15 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 ee/README.md rename {src => ee}/engine/core/ginga/draw.lua (100%) rename {src => ee}/engine/core/ginga/keys.lua (100%) rename {src => ee}/engine/core/ginga/main.lua (95%) rename {src/engine/core => ee/engine/meta}/ginga/main.ncl (100%) rename {src => ee}/lib/protocol/http_ginga.lua (100%) diff --git a/README.md b/README.md index 787ead4..e94aff3 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,3 @@ lua cli.lua build @asteroids --core html5 | Tier 9 | Nintendo Wii | support is reworking | Tier 10 | Nintendo DS | coming soon | Tier 11 | Nintendo GBA | limited support - ---- -This game engine is **open source** and **free** for all uses, focusing on promoting content for our **commercial platform**. diff --git a/docs/cli_build_ginga.txt b/docs/cli_build_ginga.txt index e4d9c98..4e32da6 100644 --- a/docs/cli_build_ginga.txt +++ b/docs/cli_build_ginga.txt @@ -9,6 +9,8 @@ @short build apps for brazilian and latam televisors +@call ginga + @details The application will be downloaded via the free digital television signal. diff --git a/ee/README.md b/ee/README.md new file mode 100644 index 0000000..76000d6 --- /dev/null +++ b/ee/README.md @@ -0,0 +1,3 @@ +# Enterprise + +This code is considered enterprise, so you need a license for commercial use. diff --git a/src/engine/core/ginga/draw.lua b/ee/engine/core/ginga/draw.lua similarity index 100% rename from src/engine/core/ginga/draw.lua rename to ee/engine/core/ginga/draw.lua diff --git a/src/engine/core/ginga/keys.lua b/ee/engine/core/ginga/keys.lua similarity index 100% rename from src/engine/core/ginga/keys.lua rename to ee/engine/core/ginga/keys.lua diff --git a/src/engine/core/ginga/main.lua b/ee/engine/core/ginga/main.lua similarity index 95% rename from src/engine/core/ginga/main.lua rename to ee/engine/core/ginga/main.lua index 9e84f63..16065df 100644 --- a/src/engine/core/ginga/main.lua +++ b/ee/engine/core/ginga/main.lua @@ -1,7 +1,7 @@ local zeebo_module = require('src/lib/engine/raw/module') -- -local core_draw = require('src/engine/core/ginga/draw') -local core_keys = require('src/engine/core/ginga/keys') +local core_draw = require('ee/engine/core/ginga/draw') +local core_keys = require('ee/engine/core/ginga/keys') -- local engine_encoder = require('src/lib/engine/api/encoder') local engine_game = require('src/lib/engine/api/game') @@ -19,7 +19,7 @@ local engine_node = require('src/lib/engine/raw/node') local engine_memory = require('src/lib/engine/raw/memory') -- local cfg_json_rxi = require('src/third_party/json/rxi') -local cfg_http_ginga = require('src/lib/protocol/http_ginga') +local cfg_http_ginga = require('ee/lib/protocol/http_ginga') -- local application_default = require('src/lib/object/root') local color = require('src/lib/object/color') diff --git a/src/engine/core/ginga/main.ncl b/ee/engine/meta/ginga/main.ncl similarity index 100% rename from src/engine/core/ginga/main.ncl rename to ee/engine/meta/ginga/main.ncl diff --git a/src/lib/protocol/http_ginga.lua b/ee/lib/protocol/http_ginga.lua similarity index 100% rename from src/lib/protocol/http_ginga.lua rename to ee/lib/protocol/http_ginga.lua diff --git a/src/cli/commands/build.lua b/src/cli/commands/build.lua index ac51b02..b1081cf 100644 --- a/src/cli/commands/build.lua +++ b/src/cli/commands/build.lua @@ -19,10 +19,10 @@ local function build(args) post_exe='love dist -'..'-screen '..screen }, ginga={ - src='src/engine/core/ginga/main.lua', + src='ee/engine/core/ginga/main.lua', post_exe='ginga dist/main.ncl -s '..screen, extras={ - 'src/engine/core/ginga/main.ncl' + 'ee/engine/meta/ginga/main.ncl' } }, native={ diff --git a/src/cli/commands/cli.lua b/src/cli/commands/cli.lua index e068a1e..9ec535f 100644 --- a/src/cli/commands/cli.lua +++ b/src/cli/commands/cli.lua @@ -24,7 +24,7 @@ local function cli_build(args) local dist = args.dist zeebo_fs.clear(dist) zeebo_bundler.build('src/cli/', 'main.lua', dist..'main.lua') - local ok, message = zeebo_bootstrap.build(dist..'main.lua', dist..'cli.lua', './src', './assets', './examples', './mock') + local ok, message = zeebo_bootstrap.build(dist..'main.lua', dist..'cli.lua', './src', './assets', './examples', './mock', './ee') os.remove(dist..'main.lua') return ok, message end diff --git a/src/lib/cli/builder.lua b/src/lib/cli/builder.lua index 5ee094b..db51885 100644 --- a/src/lib/cli/builder.lua +++ b/src/lib/cli/builder.lua @@ -1,6 +1,7 @@ local function move(src_in, dist_path, dist_file) local deps = {} local pattern = "local ([%w_%-]+) = require%('src/(.-)'%)" + local pattern_ee = "local ([%w_%-]+) = require%('ee/(.-)'%)" local src_file = io.open(src_in, "r") local dist_file_normalized = src_in:gsub('/', '_'):gsub('^src_', '') local dist_out = dist_path:gsub('/$', '')..'/'..(dist_file or dist_file_normalized) @@ -11,7 +12,14 @@ local function move(src_in, dist_path, dist_file) local line = src_file:read() if line then local line_require = { line:match(pattern) } - if line_require and #line_require > 0 then + local line_require_ee = { line:match(pattern_ee) } + + if line_require_ee and #line_require_ee > 0 then + local var_name = line_require_ee[1] + local module_path = line_require_ee[2] + deps[#deps + 1] = 'ee/'..module_path..'.lua' + dist_file:write('local '..var_name..' = require(\'ee_'..module_path:gsub('/', '_')..'\')\n') + elseif line_require and #line_require > 0 then local var_name = line_require[1] local module_path = line_require[2] deps[#deps + 1] = 'src/'..module_path..'.lua' diff --git a/src/lib/util/http.lua b/src/lib/util/http.lua index 6ec51ad..bbba0c4 100644 --- a/src/lib/util/http.lua +++ b/src/lib/util/http.lua @@ -152,25 +152,25 @@ local function create_request(method, uri) end self.to_wget_cmd = function () - local parts = {'wget --quiet --output-document=-'} + local parts = {'wget -'..'-quiet -'..'-output-document=-'} if method == 'HEAD' then - table.insert(parts, '--method=HEAD') + table.insert(parts, '-'..'-method=HEAD') elseif method ~= 'GET' then - table.insert(parts, '--method=' .. method) + table.insert(parts, '-'..'-method=' .. method) end for index, header in ipairs(self.header_list) do local value = self.header_dict[header] if value then local escaped_value = value:gsub('"', '\\"') - table.insert(parts, '--header="' .. header .. ': ' .. escaped_value .. '"') + table.insert(parts, '-'..'-header="' .. header .. ': ' .. escaped_value .. '"') end end if method ~= 'GET' and method ~= 'HEAD' and #self.body_content > 0 then local escaped_body = self.body_content:gsub('"', '\\"') - table.insert(parts, '--body-data="' .. escaped_body .. '"') + table.insert(parts, '-'..'-body-data="' .. escaped_body .. '"') end table.insert(parts, uri) diff --git a/tests/bug_lib_protocol_http_ginga.lua b/tests/bug_lib_protocol_http_ginga.lua index e9635b0..1661414 100644 --- a/tests/bug_lib_protocol_http_ginga.lua +++ b/tests/bug_lib_protocol_http_ginga.lua @@ -1,5 +1,5 @@ local luaunit = require('luaunit') -local protocol_http = require('src/lib/protocol/http_ginga') +local protocol_http = require('ee/lib/protocol/http_ginga') local std = {bus = {listen = function() end}} diff --git a/tests/test_lib_protocol_http_ginga.lua b/tests/test_lib_protocol_http_ginga.lua index 53d950e..63b6622 100644 --- a/tests/test_lib_protocol_http_ginga.lua +++ b/tests/test_lib_protocol_http_ginga.lua @@ -1,5 +1,5 @@ local luaunit = require('luaunit') -local protocol_http = require('src/lib/protocol/http_ginga') +local protocol_http = require('ee/lib/protocol/http_ginga') event = { post=function() end diff --git a/tools/doxygen_filter.lua b/tools/doxygen_filter.lua index eaf537f..60a7a37 100644 --- a/tools/doxygen_filter.lua +++ b/tools/doxygen_filter.lua @@ -30,6 +30,14 @@ function commands() return content end +function hardcore() + +end + +function ginga() + return '@warning ginga is an enterprise part, using it in production requires a commercial license for the engine.' +end + local function source(file_name) local content = '' local file = io.open(file_name, 'r')