How can I define the teamcity['build.number'] property in gradle from command line

前端 未结 3 1727
天命终不由人
天命终不由人 2021-01-03 02:42

Is there a way to define teamcity[\'build.number\'] property from command line? I tried -Pteamcity.build.number=1 but it didn\'t work.

I have a build.gradle file wit

3条回答
  •  旧巷少年郎
    2021-01-03 03:18

    this works from the command line

    task hello << {
      println project.ext['teamcity.build.number']
    }
    

    and you call it

    gradle hello -Pteamcity.build.number=1.45
    

    hopefully that'll work also in your script

提交回复
热议问题