cleanup Gradle API deprecation warnings to make plugin compatible with upcoming Gradle 2.0. This includes moving minimum compatible version from 1.4 to 1.6
This commit is contained in:
+3
-3
@@ -15,7 +15,7 @@ import org.gradle.api.initialization.dsl.ScriptHandler
|
||||
|
||||
abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
|
||||
val log = Logging.getLogger(getClass())!!
|
||||
val log = Logging.getLogger(getClass())
|
||||
|
||||
public override fun apply(project: Project) {
|
||||
val sourceBuildScript = findSourceBuildScript(project);
|
||||
@@ -38,14 +38,14 @@ abstract class KotlinBasePluginWrapper: Plugin<Project> {
|
||||
|
||||
props.load(inputStream);
|
||||
|
||||
val projectVersion = props.get("project.version") as String
|
||||
val projectVersion = props["project.version"] as String
|
||||
log.debug("Found project version [$projectVersion]")
|
||||
project.getExtensions().getExtraProperties()?.set("kotlin.gradle.plugin.version", projectVersion)
|
||||
|
||||
log.debug("Creating configuration and dependency")
|
||||
val kotlinPluginCoreCoordinates = "org.jetbrains.kotlin:kotlin-gradle-plugin-core:" + projectVersion
|
||||
val dependency = dependencyHandler.create(kotlinPluginCoreCoordinates)
|
||||
val configuration = configurationsContainer.detachedConfiguration(dependency)!!
|
||||
val configuration = configurationsContainer.detachedConfiguration(dependency)
|
||||
|
||||
log.debug("Resolving [" + kotlinPluginCoreCoordinates + "]")
|
||||
val kotlinPluginDependencies : List<URL> = configuration.getResolvedConfiguration().getFiles(KSpec({ dep -> true }))!!.map({(f: File):URL -> f.toURI().toURL() })
|
||||
|
||||
+4
-4
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.gradle.BaseGradleIT.Project
|
||||
class BasicKotlinGradleIT: BaseGradleIT() {
|
||||
|
||||
Test fun testCrossCompile() {
|
||||
val project = Project("kotlinJavaProject")
|
||||
val project = Project("kotlinJavaProject", "1.6")
|
||||
|
||||
project.build("compileDeployKotlin", "build") {
|
||||
assertSuccessful()
|
||||
@@ -31,7 +31,7 @@ class BasicKotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
|
||||
Test fun testKotlinOnlyCompile() {
|
||||
val project = Project("kotlinProject")
|
||||
val project = Project("kotlinProject", "1.6")
|
||||
|
||||
project.build("build") {
|
||||
assertSuccessful()
|
||||
@@ -46,7 +46,7 @@ class BasicKotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
|
||||
Test fun testKotlinClasspath() {
|
||||
Project("classpathTest").build("build") {
|
||||
Project("classpathTest", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists()
|
||||
assertContains(":compileKotlin", ":compileTestKotlin")
|
||||
@@ -54,7 +54,7 @@ class BasicKotlinGradleIT: BaseGradleIT() {
|
||||
}
|
||||
|
||||
Test fun testMultiprojectPluginClasspath() {
|
||||
Project("multiprojectClassPathTest").build("build") {
|
||||
Project("multiprojectClassPathTest", "1.6").build("build") {
|
||||
assertSuccessful()
|
||||
assertReportExists("subproject")
|
||||
assertContains(":subproject:compileKotlin", ":subproject:compileTestKotlin")
|
||||
|
||||
Reference in New Issue
Block a user