我想执行一个gradle publish任务,该任务被定制为在local-maven-repo上发布一个tgz文件,我该怎么做?
我已经尝试过了 但是1)它不发布任何东西 2)它在执行具有doLast的任务之前启动。我无法在其中添加doLast,它会引发错误“ no doLast方法”
that.publishing{publications {
myPublishTask(MavenPublication) {
def sourceFile = "$buildDir/npm/${that.project.name}-js-${that.project.version}.tgz"
artifactId that.project.name + "-js"
groupId project.group
version project.version
artifact source: sourceFile, extension: 'tgz'
}
}
}