Giter VIP home page Giter VIP logo

Comments (4)

realdadfish avatar realdadfish commented on June 22, 2024 1

Fine for me, I'll have a closer look at build times w/ Magnet enabled and report back here if I stumble upon any issues.

from magnet.

sergejsha avatar sergejsha commented on June 22, 2024

Correct me if I am mistaken, but as of now Android Gradle Plugin generates BuildConfig.java file anyway. Thus javac gets executed independent on whether magnet generates additional java sources or not.

Nevertheless I agree with you in general. I was thinking about this kind of optimization before and I am rather inclined to implementing a Kotlin compiler plugin. They speak about Kotlin IR (Intermediate representation), which can be used to represent source code independent of any particular source or target languages. It can be used to enhance/generate byte code directly bypassing java or kotlin sources. The idea was to "inject" static factories right in the implementation classes or so. But that's future if there is time for it...

from magnet.

realdadfish avatar realdadfish commented on June 22, 2024

Well, for my Kotlin-only modules I disabled BuildConfig.java generation altogether and got a nice speedup (partially from the generation itself, partially from the javac invocation), so it would definitely help I guess, but I have no exact numbers at hand.

If interested, this is how it is done:

 project.plugins.withId("com.android.library") {
        // TODO replace with https://issuetracker.google.com/issues/72050365 once released.
        project.android.libraryVariants.all {
            it.generateBuildConfig.enabled = false
        }
    }

Thanks for considering!

from magnet.

sergejsha avatar sergejsha commented on June 22, 2024

Yeah, I had this optimization too, but it stopped working with AGP 3.3.0. If you don't mind, I'm going to close this issue, because there is no plans for supporting kotlin source generation in the near future.

from magnet.

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.