如何将Makefile目标修复为Gradle目标?

时间:2019-01-10 13:12:01

标签: gradle groovy build.gradle

我正在为构建环境设置一个新的build.gradle。 为此,我想将现有的makefiles目标转换为gradle目标

以下代码属于makefile:

Default: Dest
    @${ECHO} ""
    @${ECHO} "Done building ${COMPONENT_NAME} $@."

Dest: Dest-Native
    @${ECHO} ""
    @${ECHO} "Done building ${COMPONENT_NAME} $@."

Clean: All-Dirs Clean-Native

All-Dirs :
        @${ECHO} ""
        @${ECHO} "Done building ${COMPONENT_NAME} $@."

Clean-Native :
        @${ECHO} ""
        @${ECHO} "Done building ${COMPONENT_NAME} $@."

请帮助我找到解决方案。

1 个答案:

答案 0 :(得分:0)

查看gradle官方教程:

https://docs.gradle.org/current/userguide/tutorial_using_tasks.html

简单任务定义:

task hello {
    doLast {
        println 'Hello world!'
    }
}
task intro {
    dependsOn hello
    doLast {
        println "I'm Gradle"
    }
}

因此,命令行gradle intro将执行hellointro任务

#a_gradle>gradle intro
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :hello
Hello world!

> Task :intro
I'm Gradle