Skip to content

Instantly share code, notes, and snippets.

@davidparsson
Last active January 4, 2016 06:09
Show Gist options
  • Select an option

  • Save davidparsson/8580251 to your computer and use it in GitHub Desktop.

Select an option

Save davidparsson/8580251 to your computer and use it in GitHub Desktop.

Revisions

  1. davidparsson revised this gist Jan 23, 2014. 3 changed files with 2 additions and 16 deletions.
    4 changes: 2 additions & 2 deletions build.gradle after modification → build.gradle
    Original file line number Diff line number Diff line change
    @@ -6,8 +6,8 @@ task(copyInput, type: Copy) {
    }

    processResources {
    dependsOn copyInput
    //from 'input.txt'
    //dependsOn copyInput // Enable this line after first execution
    from 'input.txt' // Disable this line after first execution

    from 'anotherInput.txt'
    }
    13 changes: 0 additions & 13 deletions build.gradle before modification
    Original file line number Diff line number Diff line change
    @@ -1,13 +0,0 @@
    apply plugin: 'java'

    task(copyInput, type: Copy) {
    from 'input.txt'
    into "${sourceSets.main.output.resourcesDir}"
    }

    processResources {
    //dependsOn copyInput
    from 'input.txt'

    from 'anotherInput.txt'
    }
    1 change: 0 additions & 1 deletion Console log → console.log
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    $ gradle clean processResources
    :clean
    :processResources
  2. davidparsson created this gist Jan 23, 2014.
    39 changes: 39 additions & 0 deletions Console log
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,39 @@

    $ gradle clean processResources
    :clean
    :processResources

    BUILD SUCCESSFUL

    Total time: 2.119 secs

    $ ls build/resources/main/input.txt
    build/resources/main/input.txt

    $ # Modify build.gradle here, by enabling line 9 and disabling line 10.

    $ gradle clean processResources
    :clean
    :copyInput
    :processResources

    BUILD SUCCESSFUL

    Total time: 2.895 secs

    $ ls build/resources/main/input.txt
    ls: build/resources/main/input.txt: No such file or directory

    $ # File should exist!

    $ gradle clean processResources
    :clean
    :copyInput
    :processResources

    BUILD SUCCESSFUL

    Total time: 2.036 secs

    $ ls build/resources/main/input.txt
    build/resources/main/input.txt
    13 changes: 13 additions & 0 deletions build.gradle after modification
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    apply plugin: 'java'

    task(copyInput, type: Copy) {
    from 'input.txt'
    into "${sourceSets.main.output.resourcesDir}"
    }

    processResources {
    dependsOn copyInput
    //from 'input.txt'

    from 'anotherInput.txt'
    }
    13 changes: 13 additions & 0 deletions build.gradle before modification
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    apply plugin: 'java'

    task(copyInput, type: Copy) {
    from 'input.txt'
    into "${sourceSets.main.output.resourcesDir}"
    }

    processResources {
    //dependsOn copyInput
    from 'input.txt'

    from 'anotherInput.txt'
    }