Gradle에 작업 종속성을 나열하는 방법이 있습니까?
./gradle tasks
작업 중 "일부"를 나열합니다. http://gradle.org/docs/current/userguide/java_plugin.html을 보면 보이지 않는 숨겨진 것들이 있습니다. 또한 다른 플러그인에는 작업 간의 종속성에 대한 멋진 그래프가 없습니다.
방법이 있습니까
- gradle을 사용하여 모든 플러그인의 모든 작업을 나열하십시오.
- 작업과 그들이 의존하는 작업을 나열하십시오 (maven과 비슷
depenceny:tree
하지만 작업을위한 것)
--all 플래그를 사용하여 사용 가능한 작업 및 작업 종속성에 대한 자세한 목록을 얻을 수 있습니다
gradle tasks --all
편집 : 의견에서 Radim이 지적한 것처럼이 명령은 gradle 3.3 이상에 대한 종속성을보고하지 않습니다 ( https://docs.gradle.org/3.3/release-notes.html#improved-performance-of-tasks- 보고서 ).
작업과 그들이 의존하는 작업을 나열하십시오 (maven의 depenceny : tree와 같지만 작업을위한 것)
이를 위해 특정 명령에 대해 실행되지만 명령을 실행하지 않는 작업을 나열 하는 --dry-run
(또는 -m
) 옵션을 사용할 수 있습니다.
gradle assemble --dry-run
간단한 사용법으로 com.dorongold.task-tree 플러그인을 사용해 볼 수 있습니다.
gradle <task 1>...<task N> taskTree
이것을 당신의 것으로 붙일 수 있습니다 build.gradle
:
gradle.taskGraph.whenReady {taskGraph ->
println "Found task graph: " + taskGraph
println "Found " + taskGraph.allTasks.size() + " tasks."
taskGraph.allTasks.forEach { task ->
println task
task.dependsOn.forEach { dep ->
println " - " + dep
}
}
}
그런 다음 gradle로 작업을 실행하십시오.
./gradlew build
그리고 당신은 이것을 볼 것입니다 :
Found task graph: org.gradle.execution.taskgraph.DefaultTaskGraphExecuter@36eb780c
Found 19 tasks.
task ':compileJava'
- task 'compileJava' input files
task ':compileScala'
- task 'compileScala' input files
- compileJava
task ':processResources'
- task 'processResources' input files
task ':classes'
- org.gradle.api.internal.tasks.DefaultTaskDependency@287a7782
- task 'classes' input files
- compileJava
- dirs
- compileScala
- processResources
task ':jar'
- task 'jar' input files
task ':assemble'
- task 'assemble' input files
- org.gradle.api.internal.artifacts.DefaultPublishArtifactSet$ArtifactsTaskDependency@5bad9616
task ':compileTestJava'
- task 'compileTestJava' input files
task ':compileTestScala'
- task 'compileTestScala' input files
- compileTestJava
task ':processTestResources'
- task 'processTestResources' input files
task ':testClasses'
- processTestResources
- task 'testClasses' input files
- compileTestScala
- org.gradle.api.internal.tasks.DefaultTaskDependency@42c1fa08
- compileTestJava
- dirs
task ':compileIntegrationTestJava'
- task 'compileIntegrationTestJava' input files
task ':compileIntegrationTestScala'
- task 'compileIntegrationTestScala' input files
- compileIntegrationTestJava
task ':processIntegrationTestResources'
- task 'processIntegrationTestResources' input files
task ':integrationTestClasses'
- processIntegrationTestResources
- compileIntegrationTestJava
- org.gradle.api.internal.tasks.DefaultTaskDependency@7c8aa0fe
- compileIntegrationTestScala
- dirs
- task 'integrationTestClasses' input files
task ':composeUp'
- task 'composeUp' input files
task ':integrationTest'
- task ':composeUp'
- task 'integrationTest' input files
task ':test'
- task 'test' input files
task ':check'
- task 'check' input files
- task ':test'
- task ':integrationTest'
task ':build'
- task 'build' input files
- check
- assemble
Gradle을 --profile 정리 빌드
이 작업이 완료되면 build / reports / profile 폴더로 이동하여 .html 파일을 찾으십시오. 좋은 html 페이지에서 시간이 지남에 따라 종속성 해결 및 기타 정보가 표시됩니다.
You can programmatically access the task graph to inspect it within the build script using Gradle.getTaskGraph()
As your multiproject grows, the solution I marked as correct grows a bit unweildy and hard to read
gradle tasks --all
Instead, I have moved over to looking at a specific project making it much easier
gradlew :full-httpproxy:tasks --all
where 'full-httpproxy' is the name of my project(and directory as is typical).
I am however curious how to list tasks on the master/root project though and have an outstanding question here as well
How to list all tasks for the master project only in gradle?
as doing that doesn't seem possible right now.
참고URL : https://stackoverflow.com/questions/10422054/is-there-a-way-to-list-task-dependencies-in-gradle
'development' 카테고리의 다른 글
파이썬의 주요 컴포넌트 분석 (0) | 2020.08.03 |
---|---|
jQuery를 사용하여 클릭시 앵커 텍스트 / href를 얻는 방법은 무엇입니까? (0) | 2020.08.03 |
요소가 부모의 자식인지 확인 (0) | 2020.08.03 |
SQL Server : 열에서 행으로 (0) | 2020.08.03 |
프로그래밍 방식으로 연락처에 대한 액세스 요청 (0) | 2020.08.03 |