Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetbrains: Add ktlint to generator project #896

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions telemetry/jetbrains/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 160
tab_width = 4
ij_continuation_indent_size = 4

[*.{kt,kts}]
ktlint_code_style = ktlint_official
8 changes: 5 additions & 3 deletions telemetry/jetbrains/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
`maven-publish`
signing
alias(libs.plugins.nexus.publishing)
alias(libs.plugins.jlleitschuh.ktlint)
}

java {
Expand Down Expand Up @@ -146,9 +147,10 @@ publishing {
gradlePlugin { setAutomatedPublishing(false) }

signing {
if (project.hasProperty("signing.keyId")
&& project.hasProperty("signing.password")
&& project.hasProperty("signing.secretKeyRingFile")) {
if (project.hasProperty("signing.keyId") &&
project.hasProperty("signing.password") &&
project.hasProperty("signing.secretKeyRingFile")
) {
sign(publishing.publications["mavenJava"])
}
}
Expand Down
2 changes: 2 additions & 0 deletions telemetry/jetbrains/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
assertJ = "3.26.3"
jackson = "2.17.2"
jlleitschuh-ktlint = "12.1.1"
# deprecated; should move to json-skema
jsonSchema = "1.14.4"
junit4 = "4.13.2"
Expand All @@ -16,5 +17,6 @@ json-schema = { module = "com.github.erosb:everit-json-schema", version.ref = "j
junit4 = { module = "junit:junit", version.ref = "junit4" }

[plugins]
jlleitschuh-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "jlleitschuh-ktlint" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
nexus-publishing = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexus" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
package software.aws.toolkits.telemetry.generator

object ResourceLoader {
private const val schemaPath = "/telemetrySchema.json"
private const val SCHEMA_PATH = "/telemetrySchema.json"

val SCHEMA_FILE = this.javaClass.getResourceAsStream(SCHEMA_PATH).use { it.bufferedReader().readText() }

val SCHEMA_FILE = this.javaClass.getResourceAsStream(schemaPath).use { it.bufferedReader().readText() }
// TODO add a manifest or something
val DEFINITIONS_FILES = listOf("/definitions/commonDefinitions.json").map {
this.javaClass.getResourceAsStream(it).use {
it.bufferedReader().readText()
val DEFINITIONS_FILES =
listOf("/definitions/commonDefinitions.json").map {
this.javaClass.getResourceAsStream(it).use {
it.bufferedReader().readText()
}
}
}
}
Loading