xiazunyang / discovery Goto Github PK
View Code? Open in Web Editor NEW辅助Android开发者在多模块工程间跨模块获取接口(或抽象类)的实现类的开源库,可实现模块的顺序初始化、业务的动态组合等实现。基于AGP和ASM开发。
辅助Android开发者在多模块工程间跨模块获取接口(或抽象类)的实现类的开源库,可实现模块的顺序初始化、业务的动态组合等实现。基于AGP和ASM开发。
定义如下:
@Discoverable
abstract class InitTask {
abstract fun wang(): String
}
实现类:
@Implementation
class SampleTask : InitTask() {
override fun wang(): String {
return "I'm sample task"
}
}
@Implementation
class SampleTask2 : InitTask() {
override fun wang(): String {
return "I'm sample task2"
}
}
获取代码:
val allInstances = Discoveries.getAllInstances<InitTask>() // size = 0
val allImplementClasses = Discoveries.getAllImplementClasses<InitTask>() // size = 0
PS:
最小可复现工程:
DiscoveryDemo.zip
哈喽,我之前有针对AGP7.4+的适配写了文章Transform API 废弃了,路由插件怎么办?,目前正在处理该库,作者是否有计划适配,或者接受PR。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.