Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for afterTask (0.19 sec)

  1. subprojects/core/src/integTest/groovy/org/gradle/api/tasks/TaskEventsErrorIntegrationTest.groovy

        }
    
        def "reports task as failed when afterTask closure fails"() {
            when:
            buildFile << """
        gradle.taskGraph.afterTask {
            throw new RuntimeException("afterTask failure")
        }
        task test
    """
            then:
            fails('test')
            failure.assertHasDescription("Execution failed for task ':test'.")
                    .assertHasCause("afterTask failure")
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Jan 03 03:20:08 UTC 2023
    - 3K bytes
    - Viewed (0)
  2. subprojects/core/src/integTest/groovy/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationTypeIntegrationTest.groovy

        }
    
        @UnsupportedWithConfigurationCache
        def "does emit result for afterTask failure"() {
            when:
            buildScript """
                task t {
                    doLast {}
                }
    
                gradle.taskGraph.afterTask {
                    throw new RuntimeException("!")
                }
            """
            fails "t"
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Aug 18 22:50:47 UTC 2020
    - 4.1K bytes
    - Viewed (0)
  3. platforms/core-configuration/configuration-cache/src/main/kotlin/org/gradle/internal/cc/impl/CrossProjectConfigurationReportingTaskExecutionGraph.kt

        }
    
        @Deprecated("Deprecated in Java")
        override fun afterTask(closure: Closure<*>) {
            @Suppress("DEPRECATION")
            delegate.afterTask(closure)
        }
    
        @Deprecated("Deprecated in Java")
        override fun afterTask(action: Action<Task>) {
            @Suppress("DEPRECATION")
            delegate.afterTask(action)
        }
    
        // endregion
    
        override fun resetState() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Sat Jun 08 11:29:25 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  4. platforms/documentation/docs/src/snippets/buildlifecycle/taskExecutionEvents/groovy/build.gradle

    tasks.register('broken') {
        dependsOn ok
        doLast {
            throw new RuntimeException('broken')
        }
    }
    
    gradle.taskGraph.beforeTask { Task task ->
        println "executing $task ..."
    }
    
    gradle.taskGraph.afterTask { Task task, TaskState state ->
        if (state.failure) {
            println "FAILED"
        }
        else {
            println "done"
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 370 bytes
    - Viewed (0)
  5. platforms/documentation/docs/src/snippets/buildlifecycle/taskExecutionEvents/kotlin/build.gradle.kts

    tasks.register("ok")
    
    tasks.register("broken") {
        dependsOn("ok")
        doLast {
            throw RuntimeException("broken")
        }
    }
    
    gradle.taskGraph.beforeTask {
        println("executing $this ...")
    }
    
    gradle.taskGraph.afterTask {
        if (state.failure != null) {
            println("FAILED")
        } else {
            println("done")
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 333 bytes
    - Viewed (0)
  6. subprojects/core/src/integTest/groovy/org/gradle/api/events/BuildExecutionEventsIntegrationTest.groovy

            noExceptionThrown()
    
            where:
            path                          | registrationPoint
            "gradle.taskGraph.beforeTask" | "TaskExecutionGraph.beforeTask"
            "gradle.taskGraph.afterTask"  | "TaskExecutionGraph.afterTask"
        }
    
        @UnsupportedWithConfigurationCache(because = "tests listener behaviour")
        def "events passed to any task execution listener are synchronised"() {
            createDirs("a", "b", "c")
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 24 06:54:47 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  7. platforms/core-runtime/launcher/src/integTest/groovy/org/gradle/launcher/continuous/ChangesDuringBuildContinuousIntegrationTest.groovy

            then:
            assert classloader.loadClass('Thing').getDeclaredFields()*.name == ["CHANGED"]
        }
    
        @UnsupportedWithConfigurationCache(because = "taskGraph.afterTask")
        def "new build should be triggered when input files to tasks are changed after each task has been executed, but before the build has completed (changed: #changingInput)"() {
            given:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:29:13 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  8. subprojects/core/src/main/java/org/gradle/execution/taskgraph/DefaultTaskExecutionGraph.java

        }
    
        @Override
        public void afterTask(final Closure closure) {
            notifyListenerRegistration("TaskExecutionGraph.afterTask", closure);
            taskListeners.add(new ClosureBackedMethodInvocationDispatch("afterExecute", closure));
        }
    
        @Override
        public void afterTask(final Action<Task> action) {
            notifyListenerRegistration("TaskExecutionGraph.afterTask", action);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 13:46:07 UTC 2024
    - 15.2K bytes
    - Viewed (0)
  9. subprojects/core-api/src/main/java/org/gradle/api/execution/TaskExecutionGraph.java

         *
         * @param closure The closure to execute when a task has been executed
         * @deprecated This method is not supported when configuration caching is enabled.
         */
        @Deprecated
        void afterTask(Closure closure);
    
        /**
         * <p>Adds an action to be called immediately after a task has executed. The task is passed to the action as the
         * first parameter.</p>
         *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Aug 02 20:29:51 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  10. platforms/core-runtime/launcher/src/integTest/groovy/org/gradle/launcher/continuous/ContinuousBuildChangeReportingIntegrationTest.groovy

        }
    
        @ToBeFixedForConfigurationCache(because = "taskGraph.afterTask")
        def "should report changes that happen when the build is executing"() {
            given:
            buildFile << """
                gradle.taskGraph.afterTask { Task task ->
                    if(task.path == ':theTask' && !file('changetrigged').exists()) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:29:13 UTC 2023
    - 10.2K bytes
    - Viewed (0)
Back to top