repositories {
    ivy {
        artifactPattern "$projectDir/repo/[organization]/[module]-[revision].[ext]"
        ivyPattern "$projectDir/repo/[organization]/ivy-[module]-[revision].xml"
    }
}

configurations {
    sealife
    alllife
}

dependencies {
    sealife "sea.mammals:orca:1.0", "sea.fish:shark:1.0", "sea.fish:tuna:1.0"
    alllife configurations.sealife
    alllife "air.birds:albatross:1.0"
}

task dependencies {
    doLast {
        configurations.alllife.dependencies.each { dep -> println dep.name }
        println()
        configurations.alllife.allDependencies.each { dep -> println dep.name }
        println()
        configurations.alllife.allDependencies.findAll { dep -> dep.name != 'orca' }
            .each { dep -> println dep.name }
    }
}

task allFiles {
    doLast {
        configurations.sealife.files.each { file ->
            println file.name
        }
    }
}

task files {
    doLast {
        configurations.sealife.files { dep -> dep.name == 'orca' }.each { file ->
            println file.name
        }
    }
}


task copy {
    doLast {
        configurations.alllife.copyRecursive { dep -> dep.name != 'orca' }
            .allDependencies.each { dep -> println dep.name }
        println()
        configurations.alllife.copy().allDependencies
            .each { dep -> println dep.name }
    }
}

task copyVsFiles {
    doLast {
        configurations.sealife.copyRecursive { dep -> dep.name == 'orca' }
            .each { file -> println file.name }
        println()
        configurations.sealife.files { dep -> dep.name == 'orca' }
            .each { file -> println file.name }
    }
}
