Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for GreetingToFileTask (1.06 sec)

  1. platforms/documentation/docs/src/snippets/tasks/customTaskWithFileProperty/kotlin/build.gradle.kts

    // tag::task[]
    abstract class GreetingToFileTask : DefaultTask() {
    
        @get:OutputFile
        abstract val destination: RegularFileProperty
    
        @TaskAction
        fun greet() {
            val file = destination.get().asFile
            file.parentFile.mkdirs()
            file.writeText("Hello!")
        }
    }
    // end::task[]
    
    // tag::config[]
    val greetingFile = objects.fileProperty()
    
    tasks.register<GreetingToFileTask>("greet") {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 764 bytes
    - Viewed (0)
  2. platforms/documentation/docs/src/snippets/tasks/customTaskWithFileProperty/groovy/build.gradle

    abstract class GreetingToFileTask extends DefaultTask {
    
        @OutputFile
        abstract RegularFileProperty getDestination()
    
        @TaskAction
        def greet() {
            def file = getDestination().get().asFile
            file.parentFile.mkdirs()
            file.write 'Hello!'
        }
    }
    // end::task[]
    
    // tag::config[]
    def greetingFile = objects.fileProperty()
    
    tasks.register('greet', GreetingToFileTask) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Nov 27 17:53:42 UTC 2023
    - 718 bytes
    - Viewed (0)
Back to top