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

gradle outputs.files includes ghost file #19

Open
dirkraft opened this issue Dec 23, 2014 · 1 comment
Open

gradle outputs.files includes ghost file #19

dirkraft opened this issue Dec 23, 2014 · 1 comment
Labels

Comments

@dirkraft
Copy link

Small thing. Not sure what the gradle-recommended behavior is here.

task oneJar(type: OneJar) {
    doLast {
        outputs.files.forEach{
            printf('exists: %s, path: %s%n', it.exists(), it.absolutePath)
        }
    }
}

includes an ephemeral file

exists: false, path: /home/user/myproj/build/libs/standalone.jar
exists: true, path: /home/user/myproj/build/libs/myproj-0.0.1-SNAPSHOT-standalone.jar

which can muck up dependent gradle build scripts a little, since I would like to assume that there is only one OneJar output. So right now I have to filter out the temporary file to get the singleFile that I am expecting.

outputs.files.filter{ it.exists() }.singleFile

Might be nothing. The last line isn't a huge deal, but might be problematic down the road for other build scripts if they reference oneJar.outputs which includes a reference to a non-existent file.

@rholder rholder added the bug label Dec 24, 2014
@rholder
Copy link
Owner

rholder commented Dec 24, 2014

That is annoying. I wouldn't expect that ghost file to be in the outputs.files.

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

No branches or pull requests

2 participants