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
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
16
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
48
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
45
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
62
Modern Android Architecture
yveskalume
1
110
GDSC Alumni retour d’experience
yveskalume
0
34
Premier pas avec Jetpack compose
yveskalume
0
29
Other Decks in Programming
See All in Programming
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
180
Building a Meta Ray-Ban display app
akkeylab
0
170
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
510
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
590
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
360
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
270
S3 を使うアプリケーションをローカル完結で動かすことに全力を注いでみた / Running S3 Apps Offline
contour_gara
0
570
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
130
VibeCodingからAgenticWorkflowへ
starfish719
0
730
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
220
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
Building an army of robots
kneath
306
46k
Everyday Curiosity
cassininazir
0
290
What's in a price? How to price your products and services
michaelherold
247
13k
Docker and Python
trallard
47
4.1k
Building Adaptive Systems
keathley
44
3.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
For a Future-Friendly Web
brad_frost
183
10k
We Have a Design System, Now What?
morganepeng
55
8.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
730
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
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