diff --git a/build-plugins/src/main/groovy/com/cloudogu/scm/TouchFilesTask.groovy b/build-plugins/src/main/groovy/com/cloudogu/scm/TouchFilesTask.groovy index 318cf30987..c65d4037b0 100644 --- a/build-plugins/src/main/groovy/com/cloudogu/scm/TouchFilesTask.groovy +++ b/build-plugins/src/main/groovy/com/cloudogu/scm/TouchFilesTask.groovy @@ -1,16 +1,39 @@ +/* + * MIT License + * + * Copyright (c) 2020-present Cloudogu GmbH and Contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package com.cloudogu.scm import org.gradle.api.DefaultTask import org.gradle.api.tasks.Input -import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.TaskAction import java.time.Instant class TouchFilesTask extends DefaultTask { - @InputDirectory - File directory + @Input + Object directory @Input String extension @@ -28,8 +51,16 @@ class TouchFilesTask extends DefaultTask { @TaskAction public void execute() { - if (directory.exists()) { - touch(directory) + if (directory instanceof File) { + touchDirectory(directory) + } else if (directory instanceof String) { + touchDirectory(new File((String) directory)) + } + } + + private void touchDirectory(File file) { + if (file.exists()) { + touch(file) } } diff --git a/scm-plugins/scm-git-plugin/build.gradle b/scm-plugins/scm-git-plugin/build.gradle index 0adba2be42..0440fbe231 100644 --- a/scm-plugins/scm-git-plugin/build.gradle +++ b/scm-plugins/scm-git-plugin/build.gradle @@ -24,7 +24,7 @@ plugins { - id 'org.scm-manager.smp' version '0.7.1' + id 'org.scm-manager.smp' version '0.7.2' } def jgitVersion = '5.6.1.202002131546-r-scm1' diff --git a/scm-plugins/scm-hg-plugin/build.gradle b/scm-plugins/scm-hg-plugin/build.gradle index f102883ab3..43cbf6d457 100644 --- a/scm-plugins/scm-hg-plugin/build.gradle +++ b/scm-plugins/scm-hg-plugin/build.gradle @@ -24,7 +24,7 @@ plugins { - id 'org.scm-manager.smp' version '0.7.1' + id 'org.scm-manager.smp' version '0.7.2' } dependencies { diff --git a/scm-plugins/scm-integration-test-plugin/build.gradle b/scm-plugins/scm-integration-test-plugin/build.gradle index ba729940d9..9938e122e6 100644 --- a/scm-plugins/scm-integration-test-plugin/build.gradle +++ b/scm-plugins/scm-integration-test-plugin/build.gradle @@ -24,7 +24,7 @@ plugins { - id 'org.scm-manager.smp' version '0.7.1' + id 'org.scm-manager.smp' version '0.7.2' } dependencies { diff --git a/scm-plugins/scm-legacy-plugin/build.gradle b/scm-plugins/scm-legacy-plugin/build.gradle index 39dbdd9e0d..a149f59bf7 100644 --- a/scm-plugins/scm-legacy-plugin/build.gradle +++ b/scm-plugins/scm-legacy-plugin/build.gradle @@ -24,7 +24,7 @@ plugins { - id 'org.scm-manager.smp' version '0.7.1' + id 'org.scm-manager.smp' version '0.7.2' } dependencies { diff --git a/scm-plugins/scm-svn-plugin/build.gradle b/scm-plugins/scm-svn-plugin/build.gradle index 4725796489..06fa7e9b1f 100644 --- a/scm-plugins/scm-svn-plugin/build.gradle +++ b/scm-plugins/scm-svn-plugin/build.gradle @@ -24,7 +24,7 @@ plugins { - id 'org.scm-manager.smp' version '0.7.1' + id 'org.scm-manager.smp' version '0.7.2' } def svnkitVersion = '1.10.1-scm2'