Initial settings for rewriting Java projects to Kotlin

Here is a summary of the initial setup steps for adding Kotlin files to an Android project written entirely in Java.

app build.gradle

+ apply plugin: 'kotlin-android'
+ apply plugin: 'kotlin-android-extensions'

buildscript {
}

repositories {
    + mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

android {
}

Commentary

Apply the plugin.

apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

Added maven Central to repositories

mavenCentral()

Added Kotlin jdk to the library set.

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

Project build.gradle

buildscript {
    + ext.kotlin_version = '1.3.71'

    repositories {
    }

    dependencies {
        + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

Commentary

Add the version of Kotlin.

 ext.kotlin_version = '1.3.71'

Add the classpath to dependencies.

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

You can now build Kotlin within your Java project.

Recommended Posts

Initial settings for rewriting Java projects to Kotlin
Memo for migration from java to kotlin
Kotlin Class to send to Java developers
Initial settings of Netbeans (for JavaEE)
[OpenCV3.2.0] Eclipse (Java) settings (for Mac)
Initial introduction to Mac (Java engineer)
Settings for SSL debugging in Java
Generics of Kotlin for Java developers
[Android] Convert Android Java code to Kotlin
kotlin & Java: How to hide the toolbar only for specific fragments
Kotlin Class part.2 to send to Java developers
Introduction to java for the first time # 2
Convert all Android apps (Java) to Kotlin
About the procedure for java to work
[For beginners] Difference between Java and Kotlin
Kotlin scope functions to send to Java developers
Introduction to kotlin for iOS developers ⑥-Kotlin creation
Interoperability tips with Kotlin for Java developers
Introduction to kotlin for iOS developers ④-Type
Kotlin vs. Java: Which Programming Language to Choose for Your Android App
[Java] How to test for null with JUnit
Kotlin functions and lambdas to send to Java developers
Specify Java / Kotlin compile-time options for Android apps
Summary of Java environment settings for myself [mac]
Introduce Kotlin to your existing Java Maven Project
Migrate from Java to Server Side Kotlin + Spring-boot
Introduction to kotlin for iOS developers ⑤-Practical XML
[Java] (for MacOS) How to set the classpath
Getting started with Kotlin to send to Java developers
Introduction to kotlin for iOS developers ③-About gradle
What I did when I converted java to Kotlin
For Java engineers starting Kotlin from now on
Introduction to kotlin for iOS developers ①-Environment construction
Where Java programmers tend to trip over Kotlin
An introduction to Groovy for tedious Java engineers
Introduction to kotlin for iOS developers ②-Project creation
How to write Java String # getBytes in Kotlin?
[Introduction to Java] Basics of java arithmetic (for beginners)
What Java inexperienced people did to study Kotlin
Things to watch out for in Java equals
[Java] How to make multiple for loops single
For JAVA learning (2018-03-16-01)
centos7 Initial settings
2017 IDE for Java
EC2 initial settings
[Java] Introduction to Java
Introduction to java
CentOS7 initial settings
Java for statement
Settings for connecting to MySQL with Spring Boot + Spring JDBC
[Java] [SQL Server] Connect to local SQL Server 2017 using JDBC for SQL Server
Features that are likely to enter Java 10 for now
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 3
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 2
[For beginners] How to operate Stream API after Java 8
Things to watch out for in future Java development
[For beginners] Minimum sample to display RecyclerView in Java
Java development for beginners to start from 1-Vol.1-eclipse setup
How to use Truth (assertion library for Java / Android)
Introduction to Java for beginners Basic knowledge of Java language ①
Mastering Kotlin ~ Convert Java File to Kotlin File Road to Graduation ~ Part 1