Skip to content

Instantly share code, notes, and snippets.

View Opalo's full-sized avatar

Maciek Opala Opalo

View GitHub Profile
task t1
task t2 {
dependsOn = t1
}
task cloneProtobuf(type:Exec) {
workingDir '.'
commandLine 'git', 'clone', '[email protected]:google/protobuf.git', 'build/protobuf'
outputs.file 'build/protobuf/.git/config'
}
tasks.withType(CreateStartScripts) {
def tplName = 'unixStartScriptTemplate.txt'
assert new File(tplName).exists()
template = resources.text.fromFile(tplName)
}
processResources {
def profile = project.properties['profile']
def replace_tokens = profile ? filter_tokens[profile] : filter_tokens['default']
exclude '**/log4j-test.xml'
from('src/main/resources') {
exclude '**/*.ttf'
println 'a'
task t1 {
doFirst {
println 'b'
}
}
println 'c'
task itMustRun
task itMustRun {
doFirst {
println "It's running from start..."
}
doLast {
println "...to an end."
}
}
task unit(type: Test)
task functional(type: Test)
task check // lifecycle task
task report
task unit(type: Test)
task functional(type: Test)
task check // lifecycle task
task report
check.dependsOn unit, functional
functional.mustRunAfter unit //shouldRunAfter
import io.vavr.collection.List;
import io.vavr.control.Try;
class Lol {
public static void main(String[] args) {
final List<Node> myNodeList = Try.of(NodeUtils::new)
.onFailure(System.out::println)
.mapTry(NodeUtils::retrieveNodes)
.getOrElse(List.empty());