Skip to content

Commit

Permalink
Merge pull request #19 from ignite720/ndk_version
Browse files Browse the repository at this point in the history
Added android.ndkVersion support.
  • Loading branch information
polymonster authored Mar 13, 2024
2 parents 7508f56 + 006ce04 commit 2e1892a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions android_studio/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ p.api.register
kind = "string"
}

p.api.register
{
name = "androidndkversion",
scope = "project",
kind = "string"
}

p.api.register
{
name = "assetpacks",
Expand Down
11 changes: 11 additions & 0 deletions android_studio/android_studio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,17 @@ function m.generate_project(prj)
if prj.androidndkpath ~= nil then
p.x('ndkPath \"%s\"', prj.androidndkpath)
end

if prj.androidndkversion ~= nil then
p.x('ndkVersion \"%s\"', prj.androidndkversion)
else
if prj.androidndkpath ~= nil then
local _, _, ndk_version = string.find(prj.androidndkpath, "ndk/(.+)")
if ndk_version ~= nil then
p.x('ndkVersion \"%s\"', ndk_version)
end
end
end

p.push('defaultConfig {')
if prj.androidappid then
Expand Down

0 comments on commit 2e1892a

Please sign in to comment.