Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Traitement des annotations en Kotlin
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yves Kalume
February 24, 2023
Programming
35
1
Share
Traitement des annotations en Kotlin
Yves Kalume
February 24, 2023
More Decks by Yves Kalume
See All by Yves Kalume
Bringing AI to Android With Gemini
yveskalume
0
4
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
34
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
19
Designing scalable Compose APIs
yveskalume
1
150
Demystifying Memory Leaks in Android
yveskalume
2
130
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
55
Modern Android Architecture
yveskalume
1
100
GDSC Alumni retour d’experience
yveskalume
0
30
Premier pas avec Jetpack compose
yveskalume
0
21
Other Decks in Programming
See All in Programming
How Swift's Type System Guides AI Agents
koher
0
310
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
320
🦞OpenClaw works with AWS
licux
1
290
Road to RubyKaigi: Play Hard(ware)
makicamel
1
490
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
120
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
230
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.3k
Programming with a DJ Controller — not vibe coding
m_seki
3
470
Running Swift without an OS
kishikawakatsumi
0
860
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
190
CDK Deployのための ”反響定位”
watany
5
880
実用!Hono RPC2026
yodaka
2
280
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
10
37k
WCS-LA-2024
lcolladotor
0
550
Why Our Code Smells
bkeepers
PRO
340
58k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
270
Building Applications with DynamoDB
mza
96
7k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
530
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
230
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
210
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Being A Developer After 40
akosma
91
590k
Transcript
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