Skip to content

Instantly share code, notes, and snippets.

@hmhmsh
Last active November 24, 2016 12:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hmhmsh/2c3e598951b25157a3bf5f08054907af to your computer and use it in GitHub Desktop.
Save hmhmsh/2c3e598951b25157a3bf5f08054907af to your computer and use it in GitHub Desktop.
buildscript {
ext.kotlin_version = '1.0.5'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
sourceSets {
main.java.srcDirs += './'
}
defaultTasks 'run'
run {
if (project.hasProperty('main')) {
main(project.main.replace(".kt", "Kt").capitalize())
}
}
// 例
fun hello(): String = "HELLO"
fun main(args: Array<String>) {
println(hello())
}
{
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": ["source.kt"],
"shell_cmd": "gradle -Pmain=\"${file_name}\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment