diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3acb1b7..7376b4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,31 @@ jobs: - name: Run lints run: ./scripts/lint + + build: + timeout-minutes: 15 + name: build + runs-on: ${{ github.repository == 'stainless-sdks/scrapegraphai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + + steps: + - uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 8 + 21 + cache: gradle + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build SDK + run: ./scripts/build + test: timeout-minutes: 15 name: test diff --git a/.gitignore b/.gitignore index 4e81838..b1346e6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ .gradle .idea .kotlin -build +build/ codegen.log kls_database.db diff --git a/.stats.yml b/.stats.yml index 561b1cc..6804ffb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 15 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-969ebada41127057e4cda129b2e7206224743b5c7fd33aa8ae062ff71b775ac9.yml -openapi_spec_hash: 2b2c2c684e6f6885398efca5f2b1f854 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-633fdeab6abaefbe666099e8f86ce6b2acc9dacff1c33a80813bb04e8e437229.yml +openapi_spec_hash: f41ec90694ca8e7233bd20cc7ff1afbf config_hash: 6889576ba0fdc14f2c71cea09a60a0f6 diff --git a/build.gradle.kts b/build.gradle.kts index 365828f..53b3b4a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,6 +12,19 @@ allprojects { version = "0.0.2" // x-release-please-version } +subprojects { + // These are populated with dependencies by `buildSrc` scripts. + tasks.register("format") { + group = "Verification" + description = "Formats all source files." + } + tasks.register("lint") { + group = "Verification" + description = "Verifies all source files are formatted." + } + apply(plugin = "org.jetbrains.dokka") +} + subprojects { apply(plugin = "org.jetbrains.dokka") } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index af99bd1..0b14135 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -8,6 +8,5 @@ repositories { } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20") } diff --git a/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts b/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts index 2f37756..81d5d32 100644 --- a/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts +++ b/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts @@ -1,9 +1,7 @@ -import com.diffplug.gradle.spotless.SpotlessExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { `java-library` - id("com.diffplug.spotless") } repositories { @@ -15,15 +13,6 @@ configure { withSourcesJar() } -configure { - java { - importOrder() - removeUnusedImports() - palantirJavaFormat() - toggleOffOn() - } -} - java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) @@ -62,3 +51,86 @@ tasks.withType().configureEach { exceptionFormat = TestExceptionFormat.FULL } } + +val palantir by configurations.creating +dependencies { + palantir("com.palantir.javaformat:palantir-java-format:2.73.0") +} + +fun registerPalantir( + name: String, + description: String, +) { + val javaName = "${name}Java" + tasks.register(javaName) { + group = "Verification" + this.description = description + + classpath = palantir + mainClass = "com.palantir.javaformat.java.Main" + + // Avoid an `IllegalAccessError` on Java 9+. + jvmArgs( + "--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ) + + // Use paths relative to the current module. + val argumentFile = + project.layout.buildDirectory.file("palantir-$name-args.txt").get().asFile + val lastRunTimeFile = + project.layout.buildDirectory.file("palantir-$name-last-run.txt").get().asFile + + // Read the time when this task was last executed for this module (if ever). + val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L + + // Use a `fileTree` relative to the module's source directory. + val javaFiles = project.fileTree("src") { include("**/*.java") } + + // Determine if any files need to be formatted or linted and continue only if there is at least + // one file. + onlyIf { javaFiles.any { it.lastModified() > lastRunTime } } + + inputs.files(javaFiles) + + doFirst { + // Create the argument file and set the preferred formatting style. + argumentFile.parentFile.mkdirs() + argumentFile.writeText("--palantir\n") + + if (name == "lint") { + // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of + // the default 0) if any files need to be formatted, indicating that linting has failed. + argumentFile.appendText("--dry-run\n") + argumentFile.appendText("--set-exit-if-changed\n") + } else { + // `--dry-run` and `--replace` (for in-place formatting) are mutually exclusive. + argumentFile.appendText("--replace\n") + } + + // Write the modified files to the argument file. + javaFiles.filter { it.lastModified() > lastRunTime } + .forEach { argumentFile.appendText("${it.absolutePath}\n") } + } + + doLast { + // Record the last execution time for later up-to-date checking. + lastRunTimeFile.writeText(System.currentTimeMillis().toString()) + } + + // Pass the argument file using the @ symbol + args = listOf("@${argumentFile.absolutePath}") + + outputs.upToDateWhen { javaFiles.none { it.lastModified() > lastRunTime } } + } + + tasks.named(name) { + dependsOn(tasks.named(javaName)) + } +} + +registerPalantir(name = "format", description = "Formats all Java source files.") +registerPalantir(name = "lint", description = "Verifies all Java source files are formatted.") diff --git a/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts b/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts index 8c797cc..0505677 100644 --- a/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts @@ -1,4 +1,3 @@ -import com.diffplug.gradle.spotless.SpotlessExtension import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion @@ -7,6 +6,10 @@ plugins { kotlin("jvm") } +repositories { + mavenCentral() +} + kotlin { jvmToolchain { languageVersion.set(JavaLanguageVersion.of(21)) @@ -27,14 +30,77 @@ kotlin { } } -configure { - kotlin { - ktfmt().kotlinlangStyle() - toggleOffOn() - } -} - tasks.withType().configureEach { systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent") } + +val ktfmt by configurations.creating +dependencies { + ktfmt("com.facebook:ktfmt:0.56") +} + +fun registerKtfmt( + name: String, + description: String, +) { + val kotlinName = "${name}Kotlin" + tasks.register(kotlinName) { + group = "Verification" + this.description = description + + classpath = ktfmt + mainClass = "com.facebook.ktfmt.cli.Main" + + // Use paths relative to the current module. + val argumentFile = project.layout.buildDirectory.file("ktfmt-$name-args.txt").get().asFile + val lastRunTimeFile = + project.layout.buildDirectory.file("ktfmt-$name-last-run.txt").get().asFile + + // Read the time when this task was last executed for this module (if ever). + val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L + + // Use a `fileTree` relative to the module's source directory. + val kotlinFiles = project.fileTree("src") { include("**/*.kt") } + + // Determine if any files need to be formatted or linted and continue only if there is at least + // one file (otherwise Ktfmt will fail). + onlyIf { kotlinFiles.any { it.lastModified() > lastRunTime } } + + inputs.files(kotlinFiles) + + doFirst { + // Create the argument file and set the preferred formatting style. + argumentFile.parentFile.mkdirs() + argumentFile.writeText("--kotlinlang-style\n") + + if (name == "lint") { + // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of + // the default 0) if any files need to be formatted, indicating that linting has failed. + argumentFile.appendText("--dry-run\n") + argumentFile.appendText("--set-exit-if-changed\n") + } + + // Write the modified files to the argument file. + kotlinFiles.filter { it.lastModified() > lastRunTime } + .forEach { argumentFile.appendText("${it.absolutePath}\n") } + } + + doLast { + // Record the last execution time for later up-to-date checking. + lastRunTimeFile.writeText(System.currentTimeMillis().toString()) + } + + // Pass the argument file using the @ symbol + args = listOf("@${argumentFile.absolutePath}") + + outputs.upToDateWhen { kotlinFiles.none { it.lastModified() > lastRunTime } } + } + + tasks.named(name) { + dependsOn(tasks.named(kotlinName)) + } +} + +registerKtfmt(name = "format", description = "Formats all Kotlin source files.") +registerKtfmt(name = "lint", description = "Verifies all Kotlin source files are formatted.") diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt index 389a8b9..26d5c9f 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt @@ -103,7 +103,7 @@ class ScrapegraphaiClientAsyncImpl(private val clientOptions: ClientOptions) : override fun healthz(): HealthzServiceAsync = healthz - override fun close() = clientOptions.httpClient.close() + override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScrapegraphaiClientAsync.WithRawResponse { diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt index a9fb4e5..9f6a3da 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt @@ -98,7 +98,7 @@ class ScrapegraphaiClientImpl(private val clientOptions: ClientOptions) : Scrape override fun healthz(): HealthzService = healthz - override fun close() = clientOptions.httpClient.close() + override fun close() = clientOptions.close() class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : ScrapegraphaiClient.WithRawResponse { diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt index 16cc411..63c29ae 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt @@ -21,6 +21,8 @@ private constructor( * The HTTP client to use in the SDK. * * Use the one published in `scrapegraphai-java-client-okhttp` or implement your own. + * + * This class takes ownership of the client and closes it when closed. */ @get:JvmName("httpClient") val httpClient: HttpClient, /** @@ -162,6 +164,8 @@ private constructor( * The HTTP client to use in the SDK. * * Use the one published in `scrapegraphai-java-client-okhttp` or implement your own. + * + * This class takes ownership of the client and closes it when closed. */ fun httpClient(httpClient: HttpClient) = apply { this.httpClient = PhantomReachableClosingHttpClient(httpClient) @@ -413,4 +417,18 @@ private constructor( ) } } + + /** + * Closes these client options, relinquishing any underlying resources. + * + * This is purposefully not inherited from [AutoCloseable] because the client options are + * long-lived and usually should not be synchronously closed via try-with-resources. + * + * It's also usually not necessary to call this method at all. the default client automatically + * releases threads and connections if they remain idle, but if you are writing an application + * that needs to aggressively release unused resources, then you may call this method. + */ + fun close() { + httpClient.close() + } } diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt new file mode 100644 index 0000000..401e601 --- /dev/null +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt @@ -0,0 +1,58 @@ +package com.scrapegraphai.api.core + +import java.util.concurrent.Callable +import java.util.concurrent.ExecutorService +import java.util.concurrent.Future +import java.util.concurrent.TimeUnit + +/** + * A delegating wrapper around an [ExecutorService] that shuts it down once it's only phantom + * reachable. + * + * This class ensures the [ExecutorService] is shut down even if the user forgets to do it. + */ +internal class PhantomReachableExecutorService(private val executorService: ExecutorService) : + ExecutorService { + init { + closeWhenPhantomReachable(this) { executorService.shutdown() } + } + + override fun execute(command: Runnable) = executorService.execute(command) + + override fun shutdown() = executorService.shutdown() + + override fun shutdownNow(): MutableList = executorService.shutdownNow() + + override fun isShutdown(): Boolean = executorService.isShutdown + + override fun isTerminated(): Boolean = executorService.isTerminated + + override fun awaitTermination(timeout: Long, unit: TimeUnit): Boolean = + executorService.awaitTermination(timeout, unit) + + override fun submit(task: Callable): Future = executorService.submit(task) + + override fun submit(task: Runnable, result: T): Future = + executorService.submit(task, result) + + override fun submit(task: Runnable): Future<*> = executorService.submit(task) + + override fun invokeAll( + tasks: MutableCollection> + ): MutableList> = executorService.invokeAll(tasks) + + override fun invokeAll( + tasks: MutableCollection>, + timeout: Long, + unit: TimeUnit, + ): MutableList> = executorService.invokeAll(tasks, timeout, unit) + + override fun invokeAny(tasks: MutableCollection>): T = + executorService.invokeAny(tasks) + + override fun invokeAny( + tasks: MutableCollection>, + timeout: Long, + unit: TimeUnit, + ): T = executorService.invokeAny(tasks, timeout, unit) +} diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt index fdc209d..b9469fe 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt @@ -157,10 +157,14 @@ private constructor( return true } - return /* spotless:off */ other is Timeout && connect == other.connect && read == other.read && write == other.write && request == other.request /* spotless:on */ + return other is Timeout && + connect == other.connect && + read == other.read && + write == other.write && + request == other.request } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(connect, read, write, request) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(connect, read, write, request) override fun toString() = "Timeout{connect=$connect, read=$read, write=$write, request=$request}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt index caf81a9..12211cc 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt @@ -182,10 +182,13 @@ private constructor( return true } - return /* spotless:off */ other is CrawlRetrieveResultsParams && taskId == other.taskId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is CrawlRetrieveResultsParams && + taskId == other.taskId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(taskId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(taskId, additionalHeaders, additionalQueryParams) override fun toString() = "CrawlRetrieveResultsParams{taskId=$taskId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt index bb9abd5..aa77b27 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt @@ -342,10 +342,10 @@ private constructor( return true } - return /* spotless:off */ other is Result && jsonValue == other.jsonValue && string == other.string /* spotless:on */ + return other is Result && jsonValue == other.jsonValue && string == other.string } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(jsonValue, string) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(jsonValue, string) override fun toString(): String = when { @@ -578,7 +578,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -591,12 +591,17 @@ private constructor( return true } - return /* spotless:off */ other is CrawlRetrieveResultsResponse && result == other.result && status == other.status && taskId == other.taskId && traceback == other.traceback && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CrawlRetrieveResultsResponse && + result == other.result && + status == other.status && + taskId == other.taskId && + traceback == other.traceback && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(result, status, taskId, traceback, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(result, status, taskId, traceback, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt index ad5dcef..6d99e87 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt @@ -865,12 +865,33 @@ private constructor( return true } - return /* spotless:off */ other is Body && url == other.url && depth == other.depth && extractionMode == other.extractionMode && maxPages == other.maxPages && prompt == other.prompt && renderHeavyJs == other.renderHeavyJs && rules == other.rules && schema == other.schema && sitemap == other.sitemap && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + url == other.url && + depth == other.depth && + extractionMode == other.extractionMode && + maxPages == other.maxPages && + prompt == other.prompt && + renderHeavyJs == other.renderHeavyJs && + rules == other.rules && + schema == other.schema && + sitemap == other.sitemap && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(url, depth, extractionMode, maxPages, prompt, renderHeavyJs, rules, schema, sitemap, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + url, + depth, + extractionMode, + maxPages, + prompt, + renderHeavyJs, + rules, + schema, + sitemap, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1065,12 +1086,15 @@ private constructor( return true } - return /* spotless:off */ other is Rules && exclude == other.exclude && sameDomain == other.sameDomain && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Rules && + exclude == other.exclude && + sameDomain == other.sameDomain && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(exclude, sameDomain, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(exclude, sameDomain, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -1083,10 +1107,13 @@ private constructor( return true } - return /* spotless:off */ other is CrawlStartParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is CrawlStartParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "CrawlStartParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt index d1fe021..562f589 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt @@ -141,12 +141,12 @@ private constructor( return true } - return /* spotless:off */ other is CrawlStartResponse && taskId == other.taskId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CrawlStartResponse && + taskId == other.taskId && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(taskId, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt index 9e67ba1..c3713d7 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt @@ -158,10 +158,12 @@ private constructor( return true } - return /* spotless:off */ other is CreditRetrieveParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is CreditRetrieveParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = "CreditRetrieveParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt index 4cc086f..220c310 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt @@ -197,12 +197,15 @@ private constructor( return true } - return /* spotless:off */ other is CreditRetrieveResponse && remainingCredits == other.remainingCredits && totalCreditsUsed == other.totalCreditsUsed && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CreditRetrieveResponse && + remainingCredits == other.remainingCredits && + totalCreditsUsed == other.totalCreditsUsed && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(remainingCredits, totalCreditsUsed, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(remainingCredits, totalCreditsUsed, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt index 1f44b55..e9dd112 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt @@ -537,12 +537,16 @@ private constructor( return true } - return /* spotless:off */ other is Body && rating == other.rating && requestId == other.requestId && feedbackText == other.feedbackText && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + rating == other.rating && + requestId == other.requestId && + feedbackText == other.feedbackText && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(rating, requestId, feedbackText, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(rating, requestId, feedbackText, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -555,10 +559,13 @@ private constructor( return true } - return /* spotless:off */ other is FeedbackSubmitParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is FeedbackSubmitParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "FeedbackSubmitParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt index 15653ce..c6546de 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt @@ -248,12 +248,17 @@ private constructor( return true } - return /* spotless:off */ other is FeedbackSubmitResponse && feedbackId == other.feedbackId && feedbackTimestamp == other.feedbackTimestamp && message == other.message && requestId == other.requestId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is FeedbackSubmitResponse && + feedbackId == other.feedbackId && + feedbackTimestamp == other.feedbackTimestamp && + message == other.message && + requestId == other.requestId && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(feedbackId, feedbackTimestamp, message, requestId, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(feedbackId, feedbackTimestamp, message, requestId, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt index 547dd12..19bc74a 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt @@ -420,12 +420,15 @@ private constructor( return true } - return /* spotless:off */ other is Body && userPrompt == other.userPrompt && existingSchema == other.existingSchema && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + userPrompt == other.userPrompt && + existingSchema == other.existingSchema && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(userPrompt, existingSchema, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(userPrompt, existingSchema, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -438,10 +441,13 @@ private constructor( return true } - return /* spotless:off */ other is GenerateSchemaCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is GenerateSchemaCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "GenerateSchemaCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt index 1cce93c..f901b70 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt @@ -409,7 +409,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -422,12 +422,27 @@ private constructor( return true } - return /* spotless:off */ other is GenerateSchemaCreateResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is GenerateSchemaCreateResponse && + error == other.error && + generatedSchema == other.generatedSchema && + refinedPrompt == other.refinedPrompt && + requestId == other.requestId && + status == other.status && + userPrompt == other.userPrompt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + error, + generatedSchema, + refinedPrompt, + requestId, + status, + userPrompt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt index c4396a3..bb08721 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt @@ -182,10 +182,13 @@ private constructor( return true } - return /* spotless:off */ other is GenerateSchemaRetrieveParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is GenerateSchemaRetrieveParams && + requestId == other.requestId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams) override fun toString() = "GenerateSchemaRetrieveParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt index ccc296d..ed0a5f6 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt @@ -123,10 +123,12 @@ private constructor( return true } - return /* spotless:off */ other is GenerateSchemaRetrieveResponse && completedSchemaGeneration == other.completedSchemaGeneration && failedSchemaGeneration == other.failedSchemaGeneration /* spotless:on */ + return other is GenerateSchemaRetrieveResponse && + completedSchemaGeneration == other.completedSchemaGeneration && + failedSchemaGeneration == other.failedSchemaGeneration } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSchemaGeneration, failedSchemaGeneration) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(completedSchemaGeneration, failedSchemaGeneration) override fun toString(): String = when { @@ -643,7 +645,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -656,12 +658,27 @@ private constructor( return true } - return /* spotless:off */ other is CompletedSchemaGenerationResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompletedSchemaGenerationResponse && + error == other.error && + generatedSchema == other.generatedSchema && + refinedPrompt == other.refinedPrompt && + requestId == other.requestId && + status == other.status && + userPrompt == other.userPrompt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + error, + generatedSchema, + refinedPrompt, + requestId, + status, + userPrompt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1079,7 +1096,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -1092,12 +1109,27 @@ private constructor( return true } - return /* spotless:off */ other is FailedSchemaGenerationResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is FailedSchemaGenerationResponse && + error == other.error && + generatedSchema == other.generatedSchema && + refinedPrompt == other.refinedPrompt && + requestId == other.requestId && + status == other.status && + userPrompt == other.userPrompt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + error, + generatedSchema, + refinedPrompt, + requestId, + status, + userPrompt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt index aec4a7f..e642d48 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt @@ -158,10 +158,12 @@ private constructor( return true } - return /* spotless:off */ other is HealthzCheckParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is HealthzCheckParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = "HealthzCheckParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt index 9112276..d87b8ff 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt @@ -256,12 +256,10 @@ private constructor( return true } - return /* spotless:off */ other is Services && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Services && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -273,12 +271,13 @@ private constructor( return true } - return /* spotless:off */ other is HealthzCheckResponse && services == other.services && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + return other is HealthzCheckResponse && + services == other.services && + status == other.status && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(services, status, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt index b26c1c8..26760c1 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt @@ -395,7 +395,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -408,12 +408,18 @@ private constructor( return true } - return /* spotless:off */ other is CompletedMarkdownify && error == other.error && requestId == other.requestId && result == other.result && status == other.status && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompletedMarkdownify && + error == other.error && + requestId == other.requestId && + result == other.result && + status == other.status && + websiteUrl == other.websiteUrl && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt index aafcdcc..ab6e7c2 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt @@ -535,12 +535,16 @@ private constructor( return true } - return /* spotless:off */ other is Body && websiteUrl == other.websiteUrl && headers == other.headers && steps == other.steps && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + websiteUrl == other.websiteUrl && + headers == other.headers && + steps == other.steps && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(websiteUrl, headers, steps, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(websiteUrl, headers, steps, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -637,12 +641,10 @@ private constructor( return true } - return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Headers && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -654,10 +656,13 @@ private constructor( return true } - return /* spotless:off */ other is MarkdownifyConvertParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is MarkdownifyConvertParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "MarkdownifyConvertParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt index 5c1b65b..5a0e03b 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt @@ -185,10 +185,13 @@ private constructor( return true } - return /* spotless:off */ other is MarkdownifyRetrieveStatusParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is MarkdownifyRetrieveStatusParams && + requestId == other.requestId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams) override fun toString() = "MarkdownifyRetrieveStatusParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt index f552cb4..9234902 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt @@ -115,10 +115,12 @@ private constructor( return true } - return /* spotless:off */ other is MarkdownifyRetrieveStatusResponse && completedMarkdownify == other.completedMarkdownify && failedMarkdownify == other.failedMarkdownify /* spotless:on */ + return other is MarkdownifyRetrieveStatusResponse && + completedMarkdownify == other.completedMarkdownify && + failedMarkdownify == other.failedMarkdownify } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedMarkdownify, failedMarkdownify) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(completedMarkdownify, failedMarkdownify) override fun toString(): String = when { @@ -599,7 +601,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -612,12 +614,18 @@ private constructor( return true } - return /* spotless:off */ other is FailedMarkdownifyResponse && error == other.error && requestId == other.requestId && result == other.result && status == other.status && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return other is FailedMarkdownifyResponse && + error == other.error && + requestId == other.requestId && + result == other.result && + status == other.status && + websiteUrl == other.websiteUrl && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt index 30dc9c0..86484ff 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt @@ -466,7 +466,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -479,12 +479,29 @@ private constructor( return true } - return /* spotless:off */ other is CompletedSearchScraper && error == other.error && numResults == other.numResults && referenceUrls == other.referenceUrls && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompletedSearchScraper && + error == other.error && + numResults == other.numResults && + referenceUrls == other.referenceUrls && + requestId == other.requestId && + result == other.result && + status == other.status && + userPrompt == other.userPrompt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, numResults, referenceUrls, requestId, result, status, userPrompt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + error, + numResults, + referenceUrls, + requestId, + result, + status, + userPrompt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt index 1298623..a9c5cec 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt @@ -537,12 +537,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && userPrompt == other.userPrompt && headers == other.headers && numResults == other.numResults && outputSchema == other.outputSchema && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + userPrompt == other.userPrompt && + headers == other.headers && + numResults == other.numResults && + outputSchema == other.outputSchema && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(userPrompt, headers, numResults, outputSchema, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(userPrompt, headers, numResults, outputSchema, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -639,12 +644,10 @@ private constructor( return true } - return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Headers && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -656,10 +659,13 @@ private constructor( return true } - return /* spotless:off */ other is SearchscraperCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is SearchscraperCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "SearchscraperCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt index 1e8c091..8fe6310 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt @@ -185,10 +185,13 @@ private constructor( return true } - return /* spotless:off */ other is SearchscraperRetrieveStatusParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is SearchscraperRetrieveStatusParams && + requestId == other.requestId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams) override fun toString() = "SearchscraperRetrieveStatusParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt index aa8a8ac..65c7697 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt @@ -124,10 +124,12 @@ private constructor( return true } - return /* spotless:off */ other is SearchscraperRetrieveStatusResponse && completedSearchScraper == other.completedSearchScraper && failedSearchScraper == other.failedSearchScraper /* spotless:on */ + return other is SearchscraperRetrieveStatusResponse && + completedSearchScraper == other.completedSearchScraper && + failedSearchScraper == other.failedSearchScraper } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSearchScraper, failedSearchScraper) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(completedSearchScraper, failedSearchScraper) override fun toString(): String = when { @@ -681,7 +683,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -694,12 +696,29 @@ private constructor( return true } - return /* spotless:off */ other is FailedSearchScraperResponse && error == other.error && numResults == other.numResults && referenceUrls == other.referenceUrls && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is FailedSearchScraperResponse && + error == other.error && + numResults == other.numResults && + referenceUrls == other.referenceUrls && + requestId == other.requestId && + result == other.result && + status == other.status && + userPrompt == other.userPrompt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, numResults, referenceUrls, requestId, result, status, userPrompt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + error, + numResults, + referenceUrls, + requestId, + result, + status, + userPrompt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt index 9735224..341c834 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt @@ -416,7 +416,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -429,12 +429,19 @@ private constructor( return true } - return /* spotless:off */ other is CompletedSmartscraper && error == other.error && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompletedSmartscraper && + error == other.error && + requestId == other.requestId && + result == other.result && + status == other.status && + userPrompt == other.userPrompt && + websiteUrl == other.websiteUrl && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt index 6f4d8be..db323eb 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt @@ -395,7 +395,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -408,12 +408,19 @@ private constructor( return true } - return /* spotless:off */ other is FailedSmartscraper && error == other.error && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return other is FailedSmartscraper && + error == other.error && + requestId == other.requestId && + result == other.result && + status == other.status && + userPrompt == other.userPrompt && + websiteUrl == other.websiteUrl && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) + } override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt index b09d5c5..ab7cd14 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt @@ -975,12 +975,35 @@ private constructor( return true } - return /* spotless:off */ other is Body && userPrompt == other.userPrompt && cookies == other.cookies && headers == other.headers && numberOfScrolls == other.numberOfScrolls && outputSchema == other.outputSchema && renderHeavyJs == other.renderHeavyJs && steps == other.steps && totalPages == other.totalPages && websiteHtml == other.websiteHtml && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + userPrompt == other.userPrompt && + cookies == other.cookies && + headers == other.headers && + numberOfScrolls == other.numberOfScrolls && + outputSchema == other.outputSchema && + renderHeavyJs == other.renderHeavyJs && + steps == other.steps && + totalPages == other.totalPages && + websiteHtml == other.websiteHtml && + websiteUrl == other.websiteUrl && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(userPrompt, cookies, headers, numberOfScrolls, outputSchema, renderHeavyJs, steps, totalPages, websiteHtml, websiteUrl, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + userPrompt, + cookies, + headers, + numberOfScrolls, + outputSchema, + renderHeavyJs, + steps, + totalPages, + websiteHtml, + websiteUrl, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1078,12 +1101,10 @@ private constructor( return true } - return /* spotless:off */ other is Cookies && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Cookies && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1180,12 +1201,10 @@ private constructor( return true } - return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Headers && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1197,10 +1216,13 @@ private constructor( return true } - return /* spotless:off */ other is SmartscraperCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is SmartscraperCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "SmartscraperCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt index 740f197..bfe95ea 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt @@ -158,10 +158,12 @@ private constructor( return true } - return /* spotless:off */ other is SmartscraperListParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is SmartscraperListParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = "SmartscraperListParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt index fa068b1..28d498b 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt @@ -108,10 +108,12 @@ private constructor( return true } - return /* spotless:off */ other is SmartscraperListResponse && completedSmartscraper == other.completedSmartscraper && failedSmartscraper == other.failedSmartscraper /* spotless:on */ + return other is SmartscraperListResponse && + completedSmartscraper == other.completedSmartscraper && + failedSmartscraper == other.failedSmartscraper } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSmartscraper, failedSmartscraper) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(completedSmartscraper, failedSmartscraper) override fun toString(): String = when { diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt index 20eb68f..e85ca95 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt @@ -182,10 +182,13 @@ private constructor( return true } - return /* spotless:off */ other is SmartscraperRetrieveParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is SmartscraperRetrieveParams && + requestId == other.requestId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams) override fun toString() = "SmartscraperRetrieveParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt index c9e93d2..d0e37e7 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt @@ -108,10 +108,12 @@ private constructor( return true } - return /* spotless:off */ other is SmartscraperRetrieveResponse && completedSmartscraper == other.completedSmartscraper && failedSmartscraper == other.failedSmartscraper /* spotless:on */ + return other is SmartscraperRetrieveResponse && + completedSmartscraper == other.completedSmartscraper && + failedSmartscraper == other.failedSmartscraper } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSmartscraper, failedSmartscraper) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(completedSmartscraper, failedSmartscraper) override fun toString(): String = when { diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt index 1ebc3e6..03ef3ce 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt @@ -158,10 +158,12 @@ private constructor( return true } - return /* spotless:off */ other is ValidateApiKeyParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is ValidateApiKeyParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = "ValidateApiKeyParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt index 56a55cb..ed0f4dd 100644 --- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt +++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt @@ -138,12 +138,12 @@ private constructor( return true } - return /* spotless:off */ other is ValidateApiKeyResponse && email == other.email && additionalProperties == other.additionalProperties /* spotless:on */ + return other is ValidateApiKeyResponse && + email == other.email && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(email, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode diff --git a/scrapegraphai-java-proguard-test/build.gradle.kts b/scrapegraphai-java-proguard-test/build.gradle.kts index 4263540..5692fa8 100644 --- a/scrapegraphai-java-proguard-test/build.gradle.kts +++ b/scrapegraphai-java-proguard-test/build.gradle.kts @@ -37,8 +37,6 @@ val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) { outjars(proguardJarPath) printmapping("${layout.buildDirectory.get()}/proguard-mapping.txt") - dontwarn() - val javaHome = System.getProperty("java.home") if (System.getProperty("java.version").startsWith("1.")) { // Before Java 9, the runtime classes were packaged in a single jar file. diff --git a/scrapegraphai-java-proguard-test/test.pro b/scrapegraphai-java-proguard-test/test.pro index 85644d1..f0afc79 100644 --- a/scrapegraphai-java-proguard-test/test.pro +++ b/scrapegraphai-java-proguard-test/test.pro @@ -5,4 +5,5 @@ -keep class org.junit.** { *; } # Many warnings don't apply for our testing purposes. +-dontnote -dontwarn \ No newline at end of file diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..f406348 --- /dev/null +++ b/scripts/build @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Building classes" +./gradlew build testClasses -x test diff --git a/scripts/format b/scripts/format index 456a69d..65db176 100755 --- a/scripts/format +++ b/scripts/format @@ -4,5 +4,18 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running spotlessApply" -./gradlew spotlessApply +if command -v ktfmt &> /dev/null; then + echo "==> Running ktfmt" + ./scripts/kotlin-format +else + echo "==> Running gradlew formatKotlin" + ./gradlew formatKotlin +fi + +if command -v palantir-java-format &> /dev/null; then + echo "==> Running palantir-java-format" + ./scripts/java-format +else + echo "==> Running gradlew formatJava" + ./gradlew formatJava +fi diff --git a/scripts/java-format b/scripts/java-format new file mode 100755 index 0000000..ad5febc --- /dev/null +++ b/scripts/java-format @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +find . -name "*.java" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r palantir-java-format --palantir --replace "$@" diff --git a/scripts/kotlin-format b/scripts/kotlin-format new file mode 100755 index 0000000..3b8be9e --- /dev/null +++ b/scripts/kotlin-format @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +find . -name "*.kt" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r ktfmt --kotlinlang-style "$@" diff --git a/scripts/lint b/scripts/lint index e3a5f5e..dbc8f77 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,5 +4,20 @@ set -e cd "$(dirname "$0")/.." -echo "==> Build classes" -./gradlew build testClasses -x test +echo "==> Running lints" + +if command -v ktfmt &> /dev/null; then + echo "==> Checking ktfmt" + ./scripts/kotlin-format --dry-run --set-exit-if-changed +else + echo "==> Running gradlew lintKotlin" + ./gradlew lintKotlin +fi + +if command -v palantir-java-format &> /dev/null; then + echo "==> Checking palantir-java-format" + ./scripts/java-format --dry-run --set-exit-if-changed +else + echo "==> Running gradlew lintJava" + ./gradlew lintJava +fi diff --git a/scripts/test b/scripts/test index 2177cb8..047bc1d 100755 --- a/scripts/test +++ b/scripts/test @@ -53,4 +53,4 @@ else fi echo "==> Running tests" -./gradlew test +./gradlew test "$@" diff --git a/settings.gradle.kts b/settings.gradle.kts index e2941f7..2043e76 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,14 @@ rootProject.name = "scrapegraphai-java-root" -include("scrapegraphai-java") -include("scrapegraphai-java-client-okhttp") -include("scrapegraphai-java-core") -include("scrapegraphai-java-proguard-test") -include("scrapegraphai-java-example") +val projectNames = rootDir.listFiles() + ?.asSequence() + .orEmpty() + .filter { file -> + file.isDirectory && + file.name.startsWith("scrapegraphai-java") && + file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" } + } + .map { it.name } + .toList() +println("projects: $projectNames") +projectNames.forEach { include(it) }