-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install target packages #14
Conversation
gradle-xmake-plugin/src/main/resources/lua/install_artifacts.lua
Outdated
Show resolved
Hide resolved
@waruqi local targets = _get_targets(...)
for _, arch in ipairs({"armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"}) do
if abi_filters[arch] then
options["arch"] = arch
task.run("config", options)
end
end But since |
please do not run config task. gradle will call config task |
Yes I know, but how to change arch without running the config task ? |
I think, I have found a solution. import("private.action.require.register", {alias = "register_packages"})
local targets = _get_targets(...)
for _, arch in ipairs({"armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"}) do
if abi_filters[arch] then
config.set("arch", arch)
register_packages()
end
end What do you think ? |
maybe we can split it to gradle task for each arch. |
We can add like build task: xmake-gradle/gradle-xmake-plugin/src/main/groovy/org/tboox/gradle/XMakePlugin.groovy Line 134 in 3259f30
then modify install_artifacts.lua to only install single arch library. |
Yes, that's exactly what I was thinking when I looked at the code. |
Thanks, I will test it in these days. |
if os.emptydir(installdir) then | ||
os.tryrm(installdir) | ||
-- clean cxxstl | ||
local ndk_cxxstl = get_config("ndk_cxxstl") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ndk_cxxstl has been deprecated, please use runtimes.
local ndk_cxxstl = get_config("runtimes") or get_config("ndk_cxxstl")
end | ||
end | ||
|
||
-- main entry | ||
function main(libsdir, installdir, archs, ...) | ||
function main(installdir, arch, clean, ...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can improve to parse arguments.
like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then xmake l install_artfacts.lua --installdir=xxx --arch=xxx --clean
task.dependsOn("xmakeBuildFor" + forName) | ||
} | ||
} | ||
def installTask = project.tasks.register("xmakeInstall", XMakeBuildTask, new Action<XMakeInstallTask>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XMakeBuildTask -> XMakeInstallTask
it will break, did you test it?
else | ||
_clean_artifacts(installdir, targets, arch) | ||
end | ||
assert(not targets or #targets == 0, "no targets provided, make sure to have at least one shared target in your xmake.lua or to provide one") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here it's always false.
I have fixed it. |
I noticed that the target packages were not installed, like other so file, so I added that.
In addition, apart from the target file, no files are deleted in the
_clean_artifacts
function (cxx stl, ...).