Skip to content

Commit

Permalink
Update Gradle and dependency versions where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Nov 28, 2020
1 parent 32a3fcc commit 2de5365
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 49 deletions.
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import kotlin.script.experimental.jvmhost.JvmScriptCompiler
plugins {
`kotlin-dsl`
kotlin("plugin.serialization") version "1.3.72"
id("com.github.ben-manes.versions") version "0.29.0"
id("com.github.ben-manes.versions") version "0.36.0"
}

buildscript {
Expand All @@ -44,7 +44,7 @@ buildscript {
}
dependencies {
classpath("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0")
classpath("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
classpath("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
classpath(kotlin("scripting-jvm-host", "1.3.72"))
}
}
Expand Down
34 changes: 19 additions & 15 deletions buildSrc/src/main/kotlin/net/kautler/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,36 @@ import org.gradle.api.artifacts.dsl.DependencyHandler
import org.jetbrains.kotlin.gradle.targets.js.npm.NpmDependencyExtension

val versions = mapOf(
// project dependencies
"@actions/cache" to "1.0.1",
// project NPM dependencies
"@actions/cache" to "1.0.4",
"@actions/core" to "1.2.6",
"@actions/exec" to "1.0.4",
"@actions/http-client" to "1.0.8",
"@actions/http-client" to "1.0.9",
"@actions/io" to "1.0.2",
"@actions/tool-cache" to "1.6.0",
"@types/semver" to "7.3.1",
"kotlin-extensions" to "1.0.1-pre.110-kotlin-1.4.0",
"kotlinx-coroutines-core" to "1.3.9",
"kotlinx-nodejs" to "0.0.6",
"node" to "12.18.3",
"@actions/tool-cache" to "1.6.1",
"@types/semver" to "7.3.4",
"null-writable" to "1.0.5",
"semver" to "7.3.2",

// build dependencies
"@vercel/ncc" to "0.23.0",
"com.github.ben-manes.versions" to "0.29.0",
// project Java dependencies
"kotlin-extensions" to "1.0.1-pre.129-kotlin-1.4.20",
"kotlinx-coroutines-core" to "1.4.2",
"kotlinx-nodejs" to "0.0.7",
"node" to "12.18.3",

// build NPM dependencies
"@vercel/ncc" to "0.25.1",

// build Java dependencies
"com.github.ben-manes.versions" to "0.36.0",
"dukat" to "0.5.7",
"github-api" to "1.116",
"github-api" to "1.117",
"kaml" to "0.18.1",
"kotlinx-serialization-runtime" to "0.20.0",
"net.researchgate.release" to "2.8.1",
"net.wooga.github" to "1.4.0",
"org.ajoberstar.grgit" to "4.0.2",
"org.jetbrains.kotlin.js" to "1.4.0"
"org.ajoberstar.grgit" to "4.1.0",
"org.jetbrains.kotlin.js" to "1.4.20"
)

val String.version get() = "${versions[this]}"
Expand Down
4 changes: 1 addition & 3 deletions buildSrc/src/main/kotlin/net/kautler/ncc_packer.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ kotlin {
.withPropertyName("packaged JavaScript files")

args(
// work-around for https://youtrack.jetbrains.com/issue/KT-41286
tasks.compileKotlinJs.get().outputFile.absolutePath,
rootProject.tasks.compileKotlinJs.get().outputFile.absolutePath,
output.get().asFile.absolutePath
)
Expand All @@ -58,7 +56,7 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core".withVersion)
implementation("org.jetbrains:kotlin-extensions".withVersion)
implementation("org.jetbrains.kotlinx:kotlinx-nodejs".withVersion)
implementation(npm("@vercel/ncc"))
implementation(npm("@vercel/ncc", generateExternals = false))
}

val TaskContainer.compileKotlinJs
Expand Down
7 changes: 5 additions & 2 deletions buildSrc/src/main/kotlin/net/kautler/node.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ dependencies {
implementation(npm("@actions/io"))
implementation(npm("@actions/tool-cache"))
implementation(npm("@types/semver"))
implementation(npm("semver"))
implementation(npm("semver", generateExternals = false))
implementation(npm("null-writable"))
}

Expand Down Expand Up @@ -157,7 +157,7 @@ tasks.withType(IntegratedDukatTask::class) {
),
// work-around for https://github.com/Kotlin/dukat/issues/399
"tool-cache.module_@actions_tool-cache.kt" to listOf(
"""\Qtypealias HTTPError = Error\E$""" to "",
"""\Qtypealias HTTPError = Error\E$""" to "external class HTTPError : Throwable",
"""\Qtypealias IToolRelease = IToolRelease\E$""" to "",
"""\Qtypealias IToolReleaseFile = IToolReleaseFile\E$""" to ""
),
Expand All @@ -166,6 +166,9 @@ tasks.withType(IntegratedDukatTask::class) {
"""\Qtypealias ValidationError = Error\E$""" to "external class ValidationError : Throwable",
"""\Qtypealias ReserveCacheError = Error\E$""" to "external class ReserveCacheError : Throwable"
),
"index.module_@actions_http-client.kt" to listOf(
"""\Qtypealias HttpClientError = Error\E$""" to "external class HttpClientError : Throwable"
),
// work-around for https://github.com/Kotlin/dukat/issues/400
"semver.module_semver.kt" to listOf(
"""\Q@JsModule("semver")\E$""" to """@JsModule("semver/classes/semver")"""
Expand Down
40 changes: 14 additions & 26 deletions buildSrc/src/main/kotlin/net/kautler/versions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,27 +75,23 @@ tasks.dependencyUpdates {
}

val ignored = outdated.dependencies.filter {
// Not until Gradle is on Kotlin 1.4
it.matches("com.charleskorn.kaml", "kaml") ||
it.matches("org.jetbrains.kotlin", "kotlin-reflect") ||
it.matches("org.jetbrains.kotlin", "kotlin-sam-with-receiver") ||
it.matches("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable") ||
it.matches("org.jetbrains.kotlin", "kotlin-scripting-jvm-host") ||
it.matches("org.jetbrains.kotlin", "kotlin-serialization") ||
it.matches("org.jetbrains.kotlin", "kotlin-serialization-unshaded") ||
it.matches("org.jetbrains.kotlin", "kotlin-stdlib-jdk8") ||
it.matches("org.jetbrains.kotlin.plugin.serialization", "org.jetbrains.kotlin.plugin.serialization.gradle.plugin") ||
it.matches("org.jetbrains.kotlinx", "kotlinx-serialization-runtime")
}

val ignoredUnresolved = unresolved.dependencies.filter {
// work-around for https://github.com/ben-manes/gradle-versions-plugin/issues/334
it.matches("org.jetbrains", "kotlin-extensions") ||
it.matches("org.jetbrains.kotlinx", "kotlinx-nodejs")
// This plugin should always be used without version as it is tightly
// tied to the Gradle version that is building the precompiled script plugins
it.matches("org.gradle.kotlin.kotlin-dsl", "org.gradle.kotlin.kotlin-dsl.gradle.plugin")
// Not until Gradle is on Kotlin 1.4
|| it.matches("com.charleskorn.kaml", "kaml")
|| it.matches("org.jetbrains.kotlin", "kotlin-reflect")
|| it.matches("org.jetbrains.kotlin", "kotlin-sam-with-receiver")
|| it.matches("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
|| it.matches("org.jetbrains.kotlin", "kotlin-scripting-jvm-host")
|| it.matches("org.jetbrains.kotlin", "kotlin-serialization")
|| it.matches("org.jetbrains.kotlin", "kotlin-serialization-unshaded")
|| it.matches("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
|| it.matches("org.jetbrains.kotlin.plugin.serialization", "org.jetbrains.kotlin.plugin.serialization.gradle.plugin")
|| it.matches("org.jetbrains.kotlinx", "kotlinx-serialization-runtime")
}

outdated.dependencies.removeAll(ignored)
unresolved.dependencies.removeAll(ignoredUnresolved)
updateCounts()

PlainTextReporter(project, revisionLevel(), gradleReleaseChannelLevel())
Expand All @@ -109,14 +105,6 @@ tasks.dependencyUpdates {
}
}

if (ignoredUnresolved.isNotEmpty()) {
println("\nThe following dependencies could not be resolved but were ignored:")
ignoredUnresolved.forEach {
println(" - ${it.group}:${it.name}:${it.version}")
it.projectUrl?.let { println(" $it") }
}
}

if (gradle.current.isFailure || (unresolved.count != 0)) {
error("Unresolved libraries found")
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 2 additions & 0 deletions ncc-packer/src/main/kotlin/net/kautler/nccpacker/ncc.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ external interface NccOptions {
var v8cache: Boolean
var quiet: Boolean
var debugLog: Boolean
var transpileOnly: Boolean
var target: String
}

external interface NccResult {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package net.kautler.github.action.setup_wsl

import Buffer
import NodeJS.get
import NullWritable
import ReserveCacheError
import ValidationError
Expand Down

0 comments on commit 2de5365

Please sign in to comment.