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
Yves Kalume
February 24, 2023
Programming
36
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
6
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
36
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
23
Designing scalable Compose APIs
yveskalume
1
150
Demystifying Memory Leaks in Android
yveskalume
2
140
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
56
Modern Android Architecture
yveskalume
1
110
GDSC Alumni retour d’experience
yveskalume
0
32
Premier pas avec Jetpack compose
yveskalume
0
24
Other Decks in Programming
See All in Programming
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
140
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
880
UaaL×Androidアプリのメモリ計測 — Memory Profilerの先へ
rio432
0
170
20260514_its_the_context_window_stupid.pdf
heita
0
1.1k
関係性から理解する"同一性"の型用語たち
pvcresin
2
390
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
810
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
2
410
Zod v4 Codec でスキーマに型変換を埋め込む REST API 設計 #TSKaigi2026
ryutaro_yako
0
100
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
330
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
4
510
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
120
Firefoxにコントリビューションして得られた学び
ken7253
2
170
Featured
See All Featured
The Language of Interfaces
destraynor
162
26k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Raft: Consensus for Rubyists
vanstee
141
7.4k
Claude Code のすすめ
schroneko
67
220k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
160
Design in an AI World
tapps
1
210
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
260
Amusing Abliteration
ianozsvald
1
170
Automating Front-end Workflow
addyosmani
1370
210k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
220
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