Skip to content

Commit

Permalink
improve to detect ndk
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Apr 27, 2020
1 parent 52563f2 commit 0946c54
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 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.0.9'
id 'org.tboox.gradle-xmake-plugin' version '1.1.0'
}
```

Expand All @@ -70,7 +70,7 @@ buildscript {
}
}
dependencies {
classpath 'org.tboox:gradle-xmake-plugin:1.0.9'
classpath 'org.tboox:gradle-xmake-plugin:1.1.0'
}
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.0.9'
id 'org.tboox.gradle-xmake-plugin' version '1.1.0'
}
```

Expand All @@ -70,7 +70,7 @@ buildscript {
}
}
dependencies {
classpath 'org.tboox:gradle-xmake-plugin:1.0.9'
classpath 'org.tboox:gradle-xmake-plugin:1.1.0'
}
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.0.9"
version = "1.1.0"

repositories {
// Use jcenter for resolving your dependencies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ class XMakeTaskContext {
if (ndk != null) {
return new File(ndk).absoluteFile
}

def androidExtension = project.getProperties().get("android")
if (androidExtension != null) {
if (androidExtension instanceof LibraryExtension) {
LibraryExtension libraryExtension = androidExtension
if (libraryExtension.ndkDirectory != null && libraryExtension.ndkDirectory.exists()) {
return libraryExtension.ndkDirectory.absoluteFile
}
} else if (androidExtension instanceof AppExtension) {
AppExtension appExtension = androidExtension
if (appExtension.ndkDirectory != null && appExtension.ndkDirectory.exists()) {
return appExtension.ndkDirectory.absoluteFile
}
}
}
return null
}

Expand Down
2 changes: 1 addition & 1 deletion 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.0.9'
id 'org.tboox.gradle-xmake-plugin' version '1.1.0'
}

apply plugin: 'com.android.library'
Expand Down

0 comments on commit 0946c54

Please sign in to comment.