Build: Build android-dx and intellij-sdk repo to dependencies/repo

From KOTLIN-CR-2801 reasons to move:
 - I've changed repo layout and build process in incompatible way and decided to change location
 - It was difficult to find and annoying to locate, it was very deep and long path
 - I think dependencies/repo path is very easy to remember and find
 - It was called dependencies some time ago
This commit is contained in:
Vyacheslav Gerasimov
2019-03-04 21:31:29 +03:00
parent ef159a4fc9
commit 07b0129a6a
8 changed files with 13 additions and 17 deletions
+1 -5
View File
@@ -2,7 +2,7 @@
.idea/shelf .idea/shelf
/android.tests.dependencies /android.tests.dependencies
/confluence/target /confluence/target
/dependencies /dependencies/repo
/dist /dist
/local /local
/gh-pages /gh-pages
@@ -15,10 +15,6 @@ workspace.xml
*.versionsBackup *.versionsBackup
/idea/testData/debugger/tinyApp/classes* /idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator /jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/ /js/js.translator/testData/out/
/js/js.translator/testData/out-min/ /js/js.translator/testData/out-min/
.gradle/ .gradle/
+1 -1
View File
@@ -73,7 +73,7 @@ else
extra["versions.androidDxSources"] = "5.0.0_r2" extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps" extra["customDepsOrg"] = "kotlin.build"
repositories { repositories {
if (cacheRedirectorEnabled) { if (cacheRedirectorEnabled) {
@@ -32,7 +32,7 @@ repositories {
} }
} }
val customDepsRepoDir = File(buildDir, "repo") val customDepsRepoDir = File(rootProject.rootDir, "../dependencies/repo")
val customDepsOrg: String by rootProject.extra val customDepsOrg: String by rootProject.extra
val dxModuleName = "android-dx" val dxModuleName = "android-dx"
val dxRevision = buildToolsVersion val dxRevision = buildToolsVersion
@@ -87,7 +87,7 @@ val `plugins-NodeJS` by configurations.creating
*/ */
val intellijRuntimeAnnotations = "intellij-runtime-annotations" val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = File(buildDir, "repo") val customDepsRepoDir = File(rootProject.rootDir, "../dependencies/repo")
val customDepsOrg: String by rootProject.extra val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision") val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
@@ -7,9 +7,9 @@ import org.gradle.kotlin.dsl.extra
import java.io.File import java.io.File
fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy { fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = File("${project.rootDir}/buildSrc/prepare-deps/android-dx/build/repo") val baseDir = File("${project.rootDir}/dependencies/repo")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml") ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar") artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar")
} }
fun Project.androidDxJar() = "kotlin.build.custom.deps:android-dx:${rootProject.extra["versions.androidBuildTools"]}" fun Project.androidDxJar() = "kotlin.build:android-dx:${rootProject.extra["versions.androidBuildTools"]}"
@@ -26,7 +26,7 @@ import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.* import org.gradle.kotlin.dsl.*
import java.io.File import java.io.File
private fun Project.intellijRepoDir() = File("${project.rootDir.absoluteFile}/buildSrc/prepare-deps/intellij-sdk/build/repo") private fun Project.intellijRepoDir() = File("${project.rootDir.absoluteFile}/dependencies/repo")
fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository = ivy { fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = project.intellijRepoDir() val baseDir = project.intellijRepoDir()
@@ -54,7 +54,7 @@ fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository =
} }
} }
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}" fun Project.intellijDep(module: String = "intellij") = "kotlin.build:$module:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijCoreDep() = intellijDep("intellij-core") fun Project.intellijCoreDep() = intellijDep("intellij-core")
@@ -66,7 +66,7 @@ fun Project.intellijCoreDep() = intellijDep("intellij-core")
* `@NonNull`, `@Nullabe` from `idea/annotations.jar` has `TYPE` target which leads to different types treatment in Kotlin compiler. * `@NonNull`, `@Nullabe` from `idea/annotations.jar` has `TYPE` target which leads to different types treatment in Kotlin compiler.
* On the other hand, `idea/annotations.jar` contains org/jetbrains/annotations/Async annations which is required for IDEA debugger. * On the other hand, `idea/annotations.jar` contains org/jetbrains/annotations/Async annations which is required for IDEA debugger.
* *
* So, we are excluding `annotaions.jar` from all other `kotlin.build.custom.deps` and using this one for runtime only * So, we are excluding `annotaions.jar` from all other `kotlin.build` and using this one for runtime only
* to avoid accidentally including `annotations.jar` by calling `intellijDep()`. * to avoid accidentally including `annotations.jar` by calling `intellijDep()`.
*/ */
fun Project.intellijRuntimeAnnotations() = intellijDep("intellij-runtime-annotations") fun Project.intellijRuntimeAnnotations() = intellijDep("intellij-runtime-annotations")
@@ -97,7 +97,7 @@ fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = n
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package // Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils { object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with (project.rootProject) { fun getRepositoryRootDir(project: Project): File = with (project.rootProject) {
return File(intellijRepoDir(), "kotlin.build.custom.deps/${extra["versions.intellijSdk"]}") return File(intellijRepoDir(), "kotlin.build/${extra["versions.intellijSdk"]}")
} }
fun getIntellijRootDir(project: Project): File = with (project.rootProject) { fun getIntellijRootDir(project: Project): File = with (project.rootProject) {
@@ -119,7 +119,7 @@ fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() = fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable()) if (isIntellijUltimateSdkAvailable())
File(intellijRepoDir(), "kotlin.build.custom.deps/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate") File(intellijRepoDir(), "kotlin.build/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate")
else else
throw GradleException("intellij ultimate SDK is not available") throw GradleException("intellij ultimate SDK is not available")
+1 -1
View File
@@ -51,7 +51,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null }, DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null }, DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "compiler", *MODULE_CONFIGURATIONS) { null }, DependencyMapper("org.jetbrains.kotlin", "compiler", *MODULE_CONFIGURATIONS) { null },
DependencyMapper("kotlin.build.custom.deps", "android", "default") { dep -> DependencyMapper("kotlin.build", "android", "default") { dep ->
val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" } val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" }
val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars)) val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars))
val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon)) val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon))
@@ -22,7 +22,7 @@ dependencies {
compileOnly gradleApi() compileOnly gradleApi()
compileOnly("kotlin.build.custom.deps:intellij-core:${rootProject.ext["versions.intellijSdk"]}") { compileOnly("kotlin.build:intellij-core:${rootProject.ext["versions.intellijSdk"]}") {
artifact { artifact {
name = 'intellij-core' name = 'intellij-core'
type = 'jar' type = 'jar'