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
1
32
Traitement des annotations en Kotlin
Yves Kalume
February 24, 2023
Tweet
Share
More Decks by Yves Kalume
See All by Yves Kalume
Bringing AI to Android With Gemini
yveskalume
0
2
Dompting the Elephant: Making Sense of Gradle for Android Developers
yveskalume
0
26
Practical AI for Android Developers with Android Studio’s AI Agent
yveskalume
0
11
Designing scalable Compose APIs
yveskalume
1
140
Demystifying Memory Leaks in Android
yveskalume
2
130
L’essentiel de Git et Github en max 20 minutes
yveskalume
1
52
Modern Android Architecture
yveskalume
1
100
GDSC Alumni retour d’experience
yveskalume
0
28
Premier pas avec Jetpack compose
yveskalume
0
19
Other Decks in Programming
See All in Programming
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
160
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
410
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
240
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
490
CSC307 Lecture 12
javiergs
PRO
0
460
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
370
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.1k
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.4k
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
520
Rubyと楽しいをつくる / Creating joy with Ruby
chobishiba
0
200
Claude Codeと2つの巻き戻し戦略 / Two Rewind Strategies with Claude Code
fruitriin
0
200
atmaCup #23でAIコーディングを活用した話
ml_bear
4
730
Featured
See All Featured
Marketing to machines
jonoalderson
1
5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
エンジニアに許された特別な時間の終わり
watany
106
240k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
65
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
260
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
120
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Thoughts on Productivity
jonyablonski
75
5.1k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Building Adaptive Systems
keathley
44
2.9k
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