Comments (4)
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.
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.
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.
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)
- Unsupported KotlinClassMetadata of type null after update to Kotlin 1.5.20 HOT 1
- Provide SavedStateRegistryOwner in a magnet.Factory interface HOT 5
- No stetho-enabled processes running - with Magnet 3.6-rc1 HOT 4
- java.lang.IllegalStateException: Single instance requested, while many instances are stored HOT 3
- Cannot verify type declaration HOT 1
- When release version 3.7 ? HOT 1
- Magnet for Kotlin 1.8. HOT 1
- Injection overrides HOT 15
- Lazy construction HOT 26
- `@Instance(types)` must accept a classifier per type HOT 5
- Support default values in constructors and methods in Kotlin HOT 5
- Generics HOT 2
- Processor fails to generate Factory when custom scope name is used
- Lazy injection in Kotlin HOT 1
- Determine placement of instances HOT 16
- Implement scope visitor HOT 5
- 3.3-rc3 packaging issue HOT 6
- Wrong placement of instances when "getMany" and "sibling types" are used HOT 1
- Type binding HOT 17
- SelectorAttributeParser is treating nots as delimiters HOT 2
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 magnet.