Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 23 for beforeTask (0.12 sec)

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

        def "reports task as failed when beforeTask closure fails"() {
            when:
            buildFile << """
        gradle.taskGraph.beforeTask {
            throw new RuntimeException("beforeTask failure")
        }
        task test
    """
            then:
            fails('test')
            failure.assertHasDescription("Execution failed for task ':test'.")
                    .assertHasCause("beforeTask 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. platforms/core-configuration/configuration-cache/src/main/kotlin/org/gradle/internal/cc/impl/CrossProjectConfigurationReportingTaskExecutionGraph.kt

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

    tasks.register('ok')
    
    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)
  4. 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)
  5. subprojects/core/src/integTest/groovy/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationTypeIntegrationTest.groovy

        }
    
        @UnsupportedWithConfigurationCache
        def "does not emit result for beforeTask failure"() {
            when:
            buildScript """
                task t {
                    doLast {}
                }
    
                gradle.taskGraph.beforeTask {
                    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)
  6. subprojects/core/src/main/java/org/gradle/execution/taskgraph/DefaultTaskExecutionGraph.java

        }
    
        @Override
        public void beforeTask(final Closure closure) {
            notifyListenerRegistration("TaskExecutionGraph.beforeTask", closure);
            taskListeners.add(new ClosureBackedMethodInvocationDispatch("beforeExecute", closure));
        }
    
        @Override
        public void beforeTask(final Action<Task> action) {
            notifyListenerRegistration("TaskExecutionGraph.beforeTask", 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)
  7. subprojects/core/src/integTest/groovy/org/gradle/api/events/BuildExecutionEventsIntegrationTest.groovy

            run("broken")
    
            then:
            noExceptionThrown()
    
            where:
            path                          | registrationPoint
            "gradle.taskGraph.beforeTask" | "TaskExecutionGraph.beforeTask"
            "gradle.taskGraph.afterTask"  | "TaskExecutionGraph.afterTask"
        }
    
        @UnsupportedWithConfigurationCache(because = "tests listener behaviour")
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 24 06:54:47 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  8. subprojects/core-api/src/main/java/org/gradle/api/execution/TaskExecutionGraph.java

         *
         * @param closure The closure to execute when a task is about to be executed.
         * @deprecated This method is not supported when configuration caching is enabled.
         */
        @Deprecated
        void beforeTask(Closure closure);
    
        /**
         * <p>Adds an action to be called immediately before a task is executed. The task is passed to the action as a
         * 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)
  9. subprojects/core/src/integTest/groovy/org/gradle/api/internal/changedetection/state/UpToDateIntegTest.groovy

            then:
            skipped ":customTask"
    
            where:
            type << ["dir", "file"]
        }
    
        @ToBeFixedForConfigurationCache(because = "TaskExecutionGraph.beforeTask")
        @Issue("https://github.com/gradle/gradle/issues/15397")
        def "can add a file input in a task execution listener"() {
            buildFile << """
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri May 13 12:00:09 UTC 2022
    - 9.6K bytes
    - Viewed (0)
  10. platforms/enterprise/enterprise-operations/src/main/java/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationType.java

     *
     * That is, this operation does not represent just the execution of task actions.
     *
     * This operation can fail _and_ yield a result.
     * If the operation gets as far as invoking the task executer
     * (i.e. beforeTask callbacks did not fail), then a result is expected.
     * If the task execution fails, or if afterTask callbacks fail, an operation failure is expected _in addition_.
     */
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Feb 02 10:13:49 UTC 2024
    - 5.5K bytes
    - Viewed (0)
Back to top