Gradle build without tests

后端 未结 13 1549
后悔当初
后悔当初 2020-12-12 08:41

I want to execute gradle build without executing the unit tests. I tried:

$ gradle -Dskip.tests build

That doesn\'t seem to

13条回答
  •  自闭症患者
    2020-12-12 09:24

    Reference

    To exclude any task from gradle use -x command-line option. See the below example

    task compile << {
        println 'task compile'
    }
    
    task compileTest(dependsOn: compile) << {
        println 'compile test'
    }
    
    task runningTest(dependsOn: compileTest) << {
        println 'running test'
    }
    task dist(dependsOn:[runningTest, compileTest, compile]) << {
        println 'running distribution job'
    }
    

    Output of: gradle -q dist -x runningTest

    task compile
    compile test
    running distribution job
    

    Hope this would give you the basic

提交回复
热议问题