GithubHelp home page GithubHelp logo

Comments (4)

BreadMoirai avatar BreadMoirai commented on July 28, 2024

Hi, if the dynamic task configuration does not work, you can access the Task object using any of the following

tasks['githubRelease']
tasks.getByName('githubRelease')
tasks.getByPath('githubRelease')

from github-release-gradle-plugin.

akasolace avatar akasolace commented on July 28, 2024

@BreadMoirai thank you for your answer, but actually I still have the following issue:

I am trying to have githubRelease executed at the end of my build script.
The problem is that releaseAssets = file("$target_dir").listFiles() is executed only during the configuration phase, at that time my directory is empty because the executables have not be produced yet. Hence when githubRelease is finally executed at the end of my script it fails.

Hence, at the moment I am force to run first my build script without githubRelease task and then run githubRelease separately. I was wondering if there was a way of doing what I wanted or if it simply not possible but so far I could not find a way to force the configuration of githubRelease to be kind of re-run ...

from github-release-gradle-plugin.

BreadMoirai avatar BreadMoirai commented on July 28, 2024

I think the normal use case is to run the task after the build script runs but in the case that you need more flexibility you can work with the task graph.
I'm not wholly familiar with the task graph api so some parts of the code might be redundant.

gradle.taskGraph.whenReady { graph ->
    graph.beforeTask { task ->
        if (task.name == "githubRelease") {
            task.releaseAssets = file("$target_dir").listFiles()
        }
	}
}

To my knowledge, the listFiles() call is redundant and may be whats causing issues.
you are assigning a list of files to the releaseAssets where the directory itself should be sufficient.
releaseAssets = file(target_dir)

from github-release-gradle-plugin.

akasolace avatar akasolace commented on July 28, 2024

@BreadMoirai ok thank you I will give this a try

from github-release-gradle-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.