![]() This is newer in Kotlin 1.1 and you can read about it here. Line 24: Here we are defining the kotlin standard for Java 8. This will make it running inside of docker easier. Instead of having to make sure things are on your classpath or some other nonsense, I can just give you this jar file, and it will run. This one is to create Fat Jars, or in other words, jars that contain every dependency that is needed to run. I’m not going to try and explain the difference here, please go read the plugins doc to get a better idea. One is called the plugin DSL the other is called script plugin. Gradle has a couple of ways to define plugins. Lines 6 - 11: These are just plugin lines. Let’s go through some of those lines again and draw out whats going on. srcDirs += 'src' } // Define the main startup class and jar nameĪrchivesBaseName = 'step-by-step-kotlin' // tell the jar which class to startup in. * Standard dependency section for gradle.Ĭompile ':kotlin-stdlib-jre8' } /** * as an application so `./gradlw run` will work * Kotlin, the fat jar builder, and flag it * This section is for all of the plugins we need to make this work. This will be just a gradle file with all of the plugins and dependencies that we will need. Our end goal for this step will be to make it print “Hello World” from the. ![]() That’s it! You can double check that commit that I have associated with this step to see what I add to a git repository for this but this really is an easy step. ![]() The goal of this step will be to get a gradle wrapper up and running so that we can lock in the gradle version for everyone that will be using this repository. The other one I am going to assume is having a running docker instance. We will be using the local gradle wrapper instance after the initial setup, but you do need it for the initial creation. I am going to assume you have the following installed and already running. Read about them here.įor this step-by-step guide let’s do something basic and get kotlin compiling and running inside a docker container. ![]() This is part of a series of blog posts that I’ve always wanted todo.
0 Comments
Leave a Reply. |