Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Traitement des annotations en Kotlin
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Yves Kalume
February 24, 2023
Programming
48
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Traitement des annotations en Kotlin
Yves Kalume
February 24, 2023
Transcript
14 slides
Traitement des annotations en Kotlin Yves Kalume (@kalumeyves) Développeur Mobile
@Composable fun HomeScreen() @OptIn(ExperimentalPagerApi.:class) @Devscat @SuppressWarnings("deprecation") @Deprecated @Configuration @Autowired Annotation
Processing
Une annotation permet au programmeur d'intégrer des informations supplémentaires dans
un code source.
Déclaration d’une annotation annotation class Devscast @Target(AnnotationTarget.CLASS) @Retention(AnnotationRetention.SOURCE)
Utilisation d’une annotation @Devscast class Foo(val id: Int, val name:
String) fun main() { val annotations = Foo.:class.annotations print(annotations) ./ [] une liste vide... pourquoi ? }
Kotlin Symbol Processing (KSP)
KSP en action dependencies { implementation("com.google.devtools.ksp:symbol-processing-api:1.8.10-1.0.9") }
src/main/resources/META-INF/services/
Fournisseur de processeur class DevscastProcessorProvider : SymbolProcessorProvider { override fun
create( environment: SymbolProcessorEnvironment ): SymbolProcessor { return DevscastProcessor(environment) } }
Processeur class ListedProcessor( private val environment: SymbolProcessorEnvironment ) : SymbolProcessor
{ override fun process(resolver: Resolver): List<KSAnnotated>{ ./ traitement } }
val result = resolver.getSymbolsWithAnnotation( Devscast.:class.qualifiedName.toString() ) ./ ... return result.filterNot
{ it.validate() }.toList()
Prêt à être utilisée
dependencies { implementation(project(":lib") ) ksp(project(":lib")) } android { kotlin {
sourceSets.debug { kotlin.srcDirs += 'build/generated/ksp/debug/kotlin' } sourceSets.release { kotlin.srcDirs += 'build/generated/ksp/release/kotlin' } } }
Merci ! Yves Kalume - @kalumeyves Développeur Mobile
More Decks by Yves Kalume
See All by Yves Kalume
Bringing AI to Android With Gemini
yveskalume
0
32
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
62
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
63
Designing scalable Compose APIs
yveskalume
1
180
Demystifying Memory Leaks in Android
yveskalume
2
150
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
70
Modern Android Architecture
yveskalume
1
130
GDSC Alumni retour d’experience
yveskalume
0
37
Premier pas avec Jetpack compose
yveskalume
0
38
Other Decks in Programming
See All in Programming
LLM 101
dalinaum
0
490
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
670
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.4k
Getting Started with Vibe Coding
miccheng
0
220
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
150
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.1k
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
170
Spec-driven Development with AI
simas
PRO
0
2.3k
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
130
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
230
protojson における文字化けの扱い
kazuki1023
0
420
Featured
See All Featured
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
Become a Pro
speakerdeck
PRO
31
6.4k
Visualization
eitanlees
153
17k
The Curse of the Amulet
leimatthew05
4
17k
Scaling GitHub
holman
464
140k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Optimizing for Happiness
mojombo
378
71k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
370