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
41
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
11
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
42
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
31
Designing scalable Compose APIs
yveskalume
1
150
Demystifying Memory Leaks in Android
yveskalume
2
150
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
58
Modern Android Architecture
yveskalume
1
110
GDSC Alumni retour d’experience
yveskalume
0
32
Premier pas avec Jetpack compose
yveskalume
0
27
Other Decks in Programming
See All in Programming
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
160
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
280
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
320
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
910
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
320
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.5k
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
120
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
15
8.1k
Webフレームワークの ベンチマークについて
yusukebe
0
180
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
220
はてなアカウント基盤 State of the Union
cockscomb
1
1.2k
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
170
Facilitating Awesome Meetings
lara
57
7k
Designing Experiences People Love
moore
143
24k
The Curse of the Amulet
leimatthew05
2
13k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
Technical Leadership for Architectural Decision Making
baasie
3
430
What's in a price? How to price your products and services
michaelherold
247
13k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
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