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
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Traitement des annotations en Kotlin
Search
Yves Kalume
February 24, 2023
Programming
43
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
More Decks by Yves Kalume
See All by Yves Kalume
Bringing AI to Android With Gemini
yveskalume
0
18
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
51
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
49
Designing scalable Compose APIs
yveskalume
1
160
Demystifying Memory Leaks in Android
yveskalume
2
150
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
63
Modern Android Architecture
yveskalume
1
110
GDSC Alumni retour d’experience
yveskalume
0
35
Premier pas avec Jetpack compose
yveskalume
0
30
Other Decks in Programming
See All in Programming
新卒PdEのリアル
ryu1013
1
440
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
130
Foundry Localでエージェント開発
seosoft
0
150
PyO3 で既存 Python 評価器を Rust core 化する ー wasm-bindgen でブラウザにも配るための設計
kdash
1
560
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
FastAPI の並行処理モデルを完全に理解する
hoto17296
9
3.8k
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
410
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
160
自分的「カンファレンスの楽しみ方」
syumai
0
200
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
180
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
260
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
230
Featured
See All Featured
Accessibility Awareness
sabderemane
1
200
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
A Soul's Torment
seathinner
7
3.6k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Statistics for Hackers
jakevdp
799
230k
So, you think you're a good person
axbom
PRO
2
2.1k
Designing for humans not robots
tammielis
254
26k
Writing Fast Ruby
sferik
630
63k
Documentation Writing (for coders)
carmenintech
77
5.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
We Are The Robots
honzajavorek
0
350
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.8k
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