Compare commits

...

8 Commits

Author SHA1 Message Date
Nikolay Krasko
57a5f882b5 -- logging 2021-05-12 11:48:11 +03:00
Nikolay Krasko
f270e7b938 -- some temporary 2021-05-11 20:02:18 +03:00
Nikolay Krasko
f9554796a1 -- gradle investigation 2021-05-11 20:02:17 +03:00
Nikolay Krasko
41c86e2324 Drop ultimate, cidr and kmm from the build 2021-05-11 20:02:17 +03:00
Nikolay Krasko
b146a58056 Drop bintray credentials 2021-05-11 20:02:17 +03:00
Nikolay Krasko
5bb7014d9d Read process streams to avoid hanging on Windows in parcelize tests
Could be reproduced with ParcelizeBoxTestGenerated.testKt36658 test.
2021-05-11 20:02:17 +03:00
Nikolay Krasko
6b195bf655 Don't print to log in successful parcelize tests 2021-05-11 20:02:16 +03:00
Nikolay Krasko
54c845356e Leave a clue about muted tests with directive for manual processing 2021-05-11 20:02:14 +03:00
26 changed files with 147 additions and 291 deletions

1
.gitignore vendored
View File

@@ -57,7 +57,6 @@ build/
.idea/artifacts/kotlin_stdlib_wasm_*
.idea/jarRepositories.xml
.idea/csv-plugin.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-js-runner/lib/

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

35
.idea/vcs.xml generated
View File

