'apply plugin' and buildscript at extention of gradle config

plugins

(Osipov Ivan) #1

Hello, forum
I have one question.
I have project which is created by Intellij Idea as Gradle project
Except build.gradle file I have extention of that (extra.gradle). Sources are below.
If I will remove the comment only for 1(build.gradle) at buildscript then all is ok, but if I will remove the comment only for 2(extra.gradle) then I have problem:

Gradle ‘xxxx’ project refresh failed
Error:Error:Plugin with id ‘kotlin’ not found.

How can I resolve that? [apply(plugin: ‘kotlin’) located at extra.gradle]
All declarations for kotlin plugin should be at extra.gradle

[build.gradle file]

buildscript {
    repositories {
        mavenCentral()
    }
    //1
    //dependencies {
    //    classpath  'org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.5'
    //}
}
apply plugin: 'java'
apply from: 'extra.gradle'

[extra.gradle file]

buildscript {
    repositories {
        mavenCentral()
    }
    //2
    //dependencies {
    //    classpath  'org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.5'
    //}
}
apply(plugin: 'kotlin')