Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
"Gradle meets Kotlin"ってどんな感じ?
Search
ukaznil
November 22, 2017
Programming
3
450
"Gradle meets Kotlin"ってどんな感じ?
どこでもKotlin #4の資料です。
https://m3-engineer.connpass.com/event/70561/
ukaznil
November 22, 2017
Tweet
Share
More Decks by ukaznil
See All by ukaznil
「Flutterってなんなん」と思って1週間経った
ukaznil
1
680
"Convert Java File to Kotlin File"の甘い罠
ukaznil
0
1.3k
Swiftは""" """のか?
ukaznil
0
960
Other Decks in Programming
See All in Programming
ZOZOにおけるAI活用の現在 ~モバイルアプリ開発でのAI活用状況と事例~
zozotech
PRO
2
2.4k
Querying Design System デザインシステムの意思決定を支える構造検索
ikumatadokoro
1
1.2k
flutter_kaigi_2025.pdf
kyoheig3
2
380
最新のDirectX12で使えるレイトレ周りの機能追加について
projectasura
0
310
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
4
200
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
620
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
15k
How Software Deployment tools have changed in the past 20 years
geshan
0
23k
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
240
GraalVM Native Image トラブルシューティング機能の最新状況(2025年版)
ntt_dsol_java
0
170
【レイトレ合宿11】kagayaki_v4
runningoutrate
0
100
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
14
14k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Become a Pro
speakerdeck
PRO
30
5.6k
How to train your dragon (web standard)
notwaldorf
97
6.4k
Mobile First: as difficult as doing things right
swwweet
225
10k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
BBQ
matthewcrist
89
9.9k
Scaling GitHub
holman
464
140k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
Transcript
"Gradle meets Kotlin" ͬͯͲΜͳײ͡ʁ 2017/11/22 Wed. Ͳ͜ͰKotlin #4 @ukaznil :
Tatsuya KONISHI http://ukaznil.com/
Gradle is ... • JVMܥͷϏϧυπʔϧ • AntɼMavenɼsbtͱ͔ͱಉ͡ • GroovyϕʔεͷDSLͰهड़ •
GradleͰͰ͖Δ͜ͱ • ϏϧυͰ͖·͢ (SBEMFͰ,PUMJOαϙʔτ ʢ!ʣ@ • Ϗϧυʹؔ͢ΔϩδοΫΛΊΔ • ಠࣗtaskͷ࣮ɼґଘؔʢલޙؔʣͷ੍ޚ • ࣾϦϙδτϦͷೝূ
None
͔͠GroovyͰ͋Δɻ ʮϏϧυ͍͚ͨͩ͠ͳͷʹʯ
ຊൃදͷૂ͍ • ʮGradleΑ͘Θ͔ΒΜʯΛ১͍ͨ͠ • GroovyΛॻ͚ͳ͍ͳΒɼ KotlinΛॻ͚͍͍͡Όͳ͍
it's me !! • Android app dev • झຯͰ6 Kotlinྺ2
• ຊAndroidͷձ ֶੜ෦OB • misc • name: Tatsuya KONISHI • major: machine learning • web site: http://ukaznil.com/ , Twitter: @ukaznil • job: '17 ৽ଔ >> γεςϜ։ൃ / AI • langs: Java(5yrs), Kotlin(2yrs), Scala(1yr) Papyrus
ʲεϥΠυͷݟํʳ ʊGroovy / Kotlinʊ ʹؔ͢Δهड़ίʔυ (SPPWZ ,PUMJO println('hello Groovy.') println("hello
Kotlin.")
build.gradleͷجຊతͳॻ͖ํ buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/' }
} dependencies { classpath 'com.github.jengelman.gradle.plguins.shadow:2.0.1' } } apply plugin: 'java' apply plugin: 'com.github.johnrengelman.shadow' repositories { jcenter() maven { url 'https://your.domain.com/repo/' } } dependencies { compile 'your.group:your.compile-module:x.y.z' runtime 'your.group:your.runtime-module:x.y.z' } shadowJar { manifest { attributes 'Main-Class': 'com.your.domain.Main' } } (SPPWZ
build.gradleͷجຊతͳॻ͖ํ buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/' }
} dependencies { classpath 'com.github.jengelman.gradle.plguins.shadow:2.0.1' } } apply plugin: 'java' apply plugin: 'com.github.johnrengelman.shadow' repositories { jcenter() maven { url 'https://your.domain.com/repo/' } } dependencies { compile 'your.group:your.compile-module:x.y.z' runtime 'your.group:your.runtime-module:x.y.z' } shadowJar { manifest { attributes 'Main-Class': 'com.your.domain.Main' } } (SPPWZ
build.gradleͷجຊతͳॻ͖ํ buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/' }
} dependencies { classpath 'com.github.jengelman.gradle.plguins.shadow:2.0.1' } } apply plugin: 'java' apply plugin: 'com.github.johnrengelman.shadow' repositories { jcenter() maven { url 'https://your.domain.com/repo/' } } dependencies { compile 'your.group:your.compile-module:x.y.z' runtime 'your.group:your.runtime-module:x.y.z' } shadowJar { manifest { attributes 'Main-Class': 'com.your.domain.Main' } } (SPPWZ
ʢ͓·͚ʣϓϥάΠϯͰڞ༗ buildscript { repositories { maven { url 'https:// plugins.gradle.org/m2/'
} } dependencies { classpath 'your.plugin:1.0' } } apply plugin: 'java' apply plugin: 'your.plugin' repositories { jcenter() } dependencies { compile 'your.group:your.compile- module:x.y.z' runtime 'your.group:your.runtime- module:x.y.z' } class MyP implements Plugin<Project> { @Override void apply(Project project) { // Private repository project.allprojects { p -> p.repositories { maven { url 'https://hoge.com/' credentials { username = 'taro' password = 'kotlin' } } } } // Original task project.task('unhappy-task') { description 'aiueo' dependsOn project.jar } << { throw new GradleException('> <') } } } (SPPWZ
ʢ͓·͚ʣϓϥάΠϯͰڞ༗ buildscript { repositories { maven { url 'https:// plugins.gradle.org/m2/'
} } dependencies { classpath 'your.plugin:1.0' } } apply plugin: 'java' apply plugin: 'your.plugin' repositories { jcenter() } dependencies { compile 'your.group:your.compile- module:x.y.z' runtime 'your.group:your.runtime- module:x.y.z' } class MyP implements Plugin<Project> { @Override void apply(Project project) { // Private repository project.allprojects { p -> p.repositories { maven { url 'https://hoge.com/' credentials { username = 'taro' password = 'kotlin' } } } } // Original task project.task('unhappy-task') { description 'aiueo' dependsOn project.jar } << { throw new GradleException('> <') } } } (SPPWZ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • ɹ •
ɹ
ϓϥάΠϯͷద༻ plugins { id 'java' id 'org.jetbrains.kotlin.jvm' version '1.1.60' }
plugins { id("java") //id("org.jetbrains.kotlin.jvm") version "1.1.60" kotlin("jvm") version "1.1.60" } • 'java', 'kotlin'ϓϥάΠϯͰఆٛ͞Ε͍ͯΔλ εΫ͕͑ΔΑ͏ʹͳΔ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$version_kotlin" } (SPPWZ ,PUMJO
ϓϥάΠϯͷద༻ plugins { id 'java' id 'org.jetbrains.kotlin.jvm' version '1.1.60' }
plugins { id("java") //id("org.jetbrains.kotlin.jvm") version "1.1.60" kotlin("jvm") version "1.1.60" } • 'java', 'kotlin'ϓϥάΠϯͰఆٛ͞Ε͍ͯΔλ εΫ͕͑ΔΑ͏ʹͳΔ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$version_kotlin" } (SPPWZ ,PUMJO
λεΫͷఆٛ task myGroovyTask { description = 'my task' desctiption 'my
task' } doLast { //'<< {}' is deprecated println("with groovy") } task("myKotlinTask") { description = "my task" }.doLast { println("with kotlin") } (SPPWZ ,PUMJO
λεΫͷఆٛ task myGroovyTask { description = 'my task' desctiption 'my
task' } doLast { //'<< {}' is deprecated println("with groovy") } task("myKotlinTask") { description = "my task" }.doLast { println("with kotlin") } • Groovy / KotlinͷϓϩύςΟΞΫηεͷҧ͍ description = 'desc' || setDescription('desc') description 'desc' || description('desc') description = "desc" || setDescription("desc") (SPPWZ ,PUMJO
.propertiesϑΝΠϧͷม dependencies { compile "org.jetbrains.kotlin:kotlin- stdlib:$vKotlin" } val vKotlin by
project val vKotlin: String by extra val verkotlin = extra["vKotlin"] dependencies { compile "org.jetbrains.kotlin:kotlin- stdlib:$vKotlin" } vKotlin=1.1.60 (SPPWZ ,PUMJO HSBEMFQSPQFSUJFT
.propertiesϑΝΠϧͷม dependencies { compile "org.jetbrains.kotlin:kotlin- stdlib:$vKotlin" } val vKotlin by
project val vKotlin: String by extra val verkotlin = extra["vKotlin"] dependencies { compile "org.jetbrains.kotlin:kotlin- stdlib:$vKotlin" } vKotlin=1.1.60 (SPPWZ ,PUMJO HSBEMFQSPQFSUJFT ,PUMJO͢͜͠໘ɻɻɻ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • ɹ •
ɹ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • ɹ •
ɹ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • IDE͕ෆ •
ɹ
IDE͕@Groovy (SPPWZ ͳΜͯஸೡͳΤϥʔϝοηʔδʜʜοʂ
IDE͕ෆ@Kotlin ,PUMJO 0I
IDE͕ෆ@Kotlin(͓͔ΘΓ) ,PUMJO 0IʢBHBJOʣ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • IDE͕ෆ •
ɹ
GradleͰKotlin • ϓϥάΠϯͷద༻ • λεΫͷએݴ • .propertiesϑΝΠϧͷม • IDE͕ෆ •
IDE͕
IDE͕ෆ@Groovy (SPPWZ NBQͷLFZΛ֮͑ͳ͍ͱ͍͚ͳ͍ͷπϥ͍ɻɻɻ
IDE͕@Kotlin ,PUMJO FYDMVEF͓͚֮͑͑ͯ͞Կͱ͔ͳΔʂ UIBOLTUP֦ுؔ
ຊൃදͷ·ͱΊ • ʮGradleΑ͘Θ͔ΒΜʯΛ১͍ͨ͠ 㱺 buildπʔϧͷཧղʮٸ͕ճΕʯ • GroovyΛॻ͚ͳ͍ͳΒɼ KotlinΛॻ͚͍͍͡Όͳ͍ 㱺 λεΫͰΰϦΰϦ͢ΔͳΒԸܙେʁ
"Gradle meets Kotlin" ͬͯͲΜͳײ͡ʁ That's all of 2017/11/22 Wed. Ͳ͜ͰKotlin
#4 @ukaznil : Tatsuya KONISHI http://ukaznil.com/
Thank you, Kotliners !!