my project has two different build.gradle files written with groovy Syntax. I´d like to change this groovy written gradle file into a gradle file written with Kotlin Syntax (build.gradle.kts).
我将向您展示根项目build.gradle文件.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
//ext.kotlin_version = '1.2-M2'
ext.kotlin_version = '1.1.51'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried several "ways" i found in the internet, but nothing worked. Renaming the file, which is obviously not the Solution, didn´t help. I´ve created a new build.gradle.kts file in my root project but the file isn´t shown in my project. Also gradle didn´t recognize the new file.
所以我的问题是:如何转换groovy构建.将文件升级到kotlin版本中.格雷德尔.kts并将这个新文件添加到我现有的项目中?
谢谢你的帮助.