paranid5

Untitled

Apr 1st, 2021
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.65 KB | None | 0 0
  1. buildscript {
  2.     ext.kotlin_version = '1.4.30'
  3.     repositories { mavenCentral() }
  4.  
  5.     dependencies {
  6.         classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
  7.     }
  8. }
  9.  
  10. plugins {
  11.     id 'org.jetbrains.kotlin.jvm' version '1.5.0-M2'
  12.     id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.30'
  13.     id 'application'
  14. }
  15.  
  16. rootProject.ext.distDir = "$rootDir/build/dist"
  17. rootProject.ext.binDir = "$distDir/bin"
  18. rootProject.ext.libsDir = "$distDir/lib"
  19.  
  20. rootProject.ext.mainClassName = "org.main.MainKt"
  21.  
  22. jar {
  23.     destinationDirectory = file("$buildDir/dist")
  24.     manifest {
  25.         attributes('Main-Class': "org.main.MainKt")
  26.     }
  27. }
  28.  
  29. task collectDependencies(type: Copy) {
  30.     dependsOn jar
  31.  
  32.     into rootProject.libsDir
  33.     from configurations.runtime
  34. }
  35.  
  36. task createStartScripts(type: CreateStartScripts) {
  37.     dependsOn collectDependencies
  38.  
  39.     outputDir = file(rootProject.binDir)
  40.     mainClassName = "$rootProject.mainClassName"
  41.     applicationName = "$rootProject.name"
  42.     classpath = fileTree(rootProject.libsDir)
  43. }
  44.  
  45. group = 'me.arseny'
  46. version = '1.0.0'
  47.  
  48. repositories {
  49.     mavenCentral()
  50. }
  51.  
  52. dependencies {
  53.     testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'
  54.     testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
  55.     testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
  56.     implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.1.0"
  57. }
  58.  
  59. test {
  60.     useJUnitPlatform()
  61. }
  62.  
  63. compileKotlin {
  64.     kotlinOptions.jvmTarget = '13'
  65. }
  66.  
  67. compileTestKotlin {
  68.     kotlinOptions.jvmTarget = '13'
  69. }
  70.  
  71. application {
  72.     mainClassName = 'org.main.MainKt'
  73. }
Add Comment
Please, Sign In to add comment