Code Monkey home page Code Monkey logo

Comments (6)

ljacomet avatar ljacomet commented on June 24, 2024

Could you review the following elements and possible update your report:

  • That outtest folder is what we call an overlaping output. Is that a typo or part of your design? If the later, then this should be fixed first before digging deeper into the issue here.
  • Having scalaTask finalizedBy javaTask does not mean that Gradle cannot run androidTask before javaTask since there are no relations between these two.

Can you explain the real problem better?
What are the real inputs of androidTask?
How does the scalaTask contribute things there?

It is quite likely that you should look into SourceSet and how tasks consume their output.

from gradle.

pocorall avatar pocorall commented on June 24, 2024

I know that the overlapping output is discouraged practice in Gradle. But I needed it (or I don't know how to avoid it in my case). The directory outtest is the destination directory of java compilation task in our real project. In Android Gradle Plugin, various tasks reads this directory in their build process. To insert scala compilation task in the Android build process, it is easiest to reuse the destination directory of the java compilation task (code here) so that tasks from Android Gradle Plugin grab the scala compiler output naturally.

I cannot control Android Gradle Plugin, and I don't know how many tasks in that plugin depends on the javaTask, and it is changing. Today, I found one more task and boilerplated theProblematicTask.dependsOn(scalaTask) (code here). This is not elegant at all.

I just want to insert scakaTask before any task depending on javaTask without manual boilerplating. If I misused Gradle, what would be the best solution for this case?

from gradle.

pocorall avatar pocorall commented on June 24, 2024

I found a mistake on the Toy example above. I am sorry. Now I fixed it to match the real project I have.

from gradle.

pocorall avatar pocorall commented on June 24, 2024

Why can't I have a setting to suppress this error, and let Gradle to automatically wire dependsOn for me? This automation will save much of the my chore.

from gradle.

ljacomet avatar ljacomet commented on June 24, 2024

or I don't know how to avoid it in my case

Did you look into SourceSet and their output?

This looks like there is no bug or missing feature in Gradle so far. We will not support overlapping outputs. It looks like this question should be dicussed with the Android Gradle Plugin team to see how best to support the integration of an additional language if their tasks does not support it. But since they have Java and Kotlin, I would be surprised it does not.

from gradle.

pocorall avatar pocorall commented on June 24, 2024

OK. I will take look into it. Thank you for your time.

from gradle.

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.