Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nugetPack.basePath incorrect annotated as a file #88

Open
pklima opened this issue Jan 18, 2022 · 0 comments
Open

nugetPack.basePath incorrect annotated as a file #88

pklima opened this issue Jan 18, 2022 · 0 comments

Comments

@pklima
Copy link

pklima commented Jan 18, 2022

Hello!

In Gradle 7.3.3, providing a directory path to nugetPack.basePath:

plugins {
    id 'com.ullink.nuget' version '2.23'
}

nugetPack {
    basePath = new File(projectDir, 'ThisIsADirectory')
}

...results in an error when nugetPack task is run:

> Task :nugetPack FAILED
:nugetPack (Thread[Execution worker for ':',5,main]) completed. Took 0.002 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':nugetPack' (type 'NuGetPack').
  - In plugin 'nuget-base' type 'com.ullink.NuGetPack' property 'basePath' specifies file 'W:\Repositories\gradle-plugins\gradle-test\ThisIsADirectory' which doesn't exist.

    Reason: An input file was expected to be present but it doesn't exist.

    Possible solutions:
      1. Make sure the file exists before the task is called.
      2. Make sure that the task which produces the file is declared as an input.

    Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#input_file_does_not_exist for more details about this problem.

Looking at the source, this is because the property is annotated as @InputFile which is incorrect in this case.

Changing it to @InputDirectory would fix the error, but then the contents of the directory would be considered for determining whether the task is up-to-date which in this case doesn't make sense, so this should just be @Input instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant