Skip to content

Commit

Permalink
Replace kotlinx-serialization and kaml by SnakeYAML
Browse files Browse the repository at this point in the history
kaml is very eager for a library when it comes to updating the required Kotlin version.
This does not harmonize with the embedded Kotlin runtime in Gradle.
Now pure SnakeYAML is used to read the actions file for getting the input defaults.
  • Loading branch information
Vampire committed Feb 16, 2023
1 parent c2e1cac commit dfcd136
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 348 deletions.
5 changes: 1 addition & 4 deletions gradle/build-logic/build-logic.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
alias(libs.plugins.kotlin.serialization)
id(libs.plugins.convention.dependency.updates.report.aggregation.get().pluginId)
alias(libs.plugins.dependency.analysis)
}
Expand All @@ -34,9 +33,7 @@ dependencies {
implementation(":dependency-updates-report-aggregation")
implementation(libs.build.inject)
implementation(libs.build.github.api)
implementation(platform(libs.build.kotlinx.serialization.bom))
implementation(libs.build.kotlinx.serialization.core)
implementation(libs.build.kaml)
implementation(libs.build.snakeyaml)
implementation(embeddedKotlin("compiler-embeddable"))
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,12 @@

package net.kautler.dao.action

import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.Serializable
import net.kautler.dao.action.Output.CompositeOutput
import net.kautler.dao.action.Output.NormalOutput

@ExperimentalSerializationApi
@Serializable
data class GitHubAction(
val name: String,
val author: String? = null,
val description: String,
val inputs: Map<String, Input>? = null,
@Serializable(with = OutputMapSerializer::class)
val outputs: Map<String, Output>? = null,
val runs: Runs,
val branding: Branding? = null
) {
init {
require((runs.using == "composite") || (outputs.orEmpty().values.all { it is NormalOutput })) {
"Non-composite actions must only contain normal outputs"
}
require((runs.using != "composite") || (outputs.orEmpty().values.all { it is CompositeOutput })) {
"Composite actions must only contain composite outputs"
}
}
class GitHubAction {
var name: String? = null
var author: String? = null
var description: String? = null
var inputs: Map<String, Input>? = null
var outputs: Map<String, Any>? = null
var runs: Map<String, Any>? = null
var branding: Map<String, String>? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@

package net.kautler.dao.action

import kotlinx.serialization.Serializable

@Serializable
data class Input(
val description: String,
val required: Boolean = false,
val deprecationMessage: String? = null,
val default: String? = null
)
class Input {
var description: String? = null
var required: Boolean = false
var deprecationMessage: String? = null
var default: String? = null
}

This file was deleted.

This file was deleted.

106 changes: 0 additions & 106 deletions gradle/build-logic/src/main/kotlin/net/kautler/dao/action/Runs.kt

This file was deleted.

47 changes: 0 additions & 47 deletions gradle/build-logic/src/main/kotlin/net/kautler/dao/action/Step.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ tasks.dependencyUpdates {
dependsOn(validateGradleWrapperJar)

ignoredDependencies {
// Should match the Kotlin version of Gradle as the serialization is used during the build
add(group = "org.jetbrains.kotlin.plugin.serialization", name = "org.jetbrains.kotlin.plugin.serialization.gradle.plugin")
// This plugin should always be used without version as it is tightly
// tied to the Gradle version that is building the precompiled script plugins
add(group = "org.gradle.kotlin.kotlin-dsl", name = "org.gradle.kotlin.kotlin-dsl.gradle.plugin")
Expand Down
Loading

0 comments on commit dfcd136

Please sign in to comment.