Renaming for easier conversion, some more manual conversion
This commit is contained in:
committed by
Vyacheslav Gerasimov
parent
6f21c36d68
commit
a418a3ac49
@@ -154,6 +154,20 @@ extra["IntellijCoreDependencies"] =
|
|||||||
"xpp3-1.1.4-min.jar",
|
"xpp3-1.1.4-min.jar",
|
||||||
"xstream-*.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"] =
|
extra["nativePlatformVariants"] =
|
||||||
listOf("windows-amd64",
|
listOf("windows-amd64",
|
||||||
"windows-i386",
|
"windows-i386",
|
||||||
@@ -288,6 +302,8 @@ allprojects {
|
|||||||
ivy {
|
ivy {
|
||||||
artifactPattern(rootProject.extra["markdownParserRepo"] as String)
|
artifactPattern(rootProject.extra["markdownParserRepo"] as String)
|
||||||
}
|
}
|
||||||
|
intellijSdkRepo(project)
|
||||||
|
androidDxJarRepo(project)
|
||||||
}
|
}
|
||||||
configureJvmProject(javaHome!!, jvmTarget!!)
|
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.artifact.DefaultIvyArtifact
|
||||||
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
|
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
|
||||||
@@ -15,11 +16,11 @@ repositories {
|
|||||||
maven { setUrl("$intellijRepo/$intellijReleaseType") }
|
maven { setUrl("$intellijRepo/$intellijReleaseType") }
|
||||||
}
|
}
|
||||||
|
|
||||||
val intellijSdk by configurations.creating
|
val intellij by configurations.creating
|
||||||
val intellijSources by configurations.creating
|
val sources by configurations.creating
|
||||||
val jpsStandalone by configurations.creating
|
val `jps-standalone` by configurations.creating
|
||||||
val jpsBuildTest by configurations.creating
|
val `jps-build-test` by configurations.creating
|
||||||
val intellijCore by configurations.creating
|
val `intellij-core` by configurations.creating
|
||||||
|
|
||||||
val customDepsRepoDir = File(buildDir, "repo")
|
val customDepsRepoDir = File(buildDir, "repo")
|
||||||
val customDepsOrg: String by rootProject.extra
|
val customDepsOrg: String by rootProject.extra
|
||||||
@@ -28,11 +29,11 @@ val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDe
|
|||||||
val repoDir = customDepsRepoModulesDir
|
val repoDir = customDepsRepoModulesDir
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
intellijSdk("com.jetbrains.intellij.idea:$intellijSdkDependencyName:$intellijVersion")
|
intellij("com.jetbrains.intellij.idea:$intellijSdkDependencyName:$intellijVersion")
|
||||||
intellijSources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
|
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
|
||||||
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
|
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
|
||||||
jpsBuildTest("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
|
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
|
||||||
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
|
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration, extractor: (Configuration) -> Any) {
|
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) {
|
fun writeIvyXml(moduleName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File) {
|
||||||
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
|
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
|
||||||
@@ -76,19 +77,19 @@ fun writeIvyXml(moduleName: String, jarFiles: FileCollection, baseDir: File, sou
|
|||||||
|
|
||||||
val prepareIvyXml by tasks.creating {
|
val prepareIvyXml by tasks.creating {
|
||||||
dependsOn(unzipIntellijSdk, unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
|
dependsOn(unzipIntellijSdk, unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
|
||||||
val intellijSdkDir = File(repoDir, intellijSdk.name)
|
val intellijSdkDir = File(repoDir, intellij.name)
|
||||||
inputs.dir(intellijSdkDir)
|
inputs.dir(intellijSdkDir)
|
||||||
outputs.file(File(repoDir, "${intellijSdk.name}.ivy.xml"))
|
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
|
||||||
val flatDeps = listOf(intellijCore, jpsStandalone, jpsBuildTest)
|
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
|
||||||
flatDeps.forEach {
|
flatDeps.forEach {
|
||||||
inputs.dir(File(repoDir, it.name))
|
inputs.dir(File(repoDir, it.name))
|
||||||
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
|
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")
|
// outputs.files("$repoDir/intellij.plugin.*.ivy.xml")
|
||||||
doFirst {
|
doFirst {
|
||||||
val sourcesFile = File(repoDir, "${intellijSources.name}/${intellijSources.singleFile.name}")
|
val sourcesFile = File(repoDir, "${sources.name}/${sources.singleFile.name}")
|
||||||
writeIvyXml(intellijSdk.name,
|
writeIvyXml(intellij.name,
|
||||||
files("$intellijSdkDir/lib/").filter { !it.name.startsWith("kotlin-") },
|
files("$intellijSdkDir/lib/").filter { !it.name.startsWith("kotlin-") },
|
||||||
File(intellijSdkDir, "lib"),
|
File(intellijSdkDir, "lib"),
|
||||||
sourcesFile)
|
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]/lib/[artifact](-[classifier]).jar")
|
||||||
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
|
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
|
||||||
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact](-[revision])(-[classifier]).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) {
|
fun ModuleDependency.includeJars(vararg names: String) {
|
||||||
names.forEach {
|
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) = {}) {
|
fun Project.configureIntellijPlugin(body: (IntelliJPluginExtension.() -> Unit) = {}) {
|
||||||
|
|
||||||
plugins.apply("org.jetbrains.intellij")
|
plugins.apply("org.jetbrains.intellij")
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
|
|
||||||
apply { plugin("kotlin") }
|
apply { plugin("kotlin") }
|
||||||
|
|
||||||
//configureIntellijPlugin {
|
|
||||||
// setExtraDependencies("intellij-core")
|
|
||||||
//}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
intellijSdkRepo(project)
|
|
||||||
androidDxJarRepo(project)
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile(project(":core:descriptors"))
|
testCompile(project(":core:descriptors"))
|
||||||
testCompile(project(":core:descriptors.jvm"))
|
testCompile(project(":core:descriptors.jvm"))
|
||||||
|
|||||||
@@ -3,21 +3,12 @@ apply { plugin("kotlin") }
|
|||||||
|
|
||||||
jvmTarget = "1.6"
|
jvmTarget = "1.6"
|
||||||
|
|
||||||
configureIntellijPlugin {
|
|
||||||
setExtraDependencies("intellij-core", "jps-standalone")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(projectDist(":kotlin-stdlib"))
|
compile(projectDist(":kotlin-stdlib"))
|
||||||
compile(project(":core:deserialization"))
|
compile(project(":core:deserialization"))
|
||||||
}
|
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||||
|
compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) }
|
||||||
afterEvaluate {
|
compileOnly(intellijDep("jps-standalone")) { includeJars("jps-model") }
|
||||||
dependencies {
|
|
||||||
compileOnly(intellijCoreJar())
|
|
||||||
compileOnly(intellijCoreJarDependencies())
|
|
||||||
compileOnly(intellijExtra("jps-standalone") { include("jps-model.jar") })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
Reference in New Issue
Block a user