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:
+1
-5
@@ -2,7 +2,7 @@
|
||||
.idea/shelf
|
||||
/android.tests.dependencies
|
||||
/confluence/target
|
||||
/dependencies
|
||||
/dependencies/repo
|
||||
/dist
|
||||
/local
|
||||
/gh-pages
|
||||
@@ -15,10 +15,6 @@ workspace.xml
|
||||
*.versionsBackup
|
||||
/idea/testData/debugger/tinyApp/classes*
|
||||
/jps-plugin/testData/kannotator
|
||||
/ultimate/dependencies
|
||||
/ultimate/ideaSDK
|
||||
/ultimate/out
|
||||
/ultimate/tmp
|
||||
/js/js.translator/testData/out/
|
||||
/js/js.translator/testData/out-min/
|
||||
.gradle/
|
||||
|
||||
@@ -73,7 +73,7 @@ else
|
||||
|
||||
extra["versions.androidDxSources"] = "5.0.0_r2"
|
||||
|
||||
extra["customDepsOrg"] = "kotlin.build.custom.deps"
|
||||
extra["customDepsOrg"] = "kotlin.build"
|
||||
|
||||
repositories {
|
||||
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 dxModuleName = "android-dx"
|
||||
val dxRevision = buildToolsVersion
|
||||
|
||||
@@ -87,7 +87,7 @@ val `plugins-NodeJS` by configurations.creating
|
||||
*/
|
||||
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
|
||||
|
||||
val customDepsRepoDir = File(buildDir, "repo")
|
||||
val customDepsRepoDir = File(rootProject.rootDir, "../dependencies/repo")
|
||||
val customDepsOrg: String by rootProject.extra
|
||||
val customDepsRevision = intellijVersion
|
||||
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
|
||||
|
||||
@@ -7,9 +7,9 @@ import org.gradle.kotlin.dsl.extra
|
||||
import java.io.File
|
||||
|
||||
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")
|
||||
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 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 {
|
||||
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")
|
||||
|
||||
@@ -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.
|
||||
* 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()`.
|
||||
*/
|
||||
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
|
||||
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/${extra["versions.intellijSdk"]}")
|
||||
}
|
||||
|
||||
fun getIntellijRootDir(project: Project): File = with (project.rootProject) {
|
||||
@@ -119,7 +119,7 @@ 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/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate")
|
||||
else
|
||||
throw GradleException("intellij ultimate SDK is not available")
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
|
||||
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null },
|
||||
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { 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 mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars))
|
||||
val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon))
|
||||
|
||||
@@ -22,7 +22,7 @@ dependencies {
|
||||
|
||||
compileOnly gradleApi()
|
||||
|
||||
compileOnly("kotlin.build.custom.deps:intellij-core:${rootProject.ext["versions.intellijSdk"]}") {
|
||||
compileOnly("kotlin.build:intellij-core:${rootProject.ext["versions.intellijSdk"]}") {
|
||||
artifact {
|
||||
name = 'intellij-core'
|
||||
type = 'jar'
|
||||
|
||||
Reference in New Issue
Block a user