Gradle设置groovy文件到kts文件

时间:2018-09-28 22:10:26

标签: gradle-plugin gradle-kotlin-dsl

我的名字是settings.gradle

buildscript {
    repositories {
        maven {
            url 'https://plugins.gradle.org/m2/'
        }
    }
    dependencies {
        classpath 'gradle.plugin.net.vivin:gradle-semantic-build-versioning:4.0.0'
    }
}

apply plugin: 'net.vivin.gradle-semantic-build-versioning'

我需要将其转换为settings.gradle.kts kotlin DSL文件。我尝试过:

buildscript {
    repositories {
        maven {
            url = uri("https://plugins.gradle.org/m2/")
        }
    }
    dependencies {
        classpath("gradle.plugin.net.vivin:gradle-semantic-build-versioning:4.0.0")
    }
}

apply ("gradle.plugin.net.vivin.gradle-semantic-build-versioning")

出现错误:

  

无法将类'org.gradle.api.Plugin'的插件应用于   'net.vivin.gradle-semantic-build-versioning'(类:java.lang.String)   因为它没有实现PluginAware

这是什么问题?

1 个答案:

答案 0 :(得分:1)

解决方案是:

move[playermove] + ".txt",'r')