Fix AllOpen plugin exposes common with Gradle runtime dependencies.

^KT-47354 Fixed
This commit is contained in:
Yahor Berdnikau
2021-07-01 11:02:37 +02:00
committed by Space
parent fa086d22c2
commit 7fff282565
2 changed files with 11 additions and 30 deletions
+6 -24
View File
@@ -1,40 +1,22 @@
apply plugin: 'kotlin'
apply plugin: 'jps-compatible'
configureGradlePluginPublishing(project)
plugins {
id 'gradle-plugin-common-configuration'
id 'jps-compatible'
}
pill {
variant = 'FULL'
}
dependencies {
compile project(':kotlin-gradle-plugin-api')
compile project(':kotlin-gradle-plugin-model')
api project(':kotlin-gradle-plugin-api')
api project(':kotlin-gradle-plugin-model')
compile kotlinStdlib()
compileOnly project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar')
compileOnly project(':kotlin-allopen-compiler-plugin')
compileOnly gradleApi()
testCompile gradleApi()
testCompile "junit:junit:4.12"
embedded(project(":kotlin-allopen-compiler-plugin")) { transitive = false }
}
tasks.withType(project.compileKotlin.class) {
kotlinOptions.languageVersion = "1.3"
kotlinOptions.apiVersion = "1.3"
kotlinOptions.freeCompilerArgs += [
"-Xskip-prerelease-check", "-Xskip-runtime-version-check", "-Xsuppress-version-warnings"
]
}
jar {
manifestAttributes(manifest, project)
}
ArtifactsKt.noDefaultJar(project)
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
configureSourcesJar()
@@ -1,20 +1,19 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.allopen.gradle.model.builder
import org.jetbrains.kotlin.gradle.model.AllOpen
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Assert
import org.junit.Test
class AllOpenModelBuilderTest {
@Test
fun testCanBuild() {
val modelBuilder = AllOpenModelBuilder()
assertTrue(modelBuilder.canBuild(AllOpen::class.java.name))
assertFalse(modelBuilder.canBuild("wrongModel"))
Assert.assertTrue(modelBuilder.canBuild(AllOpen::class.java.name))
Assert.assertFalse(modelBuilder.canBuild("wrongModel"))
}
}
}