Build: Drop android-dx from buildSrc
This commit is contained in:
@@ -22,9 +22,6 @@ val intellijSeparateSdks: Boolean by rootProject.extra
|
|||||||
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
|
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
|
||||||
val installIntellijUltimate = intellijUltimateEnabled
|
val installIntellijUltimate = intellijUltimateEnabled
|
||||||
|
|
||||||
val androidBuildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
|
|
||||||
val androidDxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
|
|
||||||
|
|
||||||
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
|
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
|
||||||
if (intellijVersionDelimiterIndex == -1) {
|
if (intellijVersionDelimiterIndex == -1) {
|
||||||
error("Invalid IDEA version $intellijVersion")
|
error("Invalid IDEA version $intellijVersion")
|
||||||
@@ -53,19 +50,6 @@ val androidStudioOs by lazy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val androidToolsOs by lazy {
|
|
||||||
when {
|
|
||||||
OperatingSystem.current().isWindows -> "windows"
|
|
||||||
OperatingSystem.current().isMacOsX -> "macosx"
|
|
||||||
OperatingSystem.current().isLinux -> "linux"
|
|
||||||
else -> {
|
|
||||||
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
|
|
||||||
""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
if (androidStudioRelease != null) {
|
if (androidStudioRelease != null) {
|
||||||
ivy {
|
ivy {
|
||||||
@@ -81,31 +65,6 @@ repositories {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivy {
|
|
||||||
url = URI("https://dl.google.com/android/repository")
|
|
||||||
|
|
||||||
patternLayout {
|
|
||||||
artifact("[artifact]_[revision](-[classifier]).[ext]")
|
|
||||||
}
|
|
||||||
|
|
||||||
metadataSources {
|
|
||||||
artifact()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ivy {
|
|
||||||
url = URI("https://android.googlesource.com/platform/dalvik/+archive/android-$androidDxSourcesVersion")
|
|
||||||
|
|
||||||
patternLayout {
|
|
||||||
artifact("[artifact].[ext]")
|
|
||||||
}
|
|
||||||
|
|
||||||
metadataSources {
|
|
||||||
artifact()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
|
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
|
||||||
maven("https://plugins.jetbrains.com/maven")
|
maven("https://plugins.jetbrains.com/maven")
|
||||||
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
|
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
|
||||||
@@ -118,8 +77,6 @@ val sources by configurations.creating
|
|||||||
val jpsStandalone by configurations.creating
|
val jpsStandalone by configurations.creating
|
||||||
val intellijCore by configurations.creating
|
val intellijCore by configurations.creating
|
||||||
val nodeJSPlugin by configurations.creating
|
val nodeJSPlugin by configurations.creating
|
||||||
val androidBuildTools by configurations.creating
|
|
||||||
val androidDxSources by configurations.creating
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Special repository for annotations.jar required for idea runtime only.
|
* Special repository for annotations.jar required for idea runtime only.
|
||||||
@@ -133,10 +90,6 @@ val customDepsOrg: String by rootProject.extra
|
|||||||
val customDepsRevision = intellijVersion
|
val customDepsRevision = intellijVersion
|
||||||
val repoDir = File(customDepsRepoDir, customDepsOrg)
|
val repoDir = File(customDepsRepoDir, customDepsOrg)
|
||||||
|
|
||||||
val androidDxModuleName = "android-dx"
|
|
||||||
val androidDxRevision = androidBuildToolsVersion
|
|
||||||
val androidDxRepoModuleDir = File(repoDir, "$androidDxModuleName/$androidDxRevision")
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
if (androidStudioRelease != null) {
|
if (androidStudioRelease != null) {
|
||||||
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
|
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
|
||||||
@@ -164,66 +117,6 @@ dependencies {
|
|||||||
if (intellijUltimateEnabled) {
|
if (intellijUltimateEnabled) {
|
||||||
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
|
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
|
||||||
}
|
}
|
||||||
|
|
||||||
androidBuildTools("google:build-tools:$androidBuildToolsVersion:$androidToolsOs@zip")
|
|
||||||
androidDxSources("google:dx:0@tar.gz")
|
|
||||||
}
|
|
||||||
|
|
||||||
val dxSourcesTargetDir = File(buildDir, "dx_src")
|
|
||||||
|
|
||||||
val untarDxSources by tasks.creating {
|
|
||||||
dependsOn(androidDxSources)
|
|
||||||
inputs.files(androidDxSources)
|
|
||||||
outputs.dir(dxSourcesTargetDir)
|
|
||||||
doFirst {
|
|
||||||
project.copy {
|
|
||||||
from(tarTree(androidDxSources.singleFile))
|
|
||||||
include("src/**")
|
|
||||||
includeEmptyDirs = false
|
|
||||||
into(dxSourcesTargetDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val prepareDxSourcesJar by tasks.creating(Jar::class) {
|
|
||||||
dependsOn(untarDxSources)
|
|
||||||
from("$dxSourcesTargetDir/src")
|
|
||||||
destinationDir = File(repoDir, sources.name)
|
|
||||||
baseName = androidDxModuleName
|
|
||||||
classifier = "sources"
|
|
||||||
version = androidBuildToolsVersion
|
|
||||||
}
|
|
||||||
|
|
||||||
val unzipDxJar by tasks.creating {
|
|
||||||
dependsOn(androidBuildTools)
|
|
||||||
inputs.files(androidBuildTools)
|
|
||||||
outputs.files(File(androidDxRepoModuleDir, "dx.jar"))
|
|
||||||
doFirst {
|
|
||||||
project.copy {
|
|
||||||
from(zipTree(androidBuildTools.singleFile).files)
|
|
||||||
include("**/dx.jar")
|
|
||||||
into(androidDxRepoModuleDir)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val buildIvyRepoForAndroidDx by tasks.creating {
|
|
||||||
dependsOn(unzipDxJar, prepareDxSourcesJar)
|
|
||||||
inputs.files(unzipDxJar, prepareDxSourcesJar)
|
|
||||||
outputs.file(File(androidDxRepoModuleDir, "$androidDxModuleName.ivy.xml"))
|
|
||||||
|
|
||||||
doLast {
|
|
||||||
writeIvyXml(
|
|
||||||
customDepsOrg,
|
|
||||||
androidDxModuleName,
|
|
||||||
androidBuildToolsVersion,
|
|
||||||
androidDxModuleName,
|
|
||||||
androidDxRepoModuleDir,
|
|
||||||
androidDxRepoModuleDir,
|
|
||||||
androidDxRepoModuleDir,
|
|
||||||
prepareDxSourcesJar.outputs.files.singleFile
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
|
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
|
||||||
@@ -296,8 +189,7 @@ tasks.named("build") {
|
|||||||
makeIntellijCore,
|
makeIntellijCore,
|
||||||
makeIde,
|
makeIde,
|
||||||
buildJpsStandalone,
|
buildJpsStandalone,
|
||||||
makeIntellijAnnotations,
|
makeIntellijAnnotations
|
||||||
buildIvyRepoForAndroidDx
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (installIntellijUltimate) {
|
if (installIntellijUltimate) {
|
||||||
|
|||||||
Reference in New Issue
Block a user