Skip to content

Commit 9c06fe3

Browse files
committed
update version
1 parent 24cfc70 commit 9c06fe3

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ XMake installed on the system. Available [here](https://github.com/xmake-io/xmak
5555

5656
```
5757
plugins {
58-
id 'org.tboox.gradle-xmake-plugin' version '1.0.2'
58+
id 'org.tboox.gradle-xmake-plugin' version '1.0.3'
5959
}
6060
```
6161

@@ -69,7 +69,7 @@ buildscript {
6969
}
7070
}
7171
dependencies {
72-
classpath 'org.tboox:gradle-xmake-plugin:1.0.2'
72+
classpath 'org.tboox:gradle-xmake-plugin:1.0.3'
7373
}
7474
repositories {
7575
mavenCentral()
@@ -174,7 +174,6 @@ The `xmakeBuild` will be injected to `assemble` task automatically if the gradle
174174

175175
```console
176176
$ ./gradlew app:assembleDebug
177-
> Task :nativelib:xmakePrebuild
178177
> Task :nativelib:xmakeConfigureForArm64
179178
> Task :nativelib:xmakeBuildForArm64
180179
>> xmake build

README_zh.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ xmake-gradle是一个无缝整合xmake的gradle插件。
5757

5858
```
5959
plugins {
60-
id 'org.tboox.gradle-xmake-plugin' version '1.0.2'
60+
id 'org.tboox.gradle-xmake-plugin' version '1.0.3'
6161
}
6262
```
6363

@@ -71,7 +71,7 @@ buildscript {
7171
}
7272
}
7373
dependencies {
74-
classpath 'org.tboox:gradle-xmake-plugin:1.0.2'
74+
classpath 'org.tboox:gradle-xmake-plugin:1.0.3'
7575
}
7676
repositories {
7777
mavenCentral()
@@ -177,7 +177,6 @@ android {
177177

178178
```console
179179
$ ./gradlew app:assembleDebug
180-
> Task :nativelib:xmakePrebuild
181180
> Task :nativelib:xmakeConfigureForArm64
182181
> Task :nativelib:xmakeBuildForArm64
183182
>> xmake build

gradle-xmake-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
apply plugin: 'groovy'
99

1010
group = "org.tboox"
11-
version = "1.0.2"
11+
version = "1.0.3"
1212

1313
repositories {
1414
// Use jcenter for resolving your dependencies.

gradle-xmake-plugin/src/main/groovy/org/tboox/gradle/XMakeInstallTask.groovy

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
package org.tboox.gradle
2222

23+
import com.android.build.gradle.AppExtension
24+
import com.android.build.gradle.LibraryExtension
2325
import org.gradle.api.DefaultTask
2426
import org.gradle.api.GradleException
2527
import org.gradle.api.tasks.TaskAction
@@ -97,5 +99,36 @@ class XMakeInstallTask extends DefaultTask {
9799
// do install
98100
XMakeExecutor executor = new XMakeExecutor(taskContext.logger, false)
99101
executor.exec(buildCmdLine(installArtifactsScriptFile), taskContext.projectDirectory)
102+
103+
/* add libs directory to sourceSets
104+
*
105+
sourceSets {
106+
main {
107+
jniLibs.srcDirs = ["libs"]
108+
}
109+
}
110+
*/
111+
def androidExtension = taskContext.project.getProperties().get("android")
112+
if (androidExtension != null) {
113+
if (androidExtension instanceof LibraryExtension) {
114+
LibraryExtension libraryExtension = androidExtension
115+
def sourceSets = libraryExtension.sourceSets
116+
if (sourceSets != null) {
117+
def main = sourceSets.getByName("main")
118+
if (main != null && main.jniLibs != null && main.jniLibs.srcDirs != null) {
119+
main.jniLibs.srcDirs("libs")
120+
}
121+
}
122+
} else if (androidExtension instanceof AppExtension) {
123+
AppExtension appExtension = androidExtension
124+
def sourceSets = appExtension.sourceSets
125+
if (sourceSets != null) {
126+
def main = sourceSets.getByName("main")
127+
if (main != null && main.jniLibs != null && main.jniLibs.srcDirs != null) {
128+
main.jniLibs.srcDirs("libs")
129+
}
130+
}
131+
}
132+
}
100133
}
101134
}

nativelib/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ android {
5757
}
5858
}
5959

60-
sourceSets {
61-
main {
62-
jniLibs.srcDirs = ["libs"]
63-
}
64-
}
65-
6660
buildTypes {
6761
release {
6862
minifyEnabled false

0 commit comments

Comments
 (0)