Skip to content

Commit

Permalink
Make selekt-sqlite3:amalgamate configuration cache friendly.
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth J. Shackleton <[email protected]>
  • Loading branch information
kennethshackleton committed Jul 15, 2023
1 parent 0a15b65 commit d078d2d
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions selekt-sqlite3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,29 @@ tasks.register<Exec>("configureSqlCipher") {
logging.captureStandardOutput(LogLevel.INFO)
}

tasks.register<Exec>("amalgamate") {
tasks.register("amalgamate") {
dependsOn("amalgamateSQLite", "copySQLiteHeader", "copySQLiteImplementation")
}

tasks.register<Exec>("amalgamateSQLite") {
dependsOn("configureSqlCipher")
workingDir = File("$projectDir/src/main/external/sqlcipher")
commandLine("make")
args("sqlite3.c")
doLast {
copy {
from(workingDir)
include("sqlite3.c")
into("$projectDir/sqlite3/generated/cpp")
}
copy {
from(workingDir)
include("sqlite3.h")
into("$projectDir/sqlite3/generated/include/sqlite3")
}
}
}

tasks.register<Copy>("copySQLiteHeader") {
mustRunAfter("amalgamateSQLite")
from("$projectDir/src/main/external/sqlcipher")
include("sqlite3.h")
into("$projectDir/sqlite3/generated/include/sqlite3")
}

tasks.register<Copy>("copySQLiteImplementation") {
mustRunAfter("amalgamateSQLite")
from("$projectDir/src/main/external/sqlcipher")
include("sqlite3.c")
into("$projectDir/sqlite3/generated/cpp")
}

tasks.register<Exec>("cmakeSQLite") {
Expand Down

0 comments on commit d078d2d

Please sign in to comment.