Skip to content

Commit

Permalink
Use release binaries by default (#5)
Browse files Browse the repository at this point in the history
Not specifying `-Pleveldb.relsase` parameter to the build now will default to `true` instead of `false`.

* Set default release mode to true

Previously, the release mode was conditionally set to true based on a project property. This update changes the default behavior to ensure release mode is true if the property is not explicitly defined. This makes the build process more robust by preventing unintended defaults when the property is omitted.

* Add explicit return type to batch function

This change specifies the return type of the `batch` function as `Unit`, enhancing code clarity and consistency. Though Kotlin infers return types, explicitly defining `Unit` aligns with best practices and helps with maintaining uniform code style across the project.
  • Loading branch information
lamba92 authored Dec 6, 2024
1 parent eea3e65 commit 00a4be6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion buildSrc/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ fun Project.registerExtractLevelDbTask(
destinationDir: Provider<Directory>,
isRelease: Boolean = project.properties["leveldb.release"]
?.let { it as? String }
?.toBooleanStrictOrNull() == true
?.toBooleanStrictOrNull()
?: true
) = tasks.registering(Sync::class) {
dependsOn(downloadLeveDBBinaries)
strategies.forEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package com.github.lamba92.leveldb
public inline fun LevelDB.batch(
sync: Boolean = false,
builder: LevelDBBatchBuilder.() -> Unit,
) = batch(buildLevelDBBatch(builder), sync)
): Unit = batch(buildLevelDBBatch(builder), sync)

/**
* Constructs and builds a batch operation for LevelDB using a customizable builder.
Expand Down

0 comments on commit 00a4be6

Please sign in to comment.