From 65669ee1851895adaa73cb4e92c611fc263a3b77 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Tue, 14 Jun 2022 18:32:21 +0200 Subject: [PATCH] [skip ci] remove deprecated funtions --- .../provs/framework/core/Prov.kt | 17 ----------------- .../ubuntu/filesystem/base/Filesystem.kt | 16 ---------------- 2 files changed, 33 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt index 343642e..27defa6 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/Prov.kt @@ -82,15 +82,6 @@ open class Prov protected constructor( return evaluate(ResultMode.ALL, name) { task() } } - /** - * defines a task with default success behavior, i.e. returns success if all subtasks finished with success. - * Same as requireAll. - */ - @Deprecated("Use function task instead", replaceWith = ReplaceWith("task()")) - fun def(a: Prov.() -> ProvResult): ProvResult { - return evaluate(ResultMode.ALL) { a() } - } - /** * defines a task, which returns the returned result, the results of sub-tasks are not considered */ @@ -105,14 +96,6 @@ open class Prov protected constructor( return evaluate(ResultMode.OPTIONAL) { a() } } - /** - * defines a task, which returns success if all subtasks finished with success - */ - @Deprecated("Use function task instead", replaceWith = ReplaceWith("task()")) - fun requireAll(a: Prov.() -> ProvResult): ProvResult { - return evaluate(ResultMode.ALL) { a() } - } - /** * defines a task, which exits the overall execution on failure */ diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/Filesystem.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/Filesystem.kt index 22e56cc..b1ac8b1 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/Filesystem.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/filesystem/base/Filesystem.kt @@ -6,14 +6,6 @@ import java.io.File import java.util.* -/** - * Returns true if the given file exists. - */ -@Deprecated("Use checkFile", replaceWith = ReplaceWith("checkFile(file)")) -fun Prov.fileExists(file: String, sudo: Boolean = false): Boolean { - return cmdNoEval(prefixWithSudo("test -e " + file, sudo)).success -} - /** * Returns true if the given file exists. */ @@ -288,14 +280,6 @@ fun Prov.checkDir(dir: String, path: String? = null, sudo: Boolean = false): Boo return cmdNoEval(if (sudo) cmd.sudoizeCommand() else cmd).success } -@Deprecated("Use checkDir instead.", replaceWith = ReplaceWith("checkDir(dir)")) -fun Prov.dirExists(dir: String, path: String? = null, sudo: Boolean = false): Boolean { - val effectivePath = if (path != null) path else - (if (dir.startsWith(File.separator)) File.separator else "~" + File.separator) - val cmd = "cd $effectivePath && test -d $dir" - return cmdNoEval(if (sudo) cmd.sudoizeCommand() else cmd).success -} - fun Prov.createDir( dir: String,