How to set project.version by passing version property on gradle command line?

前端 未结 6 893
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 03:55

I want to build JAR with self-defined version passed via command line, such as:

When I execute gradle build task like this:

gradle build -Pversion=1.         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 04:43

    version = (findProperty('version') == 'unspecified') ? '0.1' : version

提交回复
热议问题