美文网首页
Gradle 插件本地debug调试

Gradle 插件本地debug调试

作者: kotlon | 来源:发表于2019-05-11 15:27 被阅读0次

Gradle 插件本地调试

首先在 terminal 中输入:

./gradlew assembleDebug -Dorg.gradle.daemon=false -Dorg.gradle.debug=true

然后在 app run 中:

image

创建好 remote 调试之后,选中该调试,接着按下 attach-debug:

image

接着就能进入到你设置好断点的 gradle plugin 代码中了。

Gradle plugin 本地路径通用写法

有时候,编写一个插件的时候,还是在本地发布,这里有一个支持本地 repo 的写法,在 uploadArchives 这样写,

repository(url: uri('../repo'))

uploadArchives {
    repositories.mavenDeployer {
        repository(url: uri('../repo'))
        pom.groupId = "com.yy.yylite.plugin"
        pom.artifactId = "LitePlugin"
        pom.version = "1.0.0"
    }
}

在 maven 地址中这样写,url uri('./repo')//指向根目录的下的repo:

buildscript {
    repositories {
        maven {
            url uri('./repo')//指向根目录的下的repo
        }
    }
}

相关文章

网友评论

      本文标题:Gradle 插件本地debug调试

      本文链接:https://www.haomeiwen.com/subject/dsbxaqtx.html