How to pass parameters or arguments into a gradle task

前端 未结 6 2014
独厮守ぢ
独厮守ぢ 2020-12-29 00:41

I have a gradle build script into which I am trying to include Eric Wendelin\'s css plugin - http://eriwen.github.io/gradle-css-plugin/

Its easy enough to implement,

6条回答
  •  孤独总比滥情好
    2020-12-29 01:26

    task mathOnProperties << {
        println Integer.parseInt(a)+Integer.parseInt(b)
        println new Integer(a) * new Integer(b)
    }
    

    $ gradle -Pa=3 -Pb=4 mathOnProperties
    :mathOnProperties
    7
    12
    
    BUILD SUCCESSFUL
    

提交回复
热议问题