Generate new Gradle dependency directives when is version above 3.4 (KT-22571)
^KT-22571 Fixed
This commit is contained in:
+15
-2
@@ -79,10 +79,9 @@ private fun gradleVersionFromFile(psiFile: PsiFile): GradleVersion? {
|
|||||||
|
|
||||||
val MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX = GradleVersion.version("4.4")
|
val MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX = GradleVersion.version("4.4")
|
||||||
|
|
||||||
fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String): Boolean {
|
fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String, gradleVersion: GradleVersion): Boolean {
|
||||||
if (!preferNewSyntax) return false
|
if (!preferNewSyntax) return false
|
||||||
|
|
||||||
val gradleVersion = fetchGradleVersion(scriptFile)
|
|
||||||
if (gradleVersion < MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX) return false
|
if (gradleVersion < MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX) return false
|
||||||
|
|
||||||
if (isConfiguredWithOldSyntax(kotlinPluginName)) return false
|
if (isConfiguredWithOldSyntax(kotlinPluginName)) return false
|
||||||
@@ -91,4 +90,18 @@ fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String): Bool
|
|||||||
val hasOldApply = fileText.contains("apply plugin:")
|
val hasOldApply = fileText.contains("apply plugin:")
|
||||||
|
|
||||||
return !hasOldApply
|
return !hasOldApply
|
||||||
|
}
|
||||||
|
|
||||||
|
private val MIN_GRADLE_VERSION_FOR_API_AND_IMPLEMENTATION = GradleVersion.version("3.4")
|
||||||
|
|
||||||
|
fun GradleVersion.scope(directive: String): String {
|
||||||
|
if (this < MIN_GRADLE_VERSION_FOR_API_AND_IMPLEMENTATION) {
|
||||||
|
return when (directive) {
|
||||||
|
"implementation" -> "compile"
|
||||||
|
"testImplementation" -> "testCompile"
|
||||||
|
else -> throw IllegalArgumentException("Unknown directive `$directive`")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return directive
|
||||||
}
|
}
|
||||||
+19
-5
@@ -65,6 +65,10 @@ interface GradleBuildScriptManipulator<out Psi : PsiFile> {
|
|||||||
fun addResolutionStrategy(pluginId: String)
|
fun addResolutionStrategy(pluginId: String)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Kept for compatibility reasons (pre-181.3 IDEAs)
|
||||||
|
val BuildScriptDataBuilder.gradleVersion get() = GradleVersion.version("0.0")
|
||||||
|
|
||||||
fun fetchGradleVersion(psiFile: PsiFile): GradleVersion {
|
fun fetchGradleVersion(psiFile: PsiFile): GradleVersion {
|
||||||
return gradleVersionFromFile(psiFile) ?: GradleVersion.current()
|
return gradleVersionFromFile(psiFile) ?: GradleVersion.current()
|
||||||
}
|
}
|
||||||
@@ -75,13 +79,9 @@ private fun gradleVersionFromFile(psiFile: PsiFile): GradleVersion? {
|
|||||||
|
|
||||||
val MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX = GradleVersion.version("4.4")
|
val MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX = GradleVersion.version("4.4")
|
||||||
|
|
||||||
// Kept for compatibility reasons (pre-181.3 IDEAs)
|
fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String, gradleVersion: GradleVersion): Boolean {
|
||||||
val BuildScriptDataBuilder.gradleVersion get() = GradleVersion.version("0.0")
|
|
||||||
|
|
||||||
fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String): Boolean {
|
|
||||||
if (!preferNewSyntax) return false
|
if (!preferNewSyntax) return false
|
||||||
|
|
||||||
val gradleVersion = fetchGradleVersion(scriptFile)
|
|
||||||
if (gradleVersion < MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX) return false
|
if (gradleVersion < MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX) return false
|
||||||
|
|
||||||
if (isConfiguredWithOldSyntax(kotlinPluginName)) return false
|
if (isConfiguredWithOldSyntax(kotlinPluginName)) return false
|
||||||
@@ -90,4 +90,18 @@ fun GradleBuildScriptManipulator<*>.useNewSyntax(kotlinPluginName: String): Bool
|
|||||||
val hasOldApply = fileText.contains("apply plugin:")
|
val hasOldApply = fileText.contains("apply plugin:")
|
||||||
|
|
||||||
return !hasOldApply
|
return !hasOldApply
|
||||||
|
}
|
||||||
|
|
||||||
|
private val MIN_GRADLE_VERSION_FOR_API_AND_IMPLEMENTATION = GradleVersion.version("3.4")
|
||||||
|
|
||||||
|
fun GradleVersion.scope(directive: String): String {
|
||||||
|
if (this < MIN_GRADLE_VERSION_FOR_API_AND_IMPLEMENTATION) {
|
||||||
|
return when (directive) {
|
||||||
|
"implementation" -> "compile"
|
||||||
|
"testImplementation" -> "testCompile"
|
||||||
|
else -> throw IllegalArgumentException("Unknown directive `$directive`")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return directive
|
||||||
}
|
}
|
||||||
+7
-4
@@ -81,7 +81,8 @@ abstract class GradleKotlinFrameworkSupportProvider(
|
|||||||
kotlinVersion = LAST_SNAPSHOT_VERSION
|
kotlinVersion = LAST_SNAPSHOT_VERSION
|
||||||
}
|
}
|
||||||
|
|
||||||
val useNewSyntax = buildScriptData.gradleVersion >= MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX
|
val gradleVersion = buildScriptData.gradleVersion
|
||||||
|
val useNewSyntax = gradleVersion >= MIN_GRADLE_VERSION_FOR_NEW_PLUGIN_SYNTAX
|
||||||
if (useNewSyntax) {
|
if (useNewSyntax) {
|
||||||
if (additionalRepository != null) {
|
if (additionalRepository != null) {
|
||||||
val oneLineRepository = additionalRepository.toGroovyRepositorySnippet().replace('\n', ' ')
|
val oneLineRepository = additionalRepository.toGroovyRepositorySnippet().replace('\n', ' ')
|
||||||
@@ -117,14 +118,16 @@ abstract class GradleKotlinFrameworkSupportProvider(
|
|||||||
buildScriptData.addRepositoriesDefinition("mavenCentral()")
|
buildScriptData.addRepositoriesDefinition("mavenCentral()")
|
||||||
|
|
||||||
for (dependency in getDependencies(sdk)) {
|
for (dependency in getDependencies(sdk)) {
|
||||||
buildScriptData.addDependencyNotation(KotlinWithGradleConfigurator.getGroovyDependencySnippet(dependency, "compile", !useNewSyntax))
|
buildScriptData.addDependencyNotation(
|
||||||
|
KotlinWithGradleConfigurator.getGroovyDependencySnippet(dependency, "implementation", !useNewSyntax, gradleVersion)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
for (dependency in getTestDependencies()) {
|
for (dependency in getTestDependencies()) {
|
||||||
buildScriptData.addDependencyNotation(
|
buildScriptData.addDependencyNotation(
|
||||||
if (":" in dependency)
|
if (":" in dependency)
|
||||||
"testCompile \"$dependency\""
|
"${gradleVersion.scope("testImplementation")} \"$dependency\""
|
||||||
else
|
else
|
||||||
KotlinWithGradleConfigurator.getGroovyDependencySnippet(dependency, "testCompile", !useNewSyntax)
|
KotlinWithGradleConfigurator.getGroovyDependencySnippet(dependency, "testImplementation", !useNewSyntax, gradleVersion)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-5
@@ -21,6 +21,7 @@ import com.intellij.openapi.roots.ExternalLibraryDescriptor
|
|||||||
import com.intellij.openapi.util.text.StringUtil
|
import com.intellij.openapi.util.text.StringUtil
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
import com.intellij.psi.codeStyle.CodeStyleManager
|
import com.intellij.psi.codeStyle.CodeStyleManager
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.CliArgumentStringBuilder.buildArgumentString
|
import org.jetbrains.kotlin.cli.common.arguments.CliArgumentStringBuilder.buildArgumentString
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.CliArgumentStringBuilder.replaceLanguageFeature
|
import org.jetbrains.kotlin.cli.common.arguments.CliArgumentStringBuilder.replaceLanguageFeature
|
||||||
import org.jetbrains.kotlin.config.LanguageFeature
|
import org.jetbrains.kotlin.config.LanguageFeature
|
||||||
@@ -43,6 +44,8 @@ class GroovyBuildScriptManipulator(
|
|||||||
override val scriptFile: GroovyFile,
|
override val scriptFile: GroovyFile,
|
||||||
override val preferNewSyntax: Boolean
|
override val preferNewSyntax: Boolean
|
||||||
) : GradleBuildScriptManipulator<GroovyFile> {
|
) : GradleBuildScriptManipulator<GroovyFile> {
|
||||||
|
private val gradleVersion = fetchGradleVersion(scriptFile)
|
||||||
|
|
||||||
override fun isConfiguredWithOldSyntax(kotlinPluginName: String): Boolean {
|
override fun isConfiguredWithOldSyntax(kotlinPluginName: String): Boolean {
|
||||||
val fileText = runReadAction { scriptFile.text }
|
val fileText = runReadAction { scriptFile.text }
|
||||||
return containsDirective(fileText, getApplyPluginDirective(kotlinPluginName)) &&
|
return containsDirective(fileText, getApplyPluginDirective(kotlinPluginName)) &&
|
||||||
@@ -67,7 +70,7 @@ class GroovyBuildScriptManipulator(
|
|||||||
): Boolean {
|
): Boolean {
|
||||||
val oldText = scriptFile.text
|
val oldText = scriptFile.text
|
||||||
|
|
||||||
val useNewSyntax = useNewSyntax(kotlinPluginName)
|
val useNewSyntax = useNewSyntax(kotlinPluginName, gradleVersion)
|
||||||
if (useNewSyntax) {
|
if (useNewSyntax) {
|
||||||
scriptFile
|
scriptFile
|
||||||
.getPluginsBlock()
|
.getPluginsBlock()
|
||||||
@@ -109,7 +112,11 @@ class GroovyBuildScriptManipulator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
scriptFile.getDependenciesBlock().apply {
|
scriptFile.getDependenciesBlock().apply {
|
||||||
addExpressionOrStatementInBlockIfNeeded(getGroovyDependencySnippet(stdlibArtifactName, !useNewSyntax), false, false)
|
addExpressionOrStatementInBlockIfNeeded(
|
||||||
|
getGroovyDependencySnippet(stdlibArtifactName, !useNewSyntax, gradleVersion),
|
||||||
|
isStatement = false,
|
||||||
|
isFirst = false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jvmTarget != null) {
|
if (jvmTarget != null) {
|
||||||
@@ -121,7 +128,7 @@ class GroovyBuildScriptManipulator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun configureProjectBuildScript(kotlinPluginName: String, version: String): Boolean {
|
override fun configureProjectBuildScript(kotlinPluginName: String, version: String): Boolean {
|
||||||
if (useNewSyntax(kotlinPluginName)) return false
|
if (useNewSyntax(kotlinPluginName, gradleVersion)) return false
|
||||||
|
|
||||||
val oldText = scriptFile.text
|
val oldText = scriptFile.text
|
||||||
scriptFile.apply {
|
scriptFile.apply {
|
||||||
@@ -347,8 +354,9 @@ class GroovyBuildScriptManipulator(
|
|||||||
|
|
||||||
private fun getGroovyDependencySnippet(
|
private fun getGroovyDependencySnippet(
|
||||||
artifactName: String,
|
artifactName: String,
|
||||||
withVersion: Boolean
|
withVersion: Boolean,
|
||||||
) = "implementation \"org.jetbrains.kotlin:$artifactName${if (withVersion) ":\$kotlin_version" else ""}\""
|
gradleVersion: GradleVersion
|
||||||
|
) = "${gradleVersion.scope("implementation")} \"org.jetbrains.kotlin:$artifactName${if (withVersion) ":\$kotlin_version" else ""}\""
|
||||||
|
|
||||||
private fun getApplyPluginDirective(pluginName: String) = "apply plugin: '$pluginName'"
|
private fun getApplyPluginDirective(pluginName: String) = "apply plugin: '$pluginName'"
|
||||||
|
|
||||||
|
|||||||
+14
-5
@@ -37,6 +37,8 @@ class KotlinBuildScriptManipulator(
|
|||||||
override val scriptFile: KtFile,
|
override val scriptFile: KtFile,
|
||||||
override val preferNewSyntax: Boolean
|
override val preferNewSyntax: Boolean
|
||||||
) : GradleBuildScriptManipulator<KtFile> {
|
) : GradleBuildScriptManipulator<KtFile> {
|
||||||
|
private val gradleVersion = fetchGradleVersion(scriptFile)
|
||||||
|
|
||||||
override fun isConfiguredWithOldSyntax(kotlinPluginName: String) = runReadAction {
|
override fun isConfiguredWithOldSyntax(kotlinPluginName: String) = runReadAction {
|
||||||
scriptFile.containsApplyKotlinPlugin(kotlinPluginName) && scriptFile.containsCompileStdLib()
|
scriptFile.containsApplyKotlinPlugin(kotlinPluginName) && scriptFile.containsCompileStdLib()
|
||||||
}
|
}
|
||||||
@@ -46,7 +48,7 @@ class KotlinBuildScriptManipulator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun configureProjectBuildScript(kotlinPluginName: String, version: String): Boolean {
|
override fun configureProjectBuildScript(kotlinPluginName: String, version: String): Boolean {
|
||||||
if (useNewSyntax(kotlinPluginName)) return false
|
if (useNewSyntax(kotlinPluginName, gradleVersion)) return false
|
||||||
|
|
||||||
val originalText = scriptFile.text
|
val originalText = scriptFile.text
|
||||||
scriptFile.getBuildScriptBlock()?.apply {
|
scriptFile.getBuildScriptBlock()?.apply {
|
||||||
@@ -73,7 +75,7 @@ class KotlinBuildScriptManipulator(
|
|||||||
jvmTarget: String?
|
jvmTarget: String?
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val originalText = scriptFile.text
|
val originalText = scriptFile.text
|
||||||
val useNewSyntax = useNewSyntax(kotlinPluginName)
|
val useNewSyntax = useNewSyntax(kotlinPluginName, gradleVersion)
|
||||||
scriptFile.apply {
|
scriptFile.apply {
|
||||||
if (useNewSyntax) {
|
if (useNewSyntax) {
|
||||||
createPluginInPluginsGroupIfMissing(kotlinPluginExpression, version)
|
createPluginInPluginsGroupIfMissing(kotlinPluginExpression, version)
|
||||||
@@ -179,7 +181,7 @@ class KotlinBuildScriptManipulator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun KtBlockExpression.addNoVersionCompileStdlibIfMissing(stdlibArtifactName: String): KtCallExpression? =
|
private fun KtBlockExpression.addNoVersionCompileStdlibIfMissing(stdlibArtifactName: String): KtCallExpression? =
|
||||||
findStdLibDependency() ?: addExpressionIfMissing("compile(${getKotlinModuleDependencySnippet(stdlibArtifactName, null)})") as? KtCallExpression
|
findStdLibDependency() ?: addExpressionIfMissing("implementation(${getKotlinModuleDependencySnippet(stdlibArtifactName, null)})") as? KtCallExpression
|
||||||
|
|
||||||
private fun KtFile.containsCompileStdLib(): Boolean =
|
private fun KtFile.containsCompileStdLib(): Boolean =
|
||||||
findScriptInitializer("dependencies")?.getBlock()?.findStdLibDependency() != null
|
findScriptInitializer("dependencies")?.getBlock()?.findStdLibDependency() != null
|
||||||
@@ -470,13 +472,20 @@ class KotlinBuildScriptManipulator(
|
|||||||
groupId: String,
|
groupId: String,
|
||||||
artifactId: String,
|
artifactId: String,
|
||||||
version: String?,
|
version: String?,
|
||||||
compileScope: String = "compile"
|
compileScope: String = "implementation"
|
||||||
): String {
|
): String {
|
||||||
if (groupId != KOTLIN_GROUP_ID) {
|
if (groupId != KOTLIN_GROUP_ID) {
|
||||||
return "$compileScope(\"$groupId:$artifactId:$version\")"
|
return "$compileScope(\"$groupId:$artifactId:$version\")"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (useNewSyntax(if (scriptFile.module?.getBuildSystemType() == AndroidGradle) "kotlin-android" else KotlinGradleModuleConfigurator.KOTLIN)) {
|
val kotlinPluginName =
|
||||||
|
if (scriptFile.module?.getBuildSystemType() == AndroidGradle) {
|
||||||
|
"kotlin-android"
|
||||||
|
} else {
|
||||||
|
KotlinGradleModuleConfigurator.KOTLIN
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useNewSyntax(kotlinPluginName, gradleVersion)) {
|
||||||
return "$compileScope(${getKotlinModuleDependencySnippet(artifactId)})"
|
return "$compileScope(${getKotlinModuleDependencySnippet(artifactId)})"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -121,7 +121,7 @@ class KotlinDslGradleKotlinJavaFrameworkSupportProvider :
|
|||||||
override fun getPluginDefinition() = "kotlin(\"jvm\")"
|
override fun getPluginDefinition() = "kotlin(\"jvm\")"
|
||||||
|
|
||||||
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
||||||
"compile(${getKotlinModuleDependencySnippet(getStdlibArtifactId(rootModel.sdk, bundledRuntimeVersion()), version)})"
|
"implementation(${getKotlinModuleDependencySnippet(getStdlibArtifactId(rootModel.sdk, bundledRuntimeVersion()), version)})"
|
||||||
|
|
||||||
override fun addSupport(
|
override fun addSupport(
|
||||||
projectId: ProjectId,
|
projectId: ProjectId,
|
||||||
@@ -147,7 +147,7 @@ class KotlinDslGradleKotlinJSFrameworkSupportProvider :
|
|||||||
override fun getPluginDefinition(): String = "id(\"kotlin2js\")"
|
override fun getPluginDefinition(): String = "id(\"kotlin2js\")"
|
||||||
|
|
||||||
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
override fun getRuntimeLibrary(rootModel: ModifiableRootModel, version: String?) =
|
||||||
"compile(${getKotlinModuleDependencySnippet(MAVEN_JS_STDLIB_ID.removePrefix("kotlin-"), version)})"
|
"implementation(${getKotlinModuleDependencySnippet(MAVEN_JS_STDLIB_ID.removePrefix("kotlin-"), version)})"
|
||||||
|
|
||||||
override fun addSupport(
|
override fun addSupport(
|
||||||
projectId: ProjectId,
|
projectId: ProjectId,
|
||||||
|
|||||||
+3
-1
@@ -34,7 +34,9 @@ class KotlinJsGradleModuleConfigurator : KotlinWithGradleConfigurator() {
|
|||||||
override fun getStdlibArtifactName(sdk: Sdk?, version: String): String = MAVEN_JS_STDLIB_ID
|
override fun getStdlibArtifactName(sdk: Sdk?, version: String): String = MAVEN_JS_STDLIB_ID
|
||||||
|
|
||||||
override fun addElementsToFile(file: PsiFile, isTopLevelProjectFile: Boolean, version: String): Boolean {
|
override fun addElementsToFile(file: PsiFile, isTopLevelProjectFile: Boolean, version: String): Boolean {
|
||||||
if (getManipulator(file).useNewSyntax(kotlinPluginName)) {
|
val gradleVersion = fetchGradleVersion(file)
|
||||||
|
|
||||||
|
if (getManipulator(file).useNewSyntax(kotlinPluginName, gradleVersion)) {
|
||||||
val settingsPsiFile = if (isTopLevelProjectFile) {
|
val settingsPsiFile = if (isTopLevelProjectFile) {
|
||||||
file.module?.getTopLevelBuildScriptSettingsPsiFile()
|
file.module?.getTopLevelBuildScriptSettingsPsiFile()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+7
-2
@@ -25,6 +25,7 @@ import com.intellij.psi.PsiElement
|
|||||||
import com.intellij.psi.PsiFile
|
import com.intellij.psi.PsiFile
|
||||||
import com.intellij.psi.PsiManager
|
import com.intellij.psi.PsiManager
|
||||||
import com.intellij.util.PathUtil
|
import com.intellij.util.PathUtil
|
||||||
|
import org.gradle.util.GradleVersion
|
||||||
import org.jetbrains.kotlin.config.ApiVersion
|
import org.jetbrains.kotlin.config.ApiVersion
|
||||||
import org.jetbrains.kotlin.config.CoroutineSupport
|
import org.jetbrains.kotlin.config.CoroutineSupport
|
||||||
import org.jetbrains.kotlin.config.LanguageFeature
|
import org.jetbrains.kotlin.config.LanguageFeature
|
||||||
@@ -302,8 +303,12 @@ abstract class KotlinWithGradleConfigurator : KotlinProjectConfigurator {
|
|||||||
private val KOTLIN_BUILD_SCRIPT_NAME = "build.gradle.kts"
|
private val KOTLIN_BUILD_SCRIPT_NAME = "build.gradle.kts"
|
||||||
private val KOTLIN_SETTINGS_SCRIPT_NAME = "settings.gradle.kts"
|
private val KOTLIN_SETTINGS_SCRIPT_NAME = "settings.gradle.kts"
|
||||||
|
|
||||||
fun getGroovyDependencySnippet(artifactName: String, scope: String, withVersion: Boolean) =
|
fun getGroovyDependencySnippet(artifactName: String, scope: String, withVersion: Boolean, gradleVersion: GradleVersion): String {
|
||||||
"$scope \"org.jetbrains.kotlin:$artifactName${if (withVersion) ":\$kotlin_version" else ""}\""
|
val updatedScope = gradleVersion.scope(scope)
|
||||||
|
val versionStr = if (withVersion) ":\$kotlin_version" else ""
|
||||||
|
|
||||||
|
return "$updatedScope \"org.jetbrains.kotlin:$artifactName$versionStr\""
|
||||||
|
}
|
||||||
|
|
||||||
fun getGroovyApplyPluginDirective(pluginName: String) = "apply plugin: '$pluginName'"
|
fun getGroovyApplyPluginDirective(pluginName: String) = "apply plugin: '$pluginName'"
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ apply {
|
|||||||
plugin("kotlin-android")
|
plugin("kotlin-android")
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlinModule("stdlib-jdk7", kotlin_version))
|
implementation(kotlinModule("stdlib-jdk7", kotlin_version))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile("com.android.support:appcompat-v7:23.4.0")
|
compile("com.android.support:appcompat-v7:23.4.0")
|
||||||
compile("com.android.support.constraint:constraint-layout:1.0.0-alpha8")
|
compile("com.android.support.constraint:constraint-layout:1.0.0-alpha8")
|
||||||
compile(kotlinModule("stdlib-jdk7", kotlin_version))
|
implementation(kotlinModule("stdlib-jdk7", kotlin_version))
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '$VERSION$'
|
ext.kotlin_version = '$VERSION$'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '$VERSION$'
|
ext.kotlin_version = '$VERSION$'
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre8"
|
||||||
}
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
@@ -7,5 +7,5 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-js"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '$VERSION$'
|
ext.kotlin_version = '$VERSION$'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ version = '1.0'
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ version = '1.0'
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '$VERSION$'
|
ext.kotlin_version = '$VERSION$'
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.11'
|
testCompile group: 'junit', name: 'junit', version: '4.11'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '$VERSION$'
|
ext.kotlin_version = '$VERSION$'
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit:junit:4.12")
|
testCompile("junit:junit:4.12")
|
||||||
compile(kotlin("stdlib-jre8"))
|
implementation(kotlin("stdlib-jre8"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// VERSION: $VERSION$
|
// VERSION: $VERSION$
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit:junit:4.12")
|
testCompile("junit:junit:4.12")
|
||||||
compile(kotlin("stdlib"))
|
implementation(kotlin("stdlib"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// VERSION: $VERSION$
|
// VERSION: $VERSION$
|
||||||
@@ -16,7 +16,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit:junit:4.12")
|
testCompile("junit:junit:4.12")
|
||||||
compile(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
val compileKotlin: KotlinCompile by tasks
|
val compileKotlin: KotlinCompile by tasks
|
||||||
compileKotlin.kotlinOptions {
|
compileKotlin.kotlinOptions {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit:junit:4.12")
|
testCompile("junit:junit:4.12")
|
||||||
compile(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
val compileKotlin: KotlinCompile by tasks
|
val compileKotlin: KotlinCompile by tasks
|
||||||
compileKotlin.kotlinOptions {
|
compileKotlin.kotlinOptions {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit:junit:4.12")
|
testCompile("junit:junit:4.12")
|
||||||
compile(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
val compileKotlin: KotlinCompile by tasks
|
val compileKotlin: KotlinCompile by tasks
|
||||||
compileKotlin.kotlinOptions {
|
compileKotlin.kotlinOptions {
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,5 +11,5 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ apply {
|
|||||||
plugin("kotlin")
|
plugin("kotlin")
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlinModule("stdlib-jre8", kotlin_version))
|
implementation(kotlinModule("stdlib-jre8", kotlin_version))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlin("stdlib-jre8"))
|
implementation(kotlin("stdlib-jre8"))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
Vendored
+1
-1
@@ -18,7 +18,7 @@ apply {
|
|||||||
plugin("kotlin")
|
plugin("kotlin")
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlinModule("stdlib-jdk8", kotlin_version))
|
implementation(kotlinModule("stdlib-jdk8", kotlin_version))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven { setUrl("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.2.60-dev-286,branch:default:any/artifacts/content/maven/") }
|
maven { setUrl("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.2.60-dev-286,branch:default:any/artifacts/content/maven/") }
|
||||||
|
|||||||
Vendored
+1
-1
@@ -6,7 +6,7 @@ plugins {
|
|||||||
group = "testgroup"
|
group = "testgroup"
|
||||||
version = "1.0-SNAPSHOT"
|
version = "1.0-SNAPSHOT"
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
maven { setUrl("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.2.60-dev-286,branch:default:any/artifacts/content/maven/") }
|
maven { setUrl("https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_dev_Compiler),number:1.2.60-dev-286,branch:default:any/artifacts/content/maven/") }
|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@ repositories {
|
|||||||
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
|
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-js"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@ repositories {
|
|||||||
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
maven { setUrl("https://dl.bintray.com/kotlin/kotlin-eap") }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlin("stdlib-js"))
|
implementation(kotlin("stdlib-js"))
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,5 +8,5 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-js"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -8,5 +8,5 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlin("stdlib-js"))
|
implementation(kotlin("stdlib-js"))
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
}
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
}
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile("junit", "junit", "4.12")
|
testCompile("junit", "junit", "4.12")
|
||||||
compile(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
}
|
}
|
||||||
|
|
||||||
configure<JavaPluginConvention> {
|
configure<JavaPluginConvention> {
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
||||||
}
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ repositories {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
}
|
}
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
|
|||||||
+1
-1
@@ -23,5 +23,5 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -14,5 +14,5 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile group: 'junit', name: 'junit', version: '4.12'
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user