Skip to content

Commit

Permalink
update to 1.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Sep 11, 2024
1 parent b14b2f5 commit 3259f30
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ XMake installed on the system. Available [here](https://github.com/xmake-io/xmak

```
plugins {
id 'org.tboox.gradle-xmake-plugin' version '1.1.6'
id 'org.tboox.gradle-xmake-plugin' version '1.1.7'
}
```

Expand All @@ -70,7 +70,7 @@ buildscript {
}
}
dependencies {
classpath 'org.tboox:gradle-xmake-plugin:1.1.6'
classpath 'org.tboox:gradle-xmake-plugin:1.1.7'
}
repositories {
mavenCentral()
Expand Down
4 changes: 2 additions & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ xmake-gradle是一个无缝整合xmake的gradle插件。

```
plugins {
id 'org.tboox.gradle-xmake-plugin' version '1.1.6'
id 'org.tboox.gradle-xmake-plugin' version '1.1.7'
}
```

Expand All @@ -70,7 +70,7 @@ buildscript {
}
}
dependencies {
classpath 'org.tboox:gradle-xmake-plugin:1.1.6'
classpath 'org.tboox:gradle-xmake-plugin:1.1.7'
}
repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion gradle-xmake-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
apply plugin: 'groovy'

group = "org.tboox"
version = "1.1.6"
version = "1.1.7"

repositories {
// Use mavenCentral for resolving your dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class XMakeConfigureTask extends DefaultTask {
} else {
String stl = taskContext.stl
if (stl != null) {
parameters.add("--ndk_cxxstl=" + stl)
parameters.add("--runtimes=" + stl)
}
}
parameters.add("--buildir=" + taskContext.buildDirectory.path)
Expand Down
18 changes: 7 additions & 11 deletions gradle-xmake-plugin/src/main/resources/lua/install_artifacts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ function _get_targets(...)
if targetNames.n > 0 then
for _, targetName in ipairs(targetNames) do
local target = project.target(targetName)
if target:get("enabled") ~= false and target:targetkind() == "shared" then
if target:get("enabled") ~= false and target:is_shared() then
table.insert(targets, target)
else
raise("invalid target(%s)!", targetName)
end
end
else
for _, target in pairs(project.targets()) do
for _, target in ipairs(project.ordertargets()) do
local default = target:get("default")
if (default == nil or default == true) and target:targetkind() == "shared" then
if (default == nil or default == true) and target:is_shared() then
table.insert(targets, target)
end
end
Expand All @@ -29,8 +29,6 @@ end

-- install artifacts
function _install_artifacts(libsdir, installdir, targets, arch)

-- append arch sub-directory
libsdir = path.join(libsdir, arch, "lib")
installdir = path.join(installdir, arch)

Expand All @@ -45,22 +43,20 @@ end

-- install cxxstl for ndk >= r25
function _install_cxxstl_newer_ndk(installdir, arch)
-- append arch sub-directory
installdir = path.join(installdir, arch)

local ndk = get_config("ndk")
local ndk_cxxstl = get_config("ndk_cxxstl")

if ndk and ndk_cxxstl and ndk_cxxstl:endswith("_shared") and arch then

-- get the toolchains arch
local toolchains_archs = {
["armeabi-v7a"] = "arm-linux-androideabi",
["arm64-v8a"] = "aarch64-linux-android",
["x86"] = "i686-linux-android",
["x86_64"] = "x86_64-linux-android"
}

-- get stl library
local cxxstl_filename
if ndk_cxxstl == "c++_shared" then
Expand All @@ -71,7 +67,7 @@ function _install_cxxstl_newer_ndk(installdir, arch)
local ndk_toolchain = toolchain.load("ndk", {plat = config.plat(), arch = config.arch()})
local ndk_sysroot = ndk_toolchain:config("ndk_sysroot")
local cxxstl_sdkdir_llvmstl = path.translate(format("%s/usr/lib/%s", ndk_sysroot, toolchains_archs[arch]))

os.vcp(path.join(cxxstl_sdkdir_llvmstl, cxxstl_filename), path.join(installdir, cxxstl_filename))
end

Expand Down Expand Up @@ -181,7 +177,7 @@ function main(libsdir, installdir, archs, ...)
for _, arch in ipairs({"armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"}) do
if abi_filters[arch] then
_install_artifacts(libsdir, installdir, targets, arch)

if get_config("ndkver") >= 25 then
_install_cxxstl_newer_ndk(installdir, arch)
else
Expand Down
7 changes: 4 additions & 3 deletions nativelib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'org.tboox.gradle-xmake-plugin' version '1.1.6'
id 'org.tboox.gradle-xmake-plugin' version '1.1.7'
}
apply plugin: 'com.android.library'
//apply plugin: "org.tboox.gradle-xmake-plugin"
Expand Down Expand Up @@ -52,8 +52,9 @@ android {
path "jni/CMakeLists.txt"
}*/

/*
xmake {
//logLevel "verbose"
logLevel "verbose"
path "jni/xmake.lua"
buildMode "debug"
//arguments "--test=y"
Expand All @@ -62,7 +63,7 @@ android {
//stdcxx false
//ndk "/Users/ruki/files/android-ndk-r20b/"
//sdkver 21
}
}*/
}

buildTypes {
Expand Down

0 comments on commit 3259f30

Please sign in to comment.