Skip to content

Commit 5cf5544

Browse files
committed
feat: AndroidMavenPubPlugin.kt 完善,支持定义绝对路径的localrepo
1 parent 2ac5c54 commit 5cf5544

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

gradlePlugins/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ group = "com.github.hanlyjiang"
3030
// 1. 插件本身并不包括jar,仅仅是通过pom指向这个插件仓库的jar,如gradlePlugins.jar;
3131
// 2. 打包插件时及引入插件时,我们都不能单独为 gradlePlugins.jar 指定版本;
3232
// 3. 如果几个插件版本不同,指向的插件仓库的jar就会有问题;
33-
version = "0.0.13"
33+
version = "0.0.14"
3434

3535

3636
// 多个插件时,gradlePlugin需要放置到pluginBundle前面,避免出现pluginBundle中找不到插件config的情况

gradlePlugins/src/main/java/io/hanlyjiang/gradle/android/AndroidMavenPubPlugin.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,15 @@ class AndroidMavenPubPlugin : Plugin<Project> {
179179
if (pluginExtension.projectLocalRepoPath.isPresent) {
180180
project.rootProject.run {
181181
dir = objects.directoryProperty().apply {
182-
set(File(rootDir, pluginExtension.projectLocalRepoPath.get()))
182+
pluginExtension.projectLocalRepoPath.get().let {
183+
if (it.startsWith("/")) {
184+
// 绝对路径
185+
set(File(it))
186+
} else {
187+
// 相对路径
188+
set(File(rootDir, pluginExtension.projectLocalRepoPath.get()))
189+
}
190+
}
183191
}.get()
184192
}
185193
}

0 commit comments

Comments
 (0)