Skip to content

Commit

Permalink
set .editorconfig format for kotlin files (#11716)
Browse files Browse the repository at this point in the history
  • Loading branch information
colesnodgrass committed Mar 19, 2024
1 parent b702065 commit f3692ad
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 103 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ ij_json_spaces_within_braces = false
ij_json_spaces_within_brackets = false
ij_json_wrap_long_lines = false

[*.{kt,kts}]
indent_size = 2
max_line_length = 150
ij_kotlin_packages_to_use_import_on_demand = unset

[{*.markdown,*.md}]
ij_markdown_force_one_space_after_blockquote_symbol = true
ij_markdown_force_one_space_after_header_symbol = true
Expand Down
121 changes: 62 additions & 59 deletions airbyte-cron/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,77 +1,80 @@
import java.util.Properties

plugins {
id("io.airbyte.gradle.jvm.app")
id("io.airbyte.gradle.docker")
id("io.airbyte.gradle.publish")
kotlin("jvm")
kotlin("kapt")
id("io.airbyte.gradle.jvm.app")
id("io.airbyte.gradle.docker")
id("io.airbyte.gradle.publish")
kotlin("jvm")
kotlin("kapt")
}

dependencies {
compileOnly(libs.lombok)
annotationProcessor(libs.lombok) // Lombok must be added BEFORE Micronaut
annotationProcessor(platform(libs.micronaut.platform))
annotationProcessor(libs.bundles.micronaut.annotation.processor)
kapt(libs.bundles.micronaut.annotation.processor)
compileOnly(libs.lombok)
annotationProcessor(libs.lombok) // Lombok must be added BEFORE Micronaut
annotationProcessor(platform(libs.micronaut.platform))
annotationProcessor(libs.bundles.micronaut.annotation.processor)
kapt(libs.bundles.micronaut.annotation.processor)

implementation(platform(libs.micronaut.platform))
implementation(libs.bundles.micronaut)
implementation(libs.bundles.micronaut.cache)
implementation(libs.bundles.micronaut.metrics)
implementation(libs.bundles.kubernetes.client)
implementation(libs.bundles.temporal)
implementation(libs.bundles.datadog)
implementation(libs.failsafe)
implementation(libs.failsafe.okhttp)
implementation(libs.java.jwt)
implementation(libs.kotlin.logging)
implementation(libs.okhttp)
implementation(libs.sentry.java)
implementation(libs.lombok)
implementation(libs.commons.io)
implementation(platform(libs.micronaut.platform))
implementation(libs.bundles.micronaut)
implementation(libs.bundles.micronaut.cache)
implementation(libs.bundles.micronaut.metrics)
implementation(libs.bundles.kubernetes.client)
implementation(libs.bundles.temporal)
implementation(libs.bundles.datadog)
implementation(libs.failsafe)
implementation(libs.failsafe.okhttp)
implementation(libs.java.jwt)
implementation(libs.kotlin.logging)
implementation(libs.okhttp)
implementation(libs.sentry.java)
implementation(libs.lombok)
implementation(libs.commons.io)

implementation(project(":airbyte-api"))
implementation(project(":airbyte-analytics"))
implementation(project(":airbyte-commons"))
implementation(project(":airbyte-commons-auth"))
implementation(project(":airbyte-commons-micronaut"))
implementation(project(":airbyte-commons-temporal"))
implementation(project(":airbyte-config:config-models"))
implementation(project(":airbyte-config:config-persistence"))
implementation(project(":airbyte-config:init"))
implementation(project(":airbyte-json-validation"))
implementation(project(":airbyte-data"))
implementation(project(":airbyte-db:db-lib"))
implementation(project(":airbyte-featureflag"))
implementation(project(":airbyte-metrics:metrics-lib"))
implementation(project(":airbyte-persistence:job-persistence"))
implementation(project(":airbyte-api"))
implementation(project(":airbyte-analytics"))
implementation(project(":airbyte-commons"))
implementation(project(":airbyte-commons-auth"))
implementation(project(":airbyte-commons-micronaut"))
implementation(project(":airbyte-commons-temporal"))
implementation(project(":airbyte-config:config-models"))
implementation(project(":airbyte-config:config-persistence"))
implementation(project(":airbyte-config:init"))
implementation(project(":airbyte-json-validation"))
implementation(project(":airbyte-data"))
implementation(project(":airbyte-db:db-lib"))
implementation(project(":airbyte-featureflag"))
implementation(project(":airbyte-metrics:metrics-lib"))
implementation(project(":airbyte-persistence:job-persistence"))

runtimeOnly(libs.snakeyaml)
runtimeOnly(libs.snakeyaml)

testImplementation(libs.bundles.junit)
testImplementation(libs.mockk)
testImplementation(libs.bundles.junit)
testImplementation(libs.mockk)
}

val env = Properties().apply {
val env =
Properties().apply {
load(rootProject.file(".env.dev").inputStream())
}
}

airbyte {
application {
mainClass = "io.airbyte.cron.MicronautCronRunner"
defaultJvmArgs = listOf("-XX:+ExitOnOutOfMemoryError", "-XX:MaxRAMPercentage=75.0")
@Suppress("UNCHECKED_CAST")
localEnvVars.putAll(env.toMap() as Map<String, String>)
localEnvVars.putAll(mapOf(
"AIRBYTE_ROLE" to (System.getenv("AIRBYTE_ROLE") ?: "undefined"),
"AIRBYTE_VERSION" to env["VERSION"].toString(),
))
}
application {
mainClass = "io.airbyte.cron.MicronautCronRunner"
defaultJvmArgs = listOf("-XX:+ExitOnOutOfMemoryError", "-XX:MaxRAMPercentage=75.0")
@Suppress("UNCHECKED_CAST")
localEnvVars.putAll(env.toMap() as Map<String, String>)
localEnvVars.putAll(
mapOf(
"AIRBYTE_ROLE" to (System.getenv("AIRBYTE_ROLE") ?: "undefined"),
"AIRBYTE_VERSION" to env["VERSION"].toString(),
),
)
}

docker {
imageName = "cron"
}
docker {
imageName = "cron"
}
}

// The DuplicatesStrategy will be required while this module is mixture of kotlin and java _with_ lombok dependencies.)
Expand All @@ -80,5 +83,5 @@ airbyte {
// keepJavacAnnotationProcessors enabled, which causes duplicate META-INF files to be generated.)
// Once lombok has been removed, this can also be removed.)
tasks.withType<Jar>().configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
88 changes: 44 additions & 44 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
pluginManagement {
repositories {
// uncomment for local dev
// maven {
// name = "localPluginRepo"
// url = uri("../.gradle-plugins-local")
// }
maven(url = "https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars")
gradlePluginPortal()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
resolutionStrategy {
eachPlugin {
// We're using the 6.1.0-SNAPSHOT version of openapi-generator which contains a fix for generating nullable arrays (https://github.com/OpenAPITools/openapi-generator/issues/13025)
// The snapshot version isn"t available in the main Gradle Plugin Portal, so we added the Sonatype snapshot repository above.
// The useModule command below allows us to map from the plugin id, `org.openapi.generator`, to the underlying module (https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-gradle-plugin/6.1.0-SNAPSHOT/_
if (requested.id.id == "org.openapi.generator") {
useModule("org.openapitools:openapi-generator-gradle-plugin:${requested.version}")
}
}
repositories {
// uncomment for local dev
// maven {
// name = "localPluginRepo"
// url = uri("../.gradle-plugins-local")
// }
maven(url = "https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars")
gradlePluginPortal()
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
resolutionStrategy {
eachPlugin {
// We're using the 6.1.0-SNAPSHOT version of openapi-generator which contains a fix for generating nullable arrays (https://github.com/OpenAPITools/openapi-generator/issues/13025)
// The snapshot version isn"t available in the main Gradle Plugin Portal, so we added the Sonatype snapshot repository above.
// The useModule command below allows us to map from the plugin id, `org.openapi.generator`, to the underlying module (https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-gradle-plugin/6.1.0-SNAPSHOT/_
if (requested.id.id == "org.openapi.generator") {
useModule("org.openapitools:openapi-generator-gradle-plugin:${requested.version}")
}
}
}
}

// Configure the gradle enterprise plugin to enable build scans. Enabling the plugin at the top of the settings file allows the build scan to record
// as much information as possible.
plugins {
id("com.gradle.enterprise") version "3.15.1"
id("com.github.burrunan.s3-build-cache") version "1.5"
id("com.gradle.enterprise") version "3.15.1"
id("com.github.burrunan.s3-build-cache") version "1.5"
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}

val isCiServer = System.getenv().containsKey("CI")

gradleEnterprise {
buildScan {
isUploadInBackground = !isCiServer // Disable async upload so that the containers doesn't terminate the upload
buildScanPublished {
file("scan-journal.log").writeText("${java.util.Date()} - $buildScanId - ${buildScanUri}\n")
}
buildScan {
isUploadInBackground = !isCiServer // Disable async upload so that the containers doesn't terminate the upload
buildScanPublished {
file("scan-journal.log").writeText("${java.util.Date()} - $buildScanId - ${buildScanUri}\n")
}
}
}

buildCache {
remote<com.github.burrunan.s3cache.AwsS3BuildCache> {
region = "us-west-2"
bucket = "ab-ci-cache"
prefix = "platform-ci-cache/"
isPush = isCiServer
isEnabled = System.getenv().containsKey("S3_BUILD_CACHE_ACCESS_KEY_ID")
}
remote<com.github.burrunan.s3cache.AwsS3BuildCache> {
region = "us-west-2"
bucket = "ab-ci-cache"
prefix = "platform-ci-cache/"
isPush = isCiServer
isEnabled = System.getenv().containsKey("S3_BUILD_CACHE_ACCESS_KEY_ID")
}
}

rootProject.name = "airbyte"

// definition for dependency resolution
dependencyResolutionManagement {
repositories {
maven(url = "https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars/")
}
repositories {
maven(url = "https://airbyte.mycloudrepo.io/public/repositories/airbyte-public-jars/")
}

versionCatalogs {
create("libs") {
from(files("deps.toml"))
}
versionCatalogs {
create("libs") {
from(files("deps.toml"))
}
}
}

// todo (cgardens) - alphabetize
Expand Down

0 comments on commit f3692ad

Please sign in to comment.