Build: Introduce Project extension properties for source sets
This commit is contained in:
@@ -8,10 +8,10 @@ import org.gradle.api.file.CopySourceSpec
|
|||||||
import org.gradle.api.file.SourceDirectorySet
|
import org.gradle.api.file.SourceDirectorySet
|
||||||
import org.gradle.api.plugins.JavaPluginConvention
|
import org.gradle.api.plugins.JavaPluginConvention
|
||||||
import org.gradle.api.tasks.SourceSet
|
import org.gradle.api.tasks.SourceSet
|
||||||
|
import org.gradle.api.tasks.SourceSetContainer
|
||||||
import org.gradle.api.tasks.SourceSetOutput
|
import org.gradle.api.tasks.SourceSetOutput
|
||||||
import org.gradle.kotlin.dsl.creating
|
import org.gradle.kotlin.dsl.creating
|
||||||
import org.gradle.kotlin.dsl.extra
|
import org.gradle.kotlin.dsl.extra
|
||||||
import org.gradle.kotlin.dsl.get
|
|
||||||
import org.gradle.kotlin.dsl.the
|
import org.gradle.kotlin.dsl.the
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.Callable
|
import java.util.concurrent.Callable
|
||||||
@@ -30,17 +30,11 @@ inline fun <T : Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Project.getCompiledClasses(): SourceSetOutput? = withJavaPlugin {
|
fun Project.getCompiledClasses(): SourceSetOutput? = withJavaPlugin { mainSourceSet.output }
|
||||||
javaPluginConvention().sourceSets.getByName("main").output
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.getSources(): SourceDirectorySet? = withJavaPlugin {
|
fun Project.getSources(): SourceDirectorySet? = withJavaPlugin { mainSourceSet.allSource }
|
||||||
javaPluginConvention().sourceSets.getByName("main").allSource
|
|
||||||
}
|
|
||||||
|
|
||||||
fun Project.getResourceFiles(): SourceDirectorySet? = withJavaPlugin {
|
fun Project.getResourceFiles(): SourceDirectorySet? = withJavaPlugin { mainSourceSet.resources }
|
||||||
javaPluginConvention().sourceSets.getByName("main").resources
|
|
||||||
}
|
|
||||||
|
|
||||||
fun fileFrom(root: File, vararg children: String): File = children.fold(root) { f, c -> File(f, c) }
|
fun fileFrom(root: File, vararg children: String): File = children.fold(root) { f, c -> File(f, c) }
|
||||||
|
|
||||||
@@ -59,7 +53,7 @@ var Project.javaHome: String?
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaExec {
|
fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaExec {
|
||||||
classpath = (sourceSet ?: javaPluginConvention().sourceSets["test"]).runtimeClasspath
|
classpath = (sourceSet ?: testSourceSet).runtimeClasspath
|
||||||
main = fqName
|
main = fqName
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ fun Project.classesDirsArtifact(): FileCollection {
|
|||||||
|
|
||||||
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
|
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
|
||||||
|
|
||||||
val classesDirs = javaPluginConvention().sourceSets["main"].output.classesDirs
|
val classesDirs = mainSourceSet.output.classesDirs
|
||||||
|
|
||||||
val classesTask = tasks["classes"]
|
val classesTask = tasks["classes"]
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ fun Project.testsJar(body: Jar.() -> Unit = {}): Jar {
|
|||||||
return task<Jar>(MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME) {
|
return task<Jar>(MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME) {
|
||||||
dependsOn("testClasses")
|
dependsOn("testClasses")
|
||||||
pluginManager.withPlugin("java") {
|
pluginManager.withPlugin("java") {
|
||||||
from(project.javaPluginConvention().sourceSets.getByName("test").output)
|
from(testSourceSet.output)
|
||||||
}
|
}
|
||||||
classifier = "tests"
|
classifier = "tests"
|
||||||
body()
|
body()
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ fun Project.configureInstrumentation() {
|
|||||||
// classes from the "friendly directory" to the compile classpath.
|
// classes from the "friendly directory" to the compile classpath.
|
||||||
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
|
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
|
||||||
testCompile?.doFirst {
|
testCompile?.doFirst {
|
||||||
val mainSourceSet = javaPluginConvention().sourceSets.getByName("main")
|
|
||||||
testCompile.classpath = (testCompile.classpath
|
testCompile.classpath = (testCompile.classpath
|
||||||
- mainSourceSet.output.classesDirs
|
- mainSourceSet.output.classesDirs
|
||||||
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
|
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
|
||||||
@@ -59,7 +58,7 @@ fun Project.configureInstrumentation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
javaPluginConvention().sourceSets.all { sourceSetParam ->
|
sourceSets.all { sourceSetParam ->
|
||||||
// This copy will ignore filters, but they are unlikely to be used.
|
// This copy will ignore filters, but they are unlikely to be used.
|
||||||
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
|
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
|
||||||
|
|
||||||
@@ -150,7 +149,7 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
|
|||||||
|
|
||||||
// Instrumentation needs to have access to sources of forms for inclusion
|
// Instrumentation needs to have access to sources of forms for inclusion
|
||||||
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
|
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
|
||||||
.map { p -> p.dependencyProject.javaPluginConvention().sourceSets.getByName("main").allSource.sourceDirectories }
|
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
|
||||||
val instrumentationClasspath =
|
val instrumentationClasspath =
|
||||||
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
|
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
|
||||||
logger.info("Using following dependency source dirs: $it")
|
logger.info("Using following dependency source dirs: $it")
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ fun Project.configureInstrumentation() {
|
|||||||
// classes from the "friendly directory" to the compile classpath.
|
// classes from the "friendly directory" to the compile classpath.
|
||||||
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
|
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
|
||||||
testCompile?.doFirst {
|
testCompile?.doFirst {
|
||||||
val mainSourceSet = javaPluginConvention().sourceSets.getByName("main")
|
|
||||||
testCompile.classpath = (testCompile.classpath
|
testCompile.classpath = (testCompile.classpath
|
||||||
- mainSourceSet.output.classesDirs
|
- mainSourceSet.output.classesDirs
|
||||||
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
|
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
|
||||||
@@ -59,7 +58,7 @@ fun Project.configureInstrumentation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
javaPluginConvention().sourceSets.all { sourceSetParam ->
|
sourceSets.all { sourceSetParam ->
|
||||||
// This copy will ignore filters, but they are unlikely to be used.
|
// This copy will ignore filters, but they are unlikely to be used.
|
||||||
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
|
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
|
||||||
|
|
||||||
@@ -150,7 +149,7 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
|
|||||||
|
|
||||||
// Instrumentation needs to have access to sources of forms for inclusion
|
// Instrumentation needs to have access to sources of forms for inclusion
|
||||||
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
|
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
|
||||||
.map { p -> p.dependencyProject.javaPluginConvention().sourceSets.getByName("main").allSource.sourceDirectories }
|
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
|
||||||
val instrumentationClasspath =
|
val instrumentationClasspath =
|
||||||
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
|
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
|
||||||
logger.info("Using following dependency source dirs: $it")
|
logger.info("Using following dependency source dirs: $it")
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
|
|||||||
return task<JavaExec>(name) {
|
return task<JavaExec>(name) {
|
||||||
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
|
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
|
||||||
|
|
||||||
classpath = javaPluginConvention().sourceSets["main"].runtimeClasspath
|
classpath = mainSourceSet.runtimeClasspath
|
||||||
|
|
||||||
main = "com.intellij.idea.Main"
|
main = "com.intellij.idea.Main"
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class SourceSetsBuilder(val project: Project) {
|
|||||||
|
|
||||||
inline operator fun String.invoke(crossinline body: SourceSet.() -> Unit): SourceSet {
|
inline operator fun String.invoke(crossinline body: SourceSet.() -> Unit): SourceSet {
|
||||||
val sourceSetName = this
|
val sourceSetName = this
|
||||||
return project.javaPluginConvention().sourceSets.maybeCreate(sourceSetName).apply {
|
return project.sourceSets.maybeCreate(sourceSetName).apply {
|
||||||
none()
|
none()
|
||||||
body()
|
body()
|
||||||
}
|
}
|
||||||
@@ -52,8 +52,14 @@ fun SourceSet.projectDefault() {
|
|||||||
|
|
||||||
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
|
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
|
||||||
evaluationDependsOn(projectPath)
|
evaluationDependsOn(projectPath)
|
||||||
return project(projectPath).javaPluginConvention().sourceSets
|
return project(projectPath).sourceSets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val Project.sourceSets: SourceSetContainer
|
||||||
|
get() = javaPluginConvention().sourceSets
|
||||||
|
|
||||||
|
val Project.mainSourceSet: SourceSet
|
||||||
|
get() = sourceSets.getByName("main")
|
||||||
|
|
||||||
|
val Project.testSourceSet: SourceSet
|
||||||
|
get() = sourceSets.getByName("test")
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
|
|||||||
systemProperty("idea.is.unit.test", "true")
|
systemProperty("idea.is.unit.test", "true")
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||||
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
environment("NO_FS_ROOTS_ACCESS_CHECK", "true")
|
||||||
environment("PROJECT_CLASSES_DIRS", javaPluginConvention().sourceSets.getByName("test").output.classesDirs.asPath)
|
environment("PROJECT_CLASSES_DIRS", testSourceSet.output.classesDirs.asPath)
|
||||||
environment("PROJECT_BUILD_DIR", buildDir)
|
environment("PROJECT_BUILD_DIR", buildDir)
|
||||||
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
|
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
|
||||||
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
|
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ jar.from("../idea/src") {
|
|||||||
projectTest {
|
projectTest {
|
||||||
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
systemProperty("kotlin.test.script.classpath", javaPluginConvention().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator))
|
||||||
doFirst {
|
doFirst {
|
||||||
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
systemProperty("kotlin.ant.classpath", antLauncherJar.asPath)
|
||||||
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
systemProperty("kotlin.ant.launcher.class", "org.apache.tools.ant.Main")
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ sourceSets {
|
|||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(task<ShadowJar>("shadowJar")) {
|
runtimeJar(task<ShadowJar>("shadowJar")) {
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
fromEmbeddedComponents()
|
fromEmbeddedComponents()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ sourceSets {
|
|||||||
noDefaultJar()
|
noDefaultJar()
|
||||||
|
|
||||||
runtimeJar(task<ShadowJar>("shadowJar")) {
|
runtimeJar(task<ShadowJar>("shadowJar")) {
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
fromEmbeddedComponents()
|
fromEmbeddedComponents()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ projectTest {
|
|||||||
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
|
executable = "${rootProject.extra["JDK_18"]!!}/bin/java"
|
||||||
dependsOn(":dist")
|
dependsOn(":dist")
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
systemProperty("kotlin.test.script.classpath", javaPluginConvention().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator))
|
||||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
val builtinsSourceSet = javaPluginConvention().sourceSets.create("builtins") {
|
val builtinsSourceSet = sourceSets.create("builtins") {
|
||||||
java.srcDir("builtins")
|
java.srcDir("builtins")
|
||||||
}
|
}
|
||||||
val builtinsCompile by configurations
|
val builtinsCompile by configurations
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
val builtinsSourceSet = javaPluginConvention().sourceSets.create("builtins") {
|
val builtinsSourceSet = sourceSets.create("builtins") {
|
||||||
java.srcDir("builtins")
|
java.srcDir("builtins")
|
||||||
}
|
}
|
||||||
val builtinsCompile by configurations
|
val builtinsCompile by configurations
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ sourceSets {
|
|||||||
"test" { projectDefault() }
|
"test" { projectDefault() }
|
||||||
}
|
}
|
||||||
|
|
||||||
val builtinsSourceSet = javaPluginConvention().sourceSets.create("builtins") {
|
val builtinsSourceSet = sourceSets.create("builtins") {
|
||||||
java.srcDir("builtins")
|
java.srcDir("builtins")
|
||||||
}
|
}
|
||||||
val builtinsCompile by configurations
|
val builtinsCompile by configurations
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ val performanceTestRuntime by configurations.creating {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val performanceTest by run {
|
val performanceTest by run {
|
||||||
val sourceSets = javaPluginConvention().sourceSets
|
|
||||||
sourceSets.creating {
|
sourceSets.creating {
|
||||||
compileClasspath += sourceSets["test"].output
|
compileClasspath += sourceSets["test"].output
|
||||||
compileClasspath += sourceSets["main"].output
|
compileClasspath += sourceSets["main"].output
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ testsJar()
|
|||||||
|
|
||||||
val testForWebDemo by task<Test> {
|
val testForWebDemo by task<Test> {
|
||||||
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||||
classpath = javaPluginConvention().sourceSets["test"].runtimeClasspath
|
classpath = testSourceSet.runtimeClasspath
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
val cleanTestForWebDemo by tasks
|
val cleanTestForWebDemo by tasks
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ testsJar()
|
|||||||
|
|
||||||
val testForWebDemo by task<Test> {
|
val testForWebDemo by task<Test> {
|
||||||
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||||
classpath = javaPluginConvention().sourceSets["test"].runtimeClasspath
|
classpath = testSourceSet.runtimeClasspath
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
val cleanTestForWebDemo by tasks
|
val cleanTestForWebDemo by tasks
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ testsJar()
|
|||||||
|
|
||||||
val testForWebDemo by task<Test> {
|
val testForWebDemo by task<Test> {
|
||||||
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||||
classpath = javaPluginConvention().sourceSets["test"].runtimeClasspath
|
classpath = testSourceSet.runtimeClasspath
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
val cleanTestForWebDemo by tasks
|
val cleanTestForWebDemo by tasks
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ testsJar()
|
|||||||
|
|
||||||
val testForWebDemo by task<Test> {
|
val testForWebDemo by task<Test> {
|
||||||
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||||
classpath = javaPluginConvention().sourceSets["test"].runtimeClasspath
|
classpath = testSourceSet.runtimeClasspath
|
||||||
workingDir = rootDir
|
workingDir = rootDir
|
||||||
}
|
}
|
||||||
val cleanTestForWebDemo by tasks
|
val cleanTestForWebDemo by tasks
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ val shadowJar = task<ShadowJar>("shadowJar") {
|
|||||||
callGroovy("manifestAttributes", manifest, project)
|
callGroovy("manifestAttributes", manifest, project)
|
||||||
manifest.attributes["Implementation-Version"] = version
|
manifest.attributes["Implementation-Version"] = version
|
||||||
|
|
||||||
from(javaPluginConvention().sourceSets["main"].output)
|
from(mainSourceSet.output)
|
||||||
exclude("**/*.proto")
|
exclude("**/*.proto")
|
||||||
configurations = listOf(shadows)
|
configurations = listOf(shadows)
|
||||||
|
|
||||||
|
|||||||
@@ -127,11 +127,11 @@ val reflectShadowJar by task<ShadowJar> {
|
|||||||
version = null
|
version = null
|
||||||
callGroovy("manifestAttributes", manifest, project, "Main", true)
|
callGroovy("manifestAttributes", manifest, project, "Main", true)
|
||||||
|
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
from(project(":core:descriptors.jvm").javaPluginConvention().sourceSets.getByName("main").resources) {
|
from(project(":core:descriptors.jvm").mainSourceSet.resources) {
|
||||||
include("META-INF/services/**")
|
include("META-INF/services/**")
|
||||||
}
|
}
|
||||||
from(project(":core:deserialization").javaPluginConvention().sourceSets.getByName("main").resources) {
|
from(project(":core:deserialization").mainSourceSet.resources) {
|
||||||
include("META-INF/services/**")
|
include("META-INF/services/**")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ val shadowJar by task<ShadowJar> {
|
|||||||
classifier = "shadow"
|
classifier = "shadow"
|
||||||
version = null
|
version = null
|
||||||
configurations = listOf(shadows)
|
configurations = listOf(shadows)
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
manifest {
|
manifest {
|
||||||
attributes["Main-Class"] = "org.jetbrains.kotlin.kotlinp.Main"
|
attributes["Main-Class"] = "org.jetbrains.kotlin.kotlinp.Main"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ projectTest {
|
|||||||
":kotlin-script-runtime:dist")
|
":kotlin-script-runtime:dist")
|
||||||
workingDir = File(rootDir, "libraries/tools/kotlin-compiler-client-embeddable-test/src")
|
workingDir = File(rootDir, "libraries/tools/kotlin-compiler-client-embeddable-test/src")
|
||||||
doFirst {
|
doFirst {
|
||||||
systemProperty("kotlin.test.script.classpath", javaPluginConvention().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator))
|
systemProperty("kotlin.test.script.classpath", testSourceSet.output.classesDirs.joinToString(File.pathSeparator))
|
||||||
systemProperty("compilerJar", testRuntimeCompilerJar.singleFile.canonicalPath)
|
systemProperty("compilerJar", testRuntimeCompilerJar.singleFile.canonicalPath)
|
||||||
systemProperty("stdlibJar", testStdlibJar.singleFile.canonicalPath)
|
systemProperty("stdlibJar", testStdlibJar.singleFile.canonicalPath)
|
||||||
systemProperty("scriptRuntimeJar", testScriptRuntimeJar.singleFile.canonicalPath)
|
systemProperty("scriptRuntimeJar", testScriptRuntimeJar.singleFile.canonicalPath)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ val compilerModules: Array<String> by rootProject.extra
|
|||||||
compilerModules.forEach { evaluationDependsOn(it) }
|
compilerModules.forEach { evaluationDependsOn(it) }
|
||||||
|
|
||||||
val compiledModulesSources = compilerModules.map {
|
val compiledModulesSources = compilerModules.map {
|
||||||
project(it).javaPluginConvention().sourceSets.getByName("main").allSource
|
project(it).mainSourceSet.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ val compilerModules: Array<String> by rootProject.extra
|
|||||||
compilerModules.forEach { evaluationDependsOn(it) }
|
compilerModules.forEach { evaluationDependsOn(it) }
|
||||||
|
|
||||||
val compiledModulesSources = compilerModules.map {
|
val compiledModulesSources = compilerModules.map {
|
||||||
project(it).javaPluginConvention().sourceSets.getByName("main").allSource
|
project(it).mainSourceSet.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ val compilerModules: Array<String> by rootProject.extra
|
|||||||
compilerModules.forEach { evaluationDependsOn(it) }
|
compilerModules.forEach { evaluationDependsOn(it) }
|
||||||
|
|
||||||
val compiledModulesSources = compilerModules.map {
|
val compiledModulesSources = compilerModules.map {
|
||||||
project(it).javaPluginConvention().sourceSets.getByName("main").allSource
|
project(it).mainSourceSet.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ runtimeJar {
|
|||||||
dependsOn(":idea:formatter:classes")
|
dependsOn(":idea:formatter:classes")
|
||||||
project(":idea:formatter").let { p ->
|
project(":idea:formatter").let { p ->
|
||||||
p.pluginManager.withPlugin("java") {
|
p.pluginManager.withPlugin("java") {
|
||||||
from(p.javaPluginConvention().sourceSets.getByName("main").output)
|
from(p.mainSourceSet.output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
from(fileTree("$rootDir/idea/formatter")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
from(fileTree("$rootDir/idea/formatter")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ runtimeJar {
|
|||||||
dependsOn(":idea:ide-common:classes")
|
dependsOn(":idea:ide-common:classes")
|
||||||
project(":idea:ide-common").let { p ->
|
project(":idea:ide-common").let { p ->
|
||||||
p.pluginManager.withPlugin("java") {
|
p.pluginManager.withPlugin("java") {
|
||||||
from(p.javaPluginConvention().sourceSets.getByName("main").output)
|
from(p.mainSourceSet.output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
from(fileTree("$rootDir/idea/ide-common")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
from(fileTree("$rootDir/idea/ide-common")) { include("src/**") } // Eclipse formatter sources navigation depends on this
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
val ideaProjectResources = project(":idea").javaPluginConvention().sourceSets["main"].output.resourcesDir
|
val ideaProjectResources = project(":idea").mainSourceSet.output.resourcesDir
|
||||||
|
|
||||||
evaluationDependsOn(":prepare:idea-plugin")
|
evaluationDependsOn(":prepare:idea-plugin")
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ val jar = runtimeJar(task<ShadowJar>("shadowJar")) {
|
|||||||
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
||||||
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
||||||
from(preparedResources, { include("META-INF/plugin.xml") })
|
from(preparedResources, { include("META-INF/plugin.xml") })
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
val ideaProjectResources = project(":idea").javaPluginConvention().sourceSets["main"].output.resourcesDir
|
val ideaProjectResources = project(":idea").mainSourceSet.output.resourcesDir
|
||||||
|
|
||||||
evaluationDependsOn(":prepare:idea-plugin")
|
evaluationDependsOn(":prepare:idea-plugin")
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ val jar = runtimeJar(task<ShadowJar>("shadowJar")) {
|
|||||||
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
||||||
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
||||||
from(preparedResources, { include("META-INF/plugin.xml") })
|
from(preparedResources, { include("META-INF/plugin.xml") })
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
val ideaProjectResources = project(":idea").javaPluginConvention().sourceSets["main"].output.resourcesDir
|
val ideaProjectResources = project(":idea").mainSourceSet.output.resourcesDir
|
||||||
|
|
||||||
evaluationDependsOn(":prepare:idea-plugin")
|
evaluationDependsOn(":prepare:idea-plugin")
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ val jar = runtimeJar(task<ShadowJar>("shadowJar")) {
|
|||||||
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
||||||
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
||||||
from(preparedResources, { include("META-INF/plugin.xml") })
|
from(preparedResources, { include("META-INF/plugin.xml") })
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
val ideaProjectResources = project(":idea").javaPluginConvention().sourceSets["main"].output.resourcesDir
|
val ideaProjectResources = project(":idea").mainSourceSet.output.resourcesDir
|
||||||
|
|
||||||
evaluationDependsOn(":prepare:idea-plugin")
|
evaluationDependsOn(":prepare:idea-plugin")
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ val jar = runtimeJar(task<ShadowJar>("shadowJar")) {
|
|||||||
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
val communityPluginJar = project(communityPluginProject).configurations["runtimeJar"].artifacts.files.singleFile
|
||||||
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
from(zipTree(communityPluginJar), { exclude("META-INF/plugin.xml") })
|
||||||
from(preparedResources, { include("META-INF/plugin.xml") })
|
from(preparedResources, { include("META-INF/plugin.xml") })
|
||||||
from(javaPluginConvention().sourceSets.getByName("main").output)
|
from(mainSourceSet.output)
|
||||||
archiveName = "kotlin-plugin.jar"
|
archiveName = "kotlin-plugin.jar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user