Commit 4971e2d0 authored by Saif Abdul Cassim's avatar Saif Abdul Cassim

commented excludeInAndroidStudio as its not needed an uses...

commented excludeInAndroidStudio as its not needed an uses dependencyHandlerScope which is only available exlusively in kotlin-dsl
parent 9ad82d1c
......@@ -23,7 +23,6 @@ import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.intellijRepoDir() = File("${project.rootDir.absoluteFile}/buildSrc/prepare-deps/intellij-sdk/build/repo")
......@@ -56,7 +55,7 @@ fun intellijSdkRepo(repositoryHandler:RepositoryHandler,project: Project): IvyAr
}
}
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.getExtensions().getExtraProperties().get("versions.intellijSdk")}"
fun getIntellijDep(project: Project, module: String = "intellij"): String {
return project.intellijDep(module)
......@@ -78,11 +77,11 @@ fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = n
if (baseName == "annotations") {
error("Don't use anntations.jar from intellij. Kotlin stdlib already has this annotations.")
}
if (rootProject != null && rootProject.extra.has("ignore.jar.$baseName")) {
if (rootProject != null && rootProject.getExtensions().getExtraProperties().has("ignore.jar.$baseName")) {
return@forEach
}
if (rootProject != null && rootProject.extra.has("versions.jar.$baseName")) {
baseName += "-${rootProject.extra["versions.jar.$baseName"]}"
if (rootProject != null && rootProject.getExtensions().getExtraProperties().has("versions.jar.$baseName")) {
baseName += "-${rootProject.getExtensions().getExtraProperties().get("versions.jar.$baseName")}"
}
artifact {
name = baseName
......@@ -97,7 +96,7 @@ fun customIncludeJars(moduleDependency:ModuleDependency,names: List<String>, roo
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with (project.rootProject) {
return File(intellijRepoDir(), "kotlin.build.custom.deps/${extra["versions.intellijSdk"]}")
return File(intellijRepoDir(), "kotlin.build.custom.deps/${getExtensions().getExtraProperties().get("versions.intellijSdk")}")
}
fun getIntellijRootDir(project: Project): File = with (project.rootProject) {
......@@ -106,32 +105,32 @@ object IntellijRootUtils {
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
includeJars(*(project.rootProject.getExtensions().getExtraProperties().get("IntellijCoreDependencies") as List<String>).toTypedArray(), rootProject = project.rootProject)
fun customIncludeIntellijCoreJarDependencies(moduleDependency:ModuleDependency,project:Project){return moduleDependency.includeIntellijCoreJarDependencies(project)}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(), rootProject = project.rootProject)
includeJars(*(project.rootProject.getExtensions().getExtraProperties().get("IntellijCoreDependencies") as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(), rootProject = project.rootProject)
fun customIncludeIntellijCoreJarDependencies(moduleDependency:ModuleDependency,project:Project,jarsFilterPredicate: (String) -> Boolean){return moduleDependency.includeIntellijCoreJarDependencies(project,jarsFilterPredicate)}
fun Project.isIntellijCommunityAvailable() = !(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.isIntellijCommunityAvailable() = !(rootProject.getExtensions().getExtraProperties().get("intellijUltimateEnabled") as Boolean) || rootProject.getExtensions().getExtraProperties().get("intellijSeparateSdks") as Boolean
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.getExtensions().getExtraProperties().get("intellijUltimateEnabled") as Boolean)
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable())
File(intellijRepoDir(), "kotlin.build.custom.deps/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate")
File(intellijRepoDir(), "kotlin.build.custom.deps/${rootProject.getExtensions().getExtraProperties().get("versions.intellijSdk")}/intellijUltimate")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
/*fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.getExtensions().getExtraProperties().has("versions.androidStudioRelease")) {
block()
}
}
}*/
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment