Coder Social home page Coder Social logo

Comments (8)

AlexTrotsenko avatar AlexTrotsenko commented on June 17, 2024

I am not proficient user of gradle, but I see, that this has to work this way.
For example: http://stackoverflow.com/a/11105927

from gradle-play-publisher.

ChristianKatzmann avatar ChristianKatzmann commented on June 17, 2024

Can you post some more lines of your build file? How do you initialize the generateReleasePlayResources property? It must be something like

def generateReleasePlayResources = project.tasks."generateReleasePlayResources"

from gradle-play-publisher.

AlexTrotsenko avatar AlexTrotsenko commented on June 17, 2024

Thank you for quick reply.

I have tried few different way of initialisation.

For example. For code, that you posted:

def generateReleasePlayResources = project.tasks."generateReleasePlayResources"
generateReleasePlayResources.dependsOn loadStoreListing

I am getting:

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find property 'generateReleasePlayResources' on task set.

Also, if I do something like this:

def generateReleasePlayResources = project.tasks.getByName("generateReleasePlayResources")

I am getting:

> Task with name 'generateReleasePlayResources' not found in project ':app'.

So, I have a feeling, that tasks from "play" plug-ing are not visible to my script for some reason.

But at the same time this code

gradle.taskGraph.whenReady {taskGraph ->
    def taskExists = taskGraph.hasTask(generateReleasePlayResources)
    println "generateReleasePlayResources exists: " + taskExists
}

produces
generateReleasePlayResources exists: true
So, it's actually visible somehow.

It's looks strange for me. Anyway, if you need any additional info - feel free to ask me.

from gradle-play-publisher.

ChristianKatzmann avatar ChristianKatzmann commented on June 17, 2024

Ok, can you try the following

project.afterEvaluate {
    def generateReleasePlayResources = project.tasks.getByName("generateReleasePlayResources")
    generateReleasePlayResources.dependsOn loadStoreListing
}

I think the tasks aren't initialized at the time you try to access them.

from gradle-play-publisher.

AlexTrotsenko avatar AlexTrotsenko commented on June 17, 2024

Thank you a lot for this suggestion. Now all working fine when I define dependencies this way.

Btw, previously I tried to do similar thing

gradle.taskGraph.whenReady {taskGraph ->
    def generateReleasePlayResources = project.tasks.getByName("generateReleasePlayResources")
    generateReleasePlayResources.dependsOn loadStoreListing
}

But my code was silently doing nothing.

Looks like project.afterEvaluate is called after Initialisation phase, while gradle.taskGraph.whenReady is called after Configuration phase and no changes to tasks' dependencies are really happening.

Thanks a lot, that you took care of this issue so quickly.

Also, it's definitely your responsibility, but I highly suggest adding this info somewhere to first "readme.md" page. For example, to "Configuration" section or just to the end of the page.

from gradle-play-publisher.

ChristianKatzmann avatar ChristianKatzmann commented on June 17, 2024

Pull Requests are always welcome, if you want to add such section yourself.

from gradle-play-publisher.

AlexTrotsenko avatar AlexTrotsenko commented on June 17, 2024

Sounds good, I will make it today-tomorrow.

from gradle-play-publisher.

AlexTrotsenko avatar AlexTrotsenko commented on June 17, 2024

As I promised, I have added this info to readme section (together with some more info concerning adding additional dependencies for tasks from "play" plug-in).

Here is pull request: #51

from gradle-play-publisher.

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.