Skip to content

Commit

Permalink
Merge pull request #10360 from gradle/bamboo/master/kotlin-1.3.50
Browse files Browse the repository at this point in the history
 Upgrade embedded Kotlin version to 1.3.50
  • Loading branch information
eskatos committed Aug 27, 2019
2 parents 16cfa48 + 20aed37 commit 081ece1
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ open class CheckKotlinCompilerEmbeddableDependencies : DefaultTask() {
@Suppress("unused")
fun check() {
receiptFile.delete()
val currentFiles = current.files.sorted()
val expectedFiles = expected.files.filterNot { it.name.startsWith("kotlin-compiler-embeddable-") }.sorted()
val currentFiles = current.files.map { it.name }.sorted()
val expectedFiles = expected.files.map { it.name }.filterNot { it.startsWith("kotlin-compiler-embeddable-") }.sorted()
require(currentFiles == expectedFiles) {
var message = "$path dependencies to kotlin-compiler-embeddable dependencies are wrong\n\nexpected:\n\n"
message += expected.joinToString(separator = "\n", postfix = "\n\ngot:\n\n") { " ${it.name}" }
message += current.joinToString(separator = "\n", postfix = "\n\n") { " ${it.name}" }
message += expectedFiles.joinToString(separator = "\n", postfix = "\n\ngot:\n\n") { " $it" }
message += currentFiles.joinToString(separator = "\n", postfix = "\n\n") { " $it" }
message += "Please fix dependency declarations in ${project.buildFile.relativeTo(project.rootDir)}"
message
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ext {
libraries = [:]
groovyVersion = '2.5.8'
kotlinVersion = '1.3.41'
kotlinVersion = '1.3.50'
}

// TODO This must match the version number in code-quality-configuration.gradle.kts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract class DistributionIntegrationSpec extends AbstractIntegrationSpec {
* Change this if you added or removed dependencies.
*/
int getThirdPartyLibJarsCount() {
179
183
}

int getLibJarsCount() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec {
def "verify 3rd-party dependencies jar hashes"() {
setup:
// dependencies produced by Gradle and cannot be verified by this test
def excluded = ['gradle-', 'fastutil-8.2.1-min', 'kotlin-compiler-embeddable-1.3.41-patched']
def excluded = ['gradle-', 'fastutil-8.2.1-min', 'kotlin-compiler-embeddable-1.3.50-patched']

def expectedHashes = [
'annotations-13.0.jar' : 'ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478',
Expand All @@ -57,15 +57,19 @@ class DistributionIntegritySpec extends DistributionIntegrationSpec {
'jcl-over-slf4j-1.7.25.jar' : '5e938457e79efcbfb3ab64bc29c43ec6c3b95fffcda3c155f4a86cc320c11e14',
'jsr305-3.0.2.jar' : '766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7',
'jul-to-slf4j-1.7.25.jar' : '416c5a0c145ad19526e108d44b6bf77b75412d47982cce6ce8d43abdbdbb0fac',
'kotlin-reflect-1.3.41.jar': '01d469878c6853a607baaadf869c7474b971abe6dd2cb74f244bea0ffb453c76',
'kotlin-sam-with-receiver-compiler-plugin-1.3.41.jar': 'e568796401d39904aca06ea23127dd13b44fa124831c33c8595f883b0ec83413',
'kotlin-script-runtime-1.3.41.jar': 'ac184612f258b460b5af4ca47f6bee0bab20a46fa818b86697ba41ef29626a31',
'kotlin-scripting-compiler-embeddable-1.3.41.jar': 'c2da2d19f569e8369c2f55affa0dee5f50771bc3685697ee948ee29a16d0c3c1',
'kotlin-scripting-compiler-impl-embeddable-1.3.41.jar': '854c39cdd705be01956439ae70f44a785cd0ba66388299f98bc0af75db328f29',
'kotlin-stdlib-1.3.41.jar': '6ea3d0921b26919b286f05cbdb906266666a36f9a7c096197114f7495708ffbc',
'kotlin-stdlib-common-1.3.41.jar': '6c91dea17d7dce5f0b550c3de3305767e5fb46247b6d1eb7eca0ca1fe18458de',
'kotlin-stdlib-jdk7-1.3.41.jar': '25e2409aba0ec37d2fd7c77727d7835b511879de8d9bf4862af0b493aabbe39e',
'kotlin-stdlib-jdk8-1.3.41.jar': 'f7dbbaee3e0841758187a213c052388a4e619e11c87ab16f4bc229cfe7ce5fed',
'kotlin-daemon-embeddable-1.3.50.jar': 'c7b1b872e04a6fdfcfb1d0451de8a49f9900608bae93f9120c35bbcde2d911fa',
'kotlin-reflect-1.3.50.jar': '64583199ea5a54aefd1bd1595288925f784226ee562d1dd279011c6075b3d7a4',
'kotlin-sam-with-receiver-compiler-plugin-1.3.50.jar': 'd8aa13e98a76adb326fff8c23a66a1fc3f8ab0a1b87c311598191b069f275590',
'kotlin-scripting-common-1.3.50.jar': 'dd16d71ee2f2f0f3e53cb7f32b30cc9fa1d457ad7d5f428d15a9638c1cc983fc',
'kotlin-scripting-jvm-1.3.50.jar': 'fa6fa1b78ae0d3e6f950143567cc207e03b64ce6cba842c5149a5226a784c0c2',
'kotlin-scripting-jvm-host-embeddable-1.3.50.jar': '5084f88eed6fb0850b6aa3148bfeb593744ae04bc26e8b82244a43cbb65ce16c',
'kotlin-script-runtime-1.3.50.jar': '7ff70c52bf062afbe0a0e78962a9b92b89b0cf4a47a481d24037257e56fb7e4c',
'kotlin-scripting-compiler-embeddable-1.3.50.jar': 'baa76bdc840a1b7ffc88c5d6e327b75a37118a44e60deae56d71d408fd1c8ac5',
'kotlin-scripting-compiler-impl-embeddable-1.3.50.jar': '4ab8accc2bff60ae6d767f7e96036f0f8807e21bf758362e023e3ea57c4e490f',
'kotlin-stdlib-1.3.50.jar': 'e6f05746ee0366d0b52825a090fac474dcf44082c9083bbb205bd16976488d6c',
'kotlin-stdlib-common-1.3.50.jar': '8ce678e88e4ba018b66dacecf952471e4d7dfee156a8a819760a5a5ff29d323c',
'kotlin-stdlib-jdk7-1.3.50.jar': '9a026639e76212f8d57b86d55b075394c2e009f1979110751d34c05c5f75d57b',
'kotlin-stdlib-jdk8-1.3.50.jar': '1b351fb6e09c14b55525c74c1f4cf48942eae43c348b7bc764a5e6e423d4da0c',
'kotlinx-metadata-jvm-0.1.0.jar' : '9753bb39efef35957c5c15df9a3cb769aabf2cdfa74b47afcb7760e5146be3b5',
'kryo-2.24.0.jar' : '7e56b32c635058f9aa2820f88919ab702d029cbcd15285da9992e36cc0ae52f2',
'log4j-over-slf4j-1.7.25.jar' : 'c84c5ce4bbb661369ccd4c7b99682027598a0fb2e3d63a84259dbe5c0bf1f949',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Additionally, the following deprecated functionality now results in an error:
==== Updates to bundled Gradle dependencies

- Groovy has been updated to http://groovy-lang.org/changelogs/changelog-2.5.8.html[Groovy 2.5.8].
- Kotlin has been updated to https://blog.jetbrains.com/kotlin/2019/08/kotlin-1-3-50-released/[Kotlin 1.3.50].

The following breaking changes will appear as deprecation warnings with Gradle 5.6:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
api(futureKotlin("stdlib"))
api(futureKotlin("reflect"))
api(futureKotlin("script-runtime"))
api(futureKotlin("daemon-embeddable"))

runtimeOnly(library("trove4j"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {
description = "Kotlin DSL Gradle Plugins deployed to the Plugin Portal"

group = "org.gradle.kotlin"
version = "1.2.10"
version = "1.2.12"

base.archivesBaseName = "plugins"

Expand Down
11 changes: 10 additions & 1 deletion subprojects/kotlin-dsl/kotlin-dsl.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ dependencies {
implementation(library("guava"))
implementation(library("inject"))

implementation(futureKotlin("scripting-common")) {
isTransitive = false
}
implementation(futureKotlin("scripting-jvm")) {
isTransitive = false
}
implementation(futureKotlin("scripting-jvm-host-embeddable")) {
isTransitive = false
}
implementation(futureKotlin("scripting-compiler-embeddable")) {
isTransitive = false
}
Expand Down Expand Up @@ -101,7 +110,7 @@ dependencies {
// --- Enable automatic generation of API extensions -------------------
val apiExtensionsOutputDir = layout.buildDirectory.dir("generated-sources/kotlin")

val publishedKotlinDslPluginVersion = "1.2.9" // TODO:kotlin-dsl
val publishedKotlinDslPluginVersion = "1.2.11" // TODO:kotlin-dsl

tasks {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import org.gradle.plugin.management.internal.DefaultPluginRequests

import org.gradle.plugin.use.internal.PluginRequestCollector

import org.jetbrains.kotlin.scripting.definitions.KotlinScriptDefinition
import org.jetbrains.kotlin.scripting.definitions.ScriptDefinition

import org.jetbrains.org.objectweb.asm.ClassVisitor
import org.jetbrains.org.objectweb.asm.ClassWriter
Expand All @@ -79,10 +79,11 @@ import java.io.File

import kotlin.reflect.KClass

import kotlin.script.dependencies.Environment
import kotlin.script.dependencies.ScriptContents
import kotlin.script.experimental.dependencies.DependenciesResolver
import kotlin.script.experimental.dependencies.ScriptDependencies
import kotlin.script.experimental.api.ScriptCompilationConfiguration
import kotlin.script.experimental.api.baseClass
import kotlin.script.experimental.api.defaultImports
import kotlin.script.experimental.api.hostConfiguration
import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration


internal
Expand Down Expand Up @@ -166,7 +167,7 @@ class ResidualProgramCompiler(

private
fun mightBeLargerThan64KB(secondStageScriptText: String) =
// We use a simple heuristic to avoid converting the string to bytes
// We use a simple heuristic to avoid converting the string to bytes
// if all code points were in UTF32, 16K code points would require 64K bytes
secondStageScriptText.length >= 16 * 1024

Expand Down Expand Up @@ -588,7 +589,7 @@ class ResidualProgramCompiler(
private
fun compileStage1(
source: ProgramSource,
scriptDefinition: KotlinScriptDefinition,
scriptDefinition: ScriptDefinition,
compileClassPath: ClassPath = classPath
): InternalName =
withTemporaryScriptFileFor(source.path, source.text) { scriptFile ->
Expand All @@ -606,7 +607,7 @@ class ResidualProgramCompiler(
fun compileScript(
scriptFile: File,
originalPath: String,
scriptDefinition: KotlinScriptDefinition,
scriptDefinition: ScriptDefinition,
stage: String,
compileClassPath: ClassPath = classPath
) = InternalName.from(
Expand Down Expand Up @@ -677,16 +678,16 @@ class ResidualProgramCompiler(
fun scriptDefinitionFromTemplate(
template: KClass<out Any>,
implicitImports: List<String>
): KotlinScriptDefinition = object : KotlinScriptDefinition(template), DependenciesResolver {

override val dependencyResolver = this

override fun resolve(
scriptContents: ScriptContents,
environment: Environment
): DependenciesResolver.ResolveResult = DependenciesResolver.ResolveResult.Success(
ScriptDependencies(imports = implicitImports),
emptyList()
): ScriptDefinition {
val hostConfiguration = defaultJvmScriptingHostConfiguration
return ScriptDefinition.FromConfigurations(
hostConfiguration = hostConfiguration,
compilationConfiguration = ScriptCompilationConfiguration {
baseClass(template)
defaultImports(implicitImports)
hostConfiguration(hostConfiguration)
},
evaluationConfiguration = null
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ import org.jetbrains.kotlin.name.NameUtils

import org.jetbrains.kotlin.samWithReceiver.CliSamWithReceiverComponentContributor

import org.jetbrains.kotlin.scripting.definitions.KotlinScriptDefinition
import org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar
import org.jetbrains.kotlin.scripting.configuration.ScriptingConfigurationKeys.SCRIPT_DEFINITIONS
import org.jetbrains.kotlin.scripting.definitions.ScriptDefinition

import org.jetbrains.kotlin.utils.PathUtil
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
Expand All @@ -79,7 +79,7 @@ fun compileKotlinScriptModuleTo(
outputDirectory: File,
moduleName: String,
scriptFiles: Collection<String>,
scriptDef: KotlinScriptDefinition,
scriptDef: ScriptDefinition,
classPath: Iterable<File>,
logger: Logger,
pathTranslation: (String) -> String
Expand All @@ -97,7 +97,7 @@ internal
fun compileKotlinScriptToDirectory(
outputDirectory: File,
scriptFile: File,
scriptDef: KotlinScriptDefinition,
scriptDef: ScriptDefinition,
classPath: List<File>,
messageCollector: LoggingMessageCollector
): String {
Expand All @@ -120,7 +120,7 @@ fun compileKotlinScriptModuleTo(
outputDirectory: File,
moduleName: String,
scriptFiles: Collection<String>,
scriptDef: KotlinScriptDefinition,
scriptDef: ScriptDefinition,
classPath: Iterable<File>,
messageCollector: LoggingMessageCollector
) {
Expand Down Expand Up @@ -335,7 +335,7 @@ fun CompilerConfiguration.addScriptingCompilerComponents() {


private
fun CompilerConfiguration.addScriptDefinition(scriptDef: KotlinScriptDefinition) {
fun CompilerConfiguration.addScriptDefinition(scriptDef: ScriptDefinition) {
add(SCRIPT_DEFINITIONS, scriptDef)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class GradleApiExtensionsTest : TestWithClassPath() {
ClassAndGroovyNamedArguments::class
) {

assertGeneratedJarHash("5d34f3a38c731b782a6308f8509509a6")
assertGeneratedJarHash("d0536e6bf6c8a8fd6c8363e664cd0407")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ abstract class AbstractSmokeTest extends Specification {
static androidGradle = Versions.of("3.2.1", androidGradle3x, "3.4.2", "3.5.0")

// https://search.maven.org/search?q=g:org.jetbrains.kotlin%20AND%20a:kotlin-project&core=gav
static kotlin = Versions.of('1.3.31', '1.3.41')
static kotlin = Versions.of('1.3.31', '1.3.41', '1.3.50')

// https://plugins.gradle.org/plugin/org.gretty
static gretty = "2.3.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ project.afterEvaluate {
}

dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.0.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation 'org.jetbrains.anko:anko-common:0.9'

testImplementation 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ tasks {
assemble {
dependsOn(assembleWeb)
}
}
}

0 comments on commit 081ece1

Please sign in to comment.