Skip to content

Commit

Permalink
Use kotlin version from compatybility matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ogesaku committed Jan 28, 2023
1 parent 0516b51 commit 9f945e9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.8.0"
// https://docs.gradle.org/current/userguide/compatibility.html
kotlin("jvm") version "1.7.10"
id("jacoco")
id("com.github.kt3k.coveralls") version "2.12.0"
id("com.gradle.plugin-publish") version "1.1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ internal object ManifestAttributes {
hostNameResolver: HostNameResolver,
project: Project,
attributes: Attributes,
extension: ManifestPluginExtension
extension: ManifestPluginExtension,
) {
val generated = mapOf(
"Main-Class" to orEmpty { project.properties["mainClassName"] }
"Main-Class" to orEmpty { project.properties["mainClassName"] },
)
.plus(implementationAttributes(project, extension))
.plus(buildAttributes(clock, hostNameResolver, extension))
Expand Down Expand Up @@ -72,15 +72,15 @@ internal object ManifestAttributes {

private fun implementationAttributes(
project: Project,
extension: ManifestPluginExtension
extension: ManifestPluginExtension,
): Map<String, Any?> {
if (!extension.implementationAttributes) {
return mapOf()
}
return mapOf(
"Implementation-Title" to lazy { implementationTitle(project) },
"Implementation-Group" to lazy { project.group },
"Implementation-Version" to lazy { project.version }
"Implementation-Version" to lazy { project.version },
)
}

Expand All @@ -97,7 +97,7 @@ internal object ManifestAttributes {
"Built-Host" to orEmpty { hostNameResolver.resolveHostName() },
"Built-Date" to format(clock.instant()),
"Built-OS" to systemProperties("os.name", "os.version", "os.arch"),
"Built-JDK" to systemProperties("java.version", "java.vendor")
"Built-JDK" to systemProperties("java.version", "java.vendor"),
)
}

Expand All @@ -114,7 +114,7 @@ internal object ManifestAttributes {
"SCM-Commit-Message" to orEmpty { head.shortMessage },
"SCM-Commit-Hash" to orEmpty { head.name() },
"SCM-Commit-Author" to orEmpty { "${head.authorIdent.name.trim()} <${head.authorIdent.emailAddress.trim()}>" },
"SCM-Commit-Date" to orEmpty { format(head.authorIdent.`when`.toInstant()) }
"SCM-Commit-Date" to orEmpty { format(head.authorIdent.`when`.toInstant()) },
)
} catch (e: Throwable) {
project.logger.log(INFO, "Could not resolve manifest SCM attributes. Using fallback.", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import java.time.Clock

open class ManifestPlugin : ParameterizedManifestPlugin(
clock = Clock.systemUTC(),
hostNameResolver = INET_HOST_NAME_RESOLVER
hostNameResolver = INET_HOST_NAME_RESOLVER,
) {
companion object {
const val PLUGIN_ID = "com.coditory.manifest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import java.time.Clock

open class ParameterizedManifestPlugin(
private val clock: Clock,
private val hostNameResolver: HostNameResolver
private val hostNameResolver: HostNameResolver,
) : Plugin<Project> {

override fun apply(project: Project) {
Expand Down

0 comments on commit 9f945e9

Please sign in to comment.