概述
问题
I am trying to create version numbers based git commits, but I keep getting the following error when I run gradle (this is in the build.gradle file)
ext {
// Get version number and build number
def gitNum = "git rev-list --count master".execute().text.trim()
def version = (gitNum / 10)
def build = (gitNum.toInterger % 10)
}
Error:
No signature of method: java.lang.String.div() is applicable for argument types:
(java.lang.Integer) values: [10] Possible solutions:
is(java.lang.Object), drop(int), wait(), trim(), dump(), any()
回答1:
I think this is what you want.
def gitNum = "git rev-list --count master".execute().text.trim().toInteger()
来源:https://stackoverflow.com/questions/49711193/no-signature-of-method-java-lang-string-div-is-applicable-for-argument-types
最后
以上就是长情酸奶为你收集整理的no number java_No signature of method: java.lang.String.div() is applicable for argument types: (jav...的全部内容,希望文章能够帮你解决no number java_No signature of method: java.lang.String.div() is applicable for argument types: (jav...所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复