@@ -1,36 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrazieCommit" enabled="true" level="TYPO" enabled_by_default="true" />
<inspection_tool class="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="IssueNavigationConfiguration">
<option name="links">
<component name="GithubSharedProjectSettings">
<option name="branchProtectionPatterns">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="[A-Z]+\-\d+" />
<option name="linkRegexp" value="http://youtrack.jetbrains.com/issue/$0" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="EA\-(\d+)" />
<option name="linkRegexp" value="http://ea.jetbrains.com/browser/ea_problems/$1" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="KEEP\-(\d+)" />
<option name="linkRegexp" value="https://github.com/Kotlin/KEEP/issues/$1" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="KOTLIN-CR\-\d+" />
<option name="linkRegexp" value="https://upsource.jetbrains.com/kotlin/review/$0" />
</IssueNavigationLink>
<option value="master" />
<option value="1\.5\.0-M2" />
<option value="1\.5\.0" />
<option value="1\.5\.20" />
<option value="1\.5\.20-M1-release" />
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -93,10 +93,8 @@ val distKotlinHomeDir by extra("$distDir/kotlinc")
val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
extra["ktorExcludesForDaemon"] = listOf(
"org.jetbrains.kotlin" to "kotlin-reflect",
@@ -114,9 +112,7 @@ extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["isSonatypeRelease"] = false
val kotlinNativeVersionObject = project.kotlinNativeVersionValue()
subprojects {
@@ -198,7 +194,6 @@ if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.5.20-dev-5613"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
val useJvmIrBackend by extra(project.kotlinBuildProperties.useIR)
@@ -913,22 +908,6 @@ tasks {
)
}
register("kmmTest", AggregateTest::class) {
dependsOn(
":idea:idea-gradle:test",
":idea:test",
":compiler:test",
":compiler:container:test",
":js:js.tests:test"
)
dependsOn(":kotlin-gradle-plugin-integration-tests:test")
if (Ide.AS40.orHigher())
dependsOn(":kotlin-ultimate:ide:android-studio-native:test")
testPatternFile = file("tests/mpp/kmm-patterns.csv")
}
register("test") {
doLast {
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
@@ -1034,8 +1013,7 @@ val zipTestData by task<Zip> {
val zipPlugin by task<Zip> {
val src = when (project.findProperty("pluginArtifactDir") as String?) {
"Kotlin" -> ideaPluginDir
"KotlinUltimate" -> ideaUltimatePluginDir
null -> if (project.hasProperty("ultimate")) ideaUltimatePluginDir else ideaPluginDir
null -> ideaPluginDir
else -> error("Unsupported plugin artifact dir")
}
val destPath = project.findProperty("pluginZipPath") as String?

View File

@@ -69,7 +69,6 @@ rootProject.apply {
}
val isTeamcityBuild = kotlinBuildProperties.isTeamcityBuild
val intellijUltimateEnabled by extra(kotlinBuildProperties.intellijUltimateEnabled)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
extra["intellijReleaseType"] = when {

View File

@@ -15,15 +15,12 @@ plugins {
base
}
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled && androidStudioRelease == null
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
@@ -32,13 +29,10 @@ if (intellijVersionDelimiterIndex == -1) {
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val androidStudioOs by lazy {
when {
@@ -73,7 +67,6 @@ repositories {
}
val intellij by configurations.creating
val intellijUltimate by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val jpsStandalone by configurations.creating
@@ -105,12 +98,7 @@ dependencies {
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (asmVersion != null) {
@@ -120,9 +108,6 @@ dependencies {
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
@@ -185,11 +170,7 @@ val makeIde = if (androidStudioBuild != null) {
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
val task = buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
task.configure {
dependsOn(mergeSources)
@@ -207,13 +188,6 @@ tasks.named("build") {
buildJpsStandalone,
makeIntellijAnnotations
)
}
if (installIntellijUltimate) {
val buildNodeJsPlugin =
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
}
tasks.named<Delete>("clean") {

View File

@@ -25,49 +25,4 @@ buildscript {
}
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
def projectVersions = file("../gradle/versions.properties").text
include "prepare-deps"
def target_AppCode_Clion = buildProperties.includeCidrPlugins && !projectVersions.contains("versions.androidStudioRelease")
def target_AndroidStudio = buildProperties.includeCidrPlugins && projectVersions.contains("versions.androidStudioRelease")
def target_IdeaUltimate = buildProperties.includeUltimate
if (target_AppCode_Clion) {
logger.info("Including modules for AC and CL in buildSrc/settings.gradle")
include ":prepare-deps:kotlin-native-platform-deps"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else if (target_AndroidStudio) {
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")
include ":prepare-deps:appcode-binaries"
include ":prepare-deps:lldb-framework"
include ":prepare-deps:lldb-frontend"
project(":prepare-deps:appcode-binaries").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/appcode-binaries")
project(":prepare-deps:lldb-framework").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-framework")
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
} else if (target_IdeaUltimate) {
logger.info("Including modules for IU in buildSrc/settings.gradle")
include ":prepare-deps:lldb-frontend"
include ":prepare-deps:native-debug-plugin"
project(":prepare-deps:lldb-frontend").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
project(":prepare-deps:native-debug-plugin").projectDir =
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
} else {
logger.info("Not including extra modules in buildSrc/settings.gradle")
}
include "prepare-deps"

View File

@@ -89,12 +89,6 @@ fun Project.preloadedDeps(
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
}
fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir: String? = null): ConfigurableFileCollection {
val ultimateDepsDir = fileFrom(rootDir, "ultimate", "dependencies")
return if (ultimateDepsDir.isDirectory) preloadedDeps(*artifactBaseNames, baseDir = ultimateDepsDir, subdir = subdir)
else files()
}
fun Project.kotlinDep(artifactBaseName: String, version: String, classifier: String? = null): String =
listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":")

View File

@@ -37,9 +37,7 @@ private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenci
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
Ide.Kind.IntelliJ -> {
if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"
}
Ide.Kind.IntelliJ -> "ideaIC"
}
private fun Project.ideModuleVersion() = when (IdeVersionConfigurator.currentIde.kind) {
@@ -95,10 +93,6 @@ fun Project.intellijRuntimeAnnotations() = "kotlin.build:intellij-runtime-annota
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijUltimateDep() = intellijDep("ideaIU")
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
var baseName = it.removeSuffix(".jar")
@@ -137,19 +131,10 @@ fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFi
rootProject = project.rootProject
)
fun Project.isIntellijCommunityAvailable() =
!(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
fun Project.isIntellijCommunityAvailable() = rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable())
File(kotlinBuildLocalRepoDir(), "kotlin.build/ideaIU/${rootProject.extra["versions.intellijSdk"]}/artifacts")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
block()
@@ -183,7 +168,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
if (Platform[201].orHigher()) {
jvmArgs("-Didea.platform.prefix=Idea")
}

View File

@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.incremental.utils.TestCompilationResult
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
import org.junit.Assert
import java.io.File
import kotlin.system.measureTimeMillis
abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerArguments> : TestWithWorkingDir() {
protected abstract fun createCompilerArguments(destinationDir: File, testDir: File): Args
@@ -53,7 +54,9 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
val mapWorkingToOriginalFile = HashMap(copyTestSources(testDir, srcDir, filePrefix = ""))
val sourceRoots = setupTest(testDir, srcDir, cacheDir, outDir)
val args = createCompilerArgumentsImpl(outDir, testDir)
val (_, _, errors) = initialMake(cacheDir, outDir, sourceRoots, args)
val (_, _, errors) = measure("Initial make") {
initialMake(cacheDir, outDir, sourceRoots, args)
}
check(errors.isEmpty()) { "Initial build failed: \n${errors.joinToString("\n")}" }
// modifications
@@ -79,22 +82,44 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
val expectedSBWithoutErrors = StringBuilder()
val actualSBWithoutErrors = StringBuilder()
var step = 1
for ((modificationStep, buildLogStep) in modifications.zip(buildLogSteps)) {
modificationStep.forEach { it.perform(workingDir, mapWorkingToOriginalFile) }
val (_, compiledSources, compileErrors) = incrementalMake(cacheDir, outDir, sourceRoots, createCompilerArgumentsImpl(outDir, testDir))
expectedSB.appendLine(stepLogAsString(step, buildLogStep.compiledKotlinFiles, buildLogStep.compileErrors))
expectedSBWithoutErrors.appendLine(
stepLogAsString(
step,
buildLogStep.compiledKotlinFiles,
buildLogStep.compileErrors,
includeErrors = false
)
)
actualSB.appendLine(stepLogAsString(step, compiledSources.relativePaths(), compileErrors))
actualSBWithoutErrors.appendLine(stepLogAsString(step, compiledSources.relativePaths(), compileErrors, includeErrors = false))
step++
for ((modificationStep, buildLogStep) in modifications.zip(buildLogSteps)) {
measure("Iteration: $modificationStep") {
measure("apply") {
modificationStep.forEach { it.perform(workingDir, mapWorkingToOriginalFile) }
}
val (_, compiledSources, compileErrors) = measure("incrementalMake") {
incrementalMake(
cacheDir,
outDir,
sourceRoots,
createCompilerArgumentsImpl(outDir, testDir)
)
}
measure("logs") {
expectedSB.appendLine(stepLogAsString(step, buildLogStep.compiledKotlinFiles, buildLogStep.compileErrors))
expectedSBWithoutErrors.appendLine(
stepLogAsString(
step,
buildLogStep.compiledKotlinFiles,
buildLogStep.compileErrors,
includeErrors = false
)
)
actualSB.appendLine(stepLogAsString(step, compiledSources.relativePaths(), compileErrors))
actualSBWithoutErrors.appendLine(
stepLogAsString(
step,
compiledSources.relativePaths(),
compileErrors,
includeErrors = false
)
)
}
step++
}
}
if (expectedSBWithoutErrors.toString() != actualSBWithoutErrors.toString()) {
@@ -106,7 +131,9 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
}
}
rebuildAndCompareOutput(sourceRoots, testDir, buildLogSteps, outDir)
measure("Rebuild and compare") {
rebuildAndCompareOutput(sourceRoots, testDir, buildLogSteps, outDir)
}
}
// these functions are needed only to simplify debugging of IC tests
@@ -166,6 +193,14 @@ abstract class AbstractIncrementalCompilerRunnerTestBase<Args : CommonCompilerAr
}
companion object {
fun <T> measure(message: String, f: () -> T): T {
var r: T
println("$message " + measureTimeMillis {
r = f()
})
return r
}
@JvmStatic
private val distKotlincLib: File = File("dist/kotlinc/lib")

View File

@@ -28,17 +28,24 @@ import javax.tools.ToolProvider
abstract class AbstractIncrementalJvmCompilerRunnerTest : AbstractIncrementalCompilerRunnerTestBase<K2JVMCompilerArguments>() {
override fun make(cacheDir: File, outDir: File, sourceRoots: Iterable<File>, args: K2JVMCompilerArguments): TestCompilationResult {
val reporter = TestICReporter()
val messageCollector = TestMessageCollector()
makeIncrementally(cacheDir, sourceRoots, args, reporter = reporter, messageCollector = messageCollector)
val kotlinCompileResult = TestCompilationResult(reporter, messageCollector)
val kotlinCompileResult = measure("kotlin") {
val reporter = TestICReporter()
val messageCollector = TestMessageCollector()
makeIncrementally(cacheDir, sourceRoots, args, reporter = reporter, messageCollector = messageCollector)
TestCompilationResult(reporter, messageCollector)
}
if (kotlinCompileResult.exitCode != ExitCode.OK) return kotlinCompileResult
val (javaExitCode, _, javaErrors) = compileJava(sourceRoots, args.destination!!)
return when (javaExitCode) {
ExitCode.OK -> kotlinCompileResult
else -> kotlinCompileResult.copy(exitCode = javaExitCode, compileErrors = javaErrors)
val r = measure("java") {
val (javaExitCode, _, javaErrors) = compileJava(sourceRoots, args.destination!!)
when (javaExitCode) {
ExitCode.OK -> kotlinCompileResult
else -> kotlinCompileResult.copy(exitCode = javaExitCode, compileErrors = javaErrors)
}
}
return r
}
private fun compileJava(sourceRoots: Iterable<File>, kotlinClassesPath: String): TestCompilationResult {

View File

@@ -606,6 +606,8 @@ public class KotlinTestUtils {
if (PRINT_STACKTRACE_FOR_IGNORED_TESTS) {
e.printStackTrace();
} else {
System.err.println("MUTED TEST with `" + ignoreDirective + "`");
}
return;
}

View File

@@ -171,18 +171,14 @@ class CodeConformanceTest : TestCase() {
val atAuthorPattern = Pattern.compile("/\\*.+@author.+\\*/", Pattern.DOTALL)
val root = nonSourcesMatcher.root
val tests = listOf(
TestData(
"%d source files contain @author javadoc tag.\nPlease remove them or exclude in this test:\n%s"
) { file, source ->
) { _, source ->
// substring check is an optimization
"@author" in source && atAuthorPattern.matcher(source).find() &&
"ASM: a very small and fast Java bytecode manipulation framework" !in source &&
"package org.jetbrains.kotlin.tools.projectWizard.settings.version.maven" !in source &&
!file.relativeTo(root).systemIndependentPath.startsWith("kotlin-ultimate/ide/common-cidr-native") &&
file.name != "CLionKonanProjectDataService.kt"
"package org.jetbrains.kotlin.tools.projectWizard.settings.version.maven" !in source
},
TestData(
"%d source files use something from com.beust.jcommander.internal package.\n" +
@@ -355,7 +351,7 @@ class CodeConformanceTest : TestCase() {
if (repoOccurrences.isNotEmpty()) {
val repoOccurrencesStableOrder = repoOccurrences
.map { RepoOccurrences(it.repo, it.files.sortedBy { it.path }) }
.map { occurrence -> RepoOccurrences(occurrence.repo, occurrence.files.sortedBy { file -> file.path }) }
.sortedBy { it.repo }
fail(
buildString {
@@ -397,4 +393,4 @@ class CodeConformanceTest : TestCase() {
}
private fun String.ensureFileOrEndsWithSlash() =
if (endsWith("/") || "." in substringAfterLast('/')) this else this + "/"
if (endsWith("/") || "." in substringAfterLast('/')) this else "$this/"

View File

@@ -62,17 +62,8 @@ class KotlinBuildProperties(
val isInJpsBuildIdeaSync: Boolean
get() = isJpsBuildEnabled && isInIdeaSync
private val kotlinUltimateExists: Boolean = propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
val isTeamcityBuild: Boolean = getBoolean("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled: Boolean = getBoolean("intellijUltimateEnabled", isTeamcityBuild) ||
getBoolean("kotlin.build.dependencies.iu.enabled", isTeamcityBuild)
val includeCidrPlugins: Boolean = kotlinUltimateExists && getBoolean("cidrPluginsEnabled")
val includeUltimate: Boolean = kotlinUltimateExists && (isTeamcityBuild || intellijUltimateEnabled)
val buildCacheUrl: String? = getOrNull("kotlin.build.cache.url") as String?
val pushToBuildCache: Boolean = getBoolean("kotlin.build.cache.push", isTeamcityBuild)

View File

@@ -46,3 +46,5 @@ kotlin.native.enabled=false
kotlin.native.home=kotlin-native/dist
org.gradle.vfs.watch=true
#org.gradle.unsafe.configuration-cache=true

View File

@@ -13,10 +13,6 @@ val ideaSandboxDir: File by extra
val ideaSdkPath: String
get() = IntellijRootUtils.getIntellijRootDir(rootProject).absolutePath
val intellijUltimateEnabled: Boolean by rootProject.extra
val ideaUltimatePluginDir: File by rootProject.extra
val ideaUltimateSandboxDir: File by rootProject.extra
fun JUnit.configureForKotlin(xmx: String = "1600m") {
vmParameters = listOf(
"-ea",
@@ -230,10 +226,6 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
idea("[JPS] IDEA (No ProcessCanceledException)", ideaSandboxDir, ideaPluginDir, disableProcessCanceledException = true)
if (intellijUltimateEnabled) {
idea("[JPS] IDEA Ultimate", ideaUltimateSandboxDir, ideaPluginDir)
}
defaults<JUnit> {
configureForKotlin()
}
@@ -245,14 +237,6 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
configureForKotlin()
}
if (intellijUltimateEnabled) {
junit("[JPS] All IDEA Ultimate Plugin Tests") {
moduleName = "kotlin.ultimate.test"
pattern = "org.jetbrains.kotlin.*"
configureForKotlin()
}
}
junit("[JPS] Compiler Tests") {
moduleName = "kotlin.compiler.test"
pattern = "org.jetbrains.kotlin.*"

View File

@@ -37,16 +37,6 @@ configure<PublishingExtension> {
repositories {
maven {
url = uri(findProperty("deployRepoUrl") ?: findProperty("deploy-url") ?: "${rootProject.buildDir}/repo")
authentication {
val mavenUser = findProperty("kotlin.bintray.user") as String?
val mavenPass = findProperty("kotlin.bintray.password") as String?
if (url.scheme != "file" && mavenUser != null && mavenPass != null) {
credentials {
username = mavenUser
password = mavenPass
}
}
}
}
}
}

View File

@@ -13,10 +13,6 @@ val ideaSandboxDir: File by extra
val ideaSdkPath: String
get() = IntellijRootUtils.getIntellijRootDir(rootProject).absolutePath
val intellijUltimateEnabled: Boolean by rootProject.extra
val ideaUltimatePluginDir: File by rootProject.extra
val ideaUltimateSandboxDir: File by rootProject.extra
val pathToKotlinModularizedTestData = kotlinBuildProperties.pathToKotlinModularizedTestData
fun MutableList<String>.addModularizedTestArgs(prefix: String, benchFilter: String?) {

View File

@@ -37,28 +37,14 @@ val distKotlinHomeDir by extra("$distDir/kotlinc")
val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val clionSandboxDir = "$commonLocalDataDir/clionSandbox"
val appcodeSandboxDir = "$commonLocalDataDir/appcodeSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
val appcodePluginDir = "$distDir/artifacts/appcodePlugin/Kotlin"
val clionPluginDir = "$distDir/artifacts/clionPlugin/Kotlin"
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["clionSandboxDir"] = project.file(ideaSandboxDir)
extra["appcodeSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
extra["appcodePluginDir"] = project.file(appcodePluginDir)
extra["clionPluginDir"] = project.file(clionPluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
@@ -85,13 +71,11 @@ extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
val isTeamcityBuild = false
val intellijUltimateEnabled = false
val effectSystemEnabled by extra(false)
val newInferenceEnabled by extra(false)
val intellijSeparateSdks = false
extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
@@ -276,10 +260,6 @@ tasks {
create("cleanupArtifacts") {
doLast {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
delete(appcodePluginDir)
delete(clionPluginDir)
}
}

View File

@@ -24,11 +24,6 @@
<username>${kotlin.sonatype.user}</username>
<password>${kotlin.sonatype.password}</password>
</server>
<server>
<id>bintray</id>
<username>${kotlin.bintray.user}</username>
<password>${kotlin.bintray.password}</password>
</server>
<server>
<id>space-packages</id>
<username>${kotlin.space-packages.user}</username>

View File

@@ -236,6 +236,7 @@ abstract class BaseGradleIT {
val androidGradlePluginVersion: AGPVersion? = null,
val forceOutputToStdout: Boolean = false,
val debug: Boolean = false,
val parallel: Boolean = true,
val freeCommandLineArgs: List<String> = emptyList(),
val kotlinVersion: String = KOTLIN_VERSION,
val kotlinDaemonDebugPort: Int? = null,
@@ -268,7 +269,7 @@ abstract class BaseGradleIT {
val projectName: String,
val gradleVersionRequirement: GradleVersionRequired = defaultGradleVersion,
directoryPrefix: String? = null,
val minLogLevel: LogLevel = LogLevel.DEBUG,
val minLogLevel: LogLevel = LogLevel.INFO,
val addHeapDumpOptions: Boolean = true
) {
internal val testCase = this@BaseGradleIT
@@ -904,6 +905,9 @@ Finished executing task ':$taskName'|
if (options.debug) {
add("-Dorg.gradle.debug=true")
}
if (options.parallel) {
add("-Dorg.gradle.parallel=true")
}
options.kotlinDaemonDebugPort?.let { port ->
add("-Dkotlin.daemon.jvm.options=-agentlib:jdwp=transport=dt_socket\\,server=y\\,suspend=y\\,address=$port")
}

View File

@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.gradle
import org.jetbrains.kotlin.gradle.util.AGPVersion
import org.jetbrains.kotlin.gradle.util.modify
import org.jetbrains.kotlin.test.util.KtTestUtil
import kotlin.system.measureTimeMillis
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -165,8 +166,9 @@ class KotlinSpecificDependenciesIT : BaseGradleIT() {
)
)
).forEach { testCase ->
println(testCase)
with(testCase) {
project.prepare()
measure("prepare") { project.prepare() }
project.gradleBuildScript().appendText(
configurationsToAddDependency.joinToString("\n", "\n") { configuration ->
"\ndependencies { \"$configuration\"(\"$kotlinTestMultiplatformDependency\") }"
@@ -174,16 +176,29 @@ class KotlinSpecificDependenciesIT : BaseGradleIT() {
)
classpathElementsExpectedByTask.forEach { (task, expected) ->
val (notInClasspath, inClasspath) = expected.partition { it.startsWith("!") }
project.checkTaskCompileClasspath(task, inClasspath, notInClasspath.map { it.removePrefix("!") })
measure("Task: $task") {
project.checkTaskCompileClasspath(task, inClasspath, notInClasspath.map { it.removePrefix("!") })
}
}
filesExpectedByConfiguration.forEach { (configuration, expected) ->
val (notInItems, inItems) = expected.partition { it.startsWith("!") }
project.checkConfigurationContent(configuration, subproject = null, inItems, notInItems.map { it.removePrefix("!") })
measure("Configuration: $configuration") {
project.checkConfigurationContent(
configuration,
subproject = null,
inItems,
notInItems.map { it.removePrefix("!") })
}
}
}
}
}
fun measure(message: String, f: () -> Unit) {
println(message)
println(measureTimeMillis(f))
}
@Test
fun testFrameworkSelection() {
data class TestCase(
@@ -320,7 +335,8 @@ private fun BaseGradleIT.Project.checkPrintedItems(
}
""".trimIndent()
)
build("${subproject?.prependIndent(":").orEmpty()}:$printingTaskName") {
build("${subproject?.prependIndent(":").orEmpty()}:$printingTaskName",
options = defaultBuildOptions().copy(forceOutputToStdout = true)) {
assertSuccessful()
val itemsLine = output.lines().single { "###$printingTaskName" in it }.substringAfter(printingTaskName)
val items = itemsLine.removeSurrounding("[", "]").split(", ").toSet()

View File

@@ -0,0 +1,11 @@
plugins {
id "com.gradle.enterprise" version "3.6.1"
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

View File

@@ -166,9 +166,15 @@ abstract class AbstractParcelBoxTest : CodegenTestCase() {
JUNIT_GENERATED_TEST_CLASS_FQNAME
).start()
val out = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
val err = process.errorStream.bufferedReader().lineSequence().joinToString("\n")
process.waitFor(3, TimeUnit.MINUTES)
println(process.inputStream.bufferedReader().lineSequence().joinToString("\n"))
if (process.exitValue() != 0) {
println(out)
println(err)
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
}
} finally {

View File

@@ -163,9 +163,14 @@ abstract class AbstractParcelizeBoxTest : CodegenTestCase() {
JUNIT_GENERATED_TEST_CLASS_FQNAME
).start()
val out = process.inputStream.bufferedReader().lineSequence().joinToString("\n")
val err = process.errorStream.bufferedReader().lineSequence().joinToString("\n")
process.waitFor(3, TimeUnit.MINUTES)
println(process.inputStream.bufferedReader().lineSequence().joinToString("\n"))
if (process.exitValue() != 0) {
println(out)
println(err)
throw AssertionError("Process exited with exit code ${process.exitValue()} \n" + classFileFactory.createText())
}
} finally {

View File

@@ -372,43 +372,6 @@ include ":prepare:ide-plugin-dependencies:android-extensions-compiler-plugin-for
":prepare:ide-plugin-dependencies:compiler-components-for-jps",
":prepare:ide-plugin-dependencies:kotlin-compiler-tests-for-ide"
if (buildProperties.includeCidrPlugins) {
logger.info("Including CIDR modules in settings.gradle")
include ":kotlin-ultimate:ide:cidr-gradle-tooling",
":kotlin-ultimate:ide:common-native",
":kotlin-ultimate:ide:common-cidr-mobile",
":kotlin-ultimate:ide:common-cidr-native",
":kotlin-ultimate:ide:common-cidr-swift-native",
":kotlin-ultimate:ide:common-noncidr-native",
":kotlin-ultimate:ide:appcode-native",
":kotlin-ultimate:ide:mobile-native",
":kotlin-ultimate:prepare:cidr-plugin",
":kotlin-ultimate:prepare:appcode-plugin",
":kotlin-ultimate:prepare:mobile-plugin",
":kotlin-ultimate:libraries:tools:apple-gradle-plugin-api"
if (projectVersions.contains("versions.androidStudioRelease")) {
logger.info("Including KMM modules in settings.gradle")
include ":kotlin-ultimate:ide:android-studio-native",
":kotlin-ultimate:prepare:kmm-plugin"
} else {
logger.info("NOT including KMM modules in settings.gradle")
}
} else {
logger.info("NOT including CIDR modules in settings.gradle")
}
if (buildProperties.includeUltimate) {
include ":kotlin-ultimate:ultimate",
":kotlin-ultimate:ultimate:ultimate-runner",
":kotlin-ultimate:ide:common-native",
":kotlin-ultimate:ide:common-noncidr-native",
":kotlin-ultimate:ide:ultimate-native"
logger.info("Including extension for IJ Ultimate in settings.gradle")
} else {
logger.info("NOT including extension for IJ Ultimate in settings.gradle")
}
if (buildProperties.inJpsBuildIdeaSync) {
include ":kotlin-stdlib:jps-build"
project(":kotlin-stdlib:jps-build").projectDir = "$rootDir/libraries/stdlib/jps-build" as File