Renaming for easier conversion, some more manual conversion

This commit is contained in:
Ilya Chernikov
2017-12-08 11:57:48 +01:00
committed by Vyacheslav Gerasimov
parent 6f21c36d68
commit a418a3ac49
5 changed files with 47 additions and 45 deletions
+16
View File
@@ -154,6 +154,20 @@ extra["IntellijCoreDependencies"] =
"xpp3-1.1.4-min.jar",
"xstream-*.jar")
extra["IntellijCoreDependenciesJars"] = // TODO: rename to IntellijCoreDependencies after old usages are cleared
listOf("annotations",
"asm-all",
"guava-21.0",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java-0.5.1",
"streamex-0.6.2",
"trove4j",
"xpp3-1.1.4-min",
"xstream-1.4.8")
extra["nativePlatformVariants"] =
listOf("windows-amd64",
"windows-i386",
@@ -288,6 +302,8 @@ allprojects {
ivy {
artifactPattern(rootProject.extra["markdownParserRepo"] as String)
}
intellijSdkRepo(project)
androidDxJarRepo(project)
}
configureJvmProject(javaHome!!, jvmTarget!!)
@@ -1,3 +1,4 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.DefaultIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
@@ -15,11 +16,11 @@ repositories {
maven { setUrl("$intellijRepo/$intellijReleaseType") }
}
val intellijSdk by configurations.creating
val intellijSources by configurations.creating
val jpsStandalone by configurations.creating
val jpsBuildTest by configurations.creating
val intellijCore by configurations.creating
val intellij by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
@@ -28,11 +29,11 @@ val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDe
val repoDir = customDepsRepoModulesDir
dependencies {
intellijSdk("com.jetbrains.intellij.idea:$intellijSdkDependencyName:$intellijVersion")
intellijSources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
jpsBuildTest("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
intellij("com.jetbrains.intellij.idea:$intellijSdkDependencyName:$intellijVersion")
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration, extractor: (Configuration) -> Any) {
@@ -48,15 +49,15 @@ fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration, extr
}
}
val unzipIntellijSdk by tasks.creating { configureExtractFromConfigurationTask(intellijSdk) { zipTree(it.singleFile) } }
val unzipIntellijSdk by tasks.creating { configureExtractFromConfigurationTask(intellij) { zipTree(it.singleFile) } }
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(intellijCore) { zipTree(it.singleFile) } }
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(jpsStandalone) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyIntellijSdkSources by tasks.creating { configureExtractFromConfigurationTask(intellijSources) { it.singleFile } }
val copyIntellijSdkSources by tasks.creating { configureExtractFromConfigurationTask(sources) { it.singleFile } }
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(jpsBuildTest) { it.singleFile } }
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
fun writeIvyXml(moduleName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
@@ -76,19 +77,19 @@ fun writeIvyXml(moduleName: String, jarFiles: FileCollection, baseDir: File, sou
val prepareIvyXml by tasks.creating {
dependsOn(unzipIntellijSdk, unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellijSdk.name)
val intellijSdkDir = File(repoDir, intellij.name)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellijSdk.name}.ivy.xml"))
val flatDeps = listOf(intellijCore, jpsStandalone, jpsBuildTest)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
}
inputs.dir(File(repoDir, intellijSources.name))
inputs.dir(File(repoDir, sources.name))
// outputs.files("$repoDir/intellij.plugin.*.ivy.xml")
doFirst {
val sourcesFile = File(repoDir, "${intellijSources.name}/${intellijSources.singleFile.name}")
writeIvyXml(intellijSdk.name,
val sourcesFile = File(repoDir, "${sources.name}/${sources.singleFile.name}")
writeIvyXml(intellij.name,
files("$intellijSdkDir/lib/").filter { !it.name.startsWith("kotlin-") },
File(intellijSdkDir, "lib"),
sourcesFile)
@@ -21,12 +21,12 @@ fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository =
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact](-[revision])(-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellijSources/[artifact]-[revision]-[classifier].[ext]")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/sources/[artifact]-[revision]-[classifier].[ext]")
}
fun Project.intellijDep() = "kotlin.build.custom.deps:intellijSdk:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijCoreDep() = "kotlin.build.custom.deps:intellijCore:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijCoreDep() = intellijDep("intellij-core")
fun ModuleDependency.includeJars(vararg names: String) {
names.forEach {
@@ -34,6 +34,9 @@ fun ModuleDependency.includeJars(vararg names: String) {
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilter: (String) -> Boolean = { true }) =
includeJars(*(project.rootProject.extra["IntellijCoreDependenciesJars"] as List<String>).filter { jarsFilter(it) }.toTypedArray())
fun Project.configureIntellijPlugin(body: (IntelliJPluginExtension.() -> Unit) = {}) {
plugins.apply("org.jetbrains.intellij")
-9
View File
@@ -1,15 +1,6 @@
apply { plugin("kotlin") }
//configureIntellijPlugin {
// setExtraDependencies("intellij-core")
//}
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
}
dependencies {
testCompile(project(":core:descriptors"))
testCompile(project(":core:descriptors.jvm"))
+3 -12
View File
@@ -3,21 +3,12 @@ apply { plugin("kotlin") }
jvmTarget = "1.6"
configureIntellijPlugin {
setExtraDependencies("intellij-core", "jps-standalone")
}
dependencies {
compile(projectDist(":kotlin-stdlib"))
compile(project(":core:deserialization"))
}
afterEvaluate {
dependencies {
compileOnly(intellijCoreJar())
compileOnly(intellijCoreJarDependencies())
compileOnly(intellijExtra("jps-standalone") { include("jps-model.jar") })
}
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compileOnly(intellijDep("jps-standalone")) { includeJars("jps-model") }
}
sourceSets {