Comments (4)
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.
@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.
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.
@BreadMoirai ok thank you I will give this a try
from github-release-gradle-plugin.
Related Issues (20)
- Add a dry run option HOT 3
- Release succeeds even though asset upload fails HOT 2
- Update to OkHttp 4.x HOT 1
- [question] is it possible to call twice in a row githubRelease
- Plugin errors when using a new value for GRADLE_USER_HOME HOT 2
- Incompatible with Gradle 7.x
- githubRelease stopped working with 2.3.7 HOT 4
- Plugin portal contains 2.3.12 HOT 1
- Changelogs periodically empty HOT 1
- Calling `setReleaseAssets ` function on the `GithubReleaseTask` causes build to fail.
- Add support for github generated changelogs HOT 1
- Defer the creation of githubRelease task HOT 1
- Client field related error HOT 2
- Review distributed jar contents
- Cannot configure project with release 2.5.0/2.5.1 HOT 2
- Cannot configure project with 2.4.1
- Why library's jar file is so huge?
- Cause: path may not be null or empty string. path='' HOT 1
- java.io.FileNotFoundException: somepath (Access is denied)
- 2.5.2: project no longer configures after update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from github-release-gradle-plugin.