Skip to content

Instantly share code, notes, and snippets.

@VTacius
Created April 28, 2020 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VTacius/6842ca563df874d6a97c85ccb925f6ae to your computer and use it in GitHub Desktop.
Save VTacius/6842ca563df874d6a97c85ccb925f6ae to your computer and use it in GitHub Desktop.
Sobre como usar Kotlin con gradle en Fedora

Resulta que no es necesario instalar kotlin cuando se usa gradle

mkdir /opt/gradle
unzip -d /opt/gradle/ /home/vtacius/Descargas/gradle-6.3-bin.zip
dnf install java-1.8.0-openjdk-devel

Luego hay que iniciar el espacio de trabajo

gradle init

Y ya por último, parece que hay que crear a mano el archivo de construcción. Resulta que para build, run y test, basta con lo siguiente

buildscript {
  ext.kotlin_version = '1.3.70'
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  }
}

apply plugin: 'kotlin'
apply plugin: 'application'

mainClassName = "inicio/PrincipalKt"

repositories {
  mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib"
    testImplementation "org.jetbrains.kotlin:kotlin-test"
    testImplementation "org.jetbrains.kotlin:kotlin-test-junit"
}

test {
  testLogging {
    exceptionFormat = 'full'
    events = ["passed", "failed", "skipped"]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment