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

Gradle 8.3. #470

Merged
merged 2 commits into from
Sep 9, 2023
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
15 changes: 8 additions & 7 deletions OpenSSL/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ val openSslBaseUrl = "https://www.openssl.org/source"
fun Project.openSslUrl() = "$openSslBaseUrl/openssl-${openSslVersion()}.tar.gz"
fun Project.openSslPgpUrl() = "$openSslBaseUrl/openssl-${openSslVersion()}.tar.gz.asc"

val archive = File("$buildDir/tmp/openssl-${openSslVersion()}.tar.gz")
val archive = File("${layout.buildDirectory.get()}/tmp/openssl-${openSslVersion()}.tar.gz")
val archivePgp = File("${archive.path}.asc")

tasks.register<Download>("downloadOpenSslPgp") {
Expand Down Expand Up @@ -83,14 +83,14 @@ tasks.register<Exec>("verifyOpenSslSignature") {
}

fun openSslWorkingDir(target: String) = archive.run {
File("$buildDir/generated/$target/${name.substringBefore(".tar.gz")}")
File("${layout.buildDirectory.get()}/generated/$target/${name.substringBefore(".tar.gz")}")
}.path

arrayOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64").forEach {
val titleCaseName = it.replaceFirstChar { c -> c.uppercaseChar() }
tasks.register<Copy>("unpackOpenSsl$titleCaseName") {
from(tarTree(archive))
into("$buildDir/generated/$it")
into("${layout.buildDirectory.get()}/generated/$it")
dependsOn("downloadOpenSsl")
}

Expand All @@ -100,12 +100,13 @@ arrayOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64").forEach {
inputs.property("version", openSslVersion())
outputs.files(fileTree("${openSslWorkingDir(it)}/include") { include("**/*.h") })
.withPropertyName("headers")
outputs.dir("$buildDir/libs/$it").withPropertyName("lib")
outputs.dir("${layout.buildDirectory.get()}/libs/$it").withPropertyName("lib")
outputs.cacheIf { true }
workingDir(projectDir)
commandLine("./build_libraries.sh")
args(
archive.run { File("$buildDir/generated/$it/${name.substringBefore(".tar.gz")}") }.path,
archive.run { File("${layout.buildDirectory.get()}/generated" +
"/$it/${name.substringBefore(".tar.gz")}") }.path,
it,
21
)
Expand Down Expand Up @@ -134,7 +135,7 @@ val openSslWorkingDir: String = openSslWorkingDir(targetIdentifier())
// FIXME Some of the host building logic parallels Android's above. Re-purpose?
tasks.register<Copy>("unpackOpenSslHost") {
from(tarTree(archive))
into("$buildDir/generated/${targetIdentifier()}")
into("${layout.buildDirectory.get()}/generated/${targetIdentifier()}")
dependsOn("downloadOpenSsl")
mustRunAfter("clean")
}
Expand Down Expand Up @@ -171,7 +172,7 @@ tasks.register<Copy>("assembleHost") {
dependsOn("makeHost")
inputs.property("target", targetIdentifier())
inputs.property("version", openSslVersion())
val outputDir = "$buildDir/libs/${targetIdentifier()}"
val outputDir = "${layout.buildDirectory.get()}/libs/${targetIdentifier()}"
outputs.dir(outputDir).withPropertyName("libs")
outputs.cacheIf { true }
from(fileTree(openSslWorkingDir) {
Expand Down
2 changes: 1 addition & 1 deletion Selektric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ tasks.register<Copy>("copyLibraries") {
from(fileTree(".cxx-host") {
include("**/*.dll", "**/*.dylib", "**/*.so")
})
into("$buildDir/intermediates/libs/${platformIdentifier()}")
into("${layout.buildDirectory.get()}/intermediates/libs/${platformIdentifier()}")
}

tasks.register<Delete>("deleteCxxHost") {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=7c3ad722e9b0ce8205b91560fd6ce8296ac3eadf065672242fd73c06b8eeb6ee
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
distributionSha256Sum=bb09982fdf52718e4c7b25023d10df6d35a5fff969860bdf5a5bd27a3ab27a9e
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
9 changes: 5 additions & 4 deletions selekt-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ repositories {

android {
compileSdk = Versions.ANDROID_SDK.version.toInt()
@Suppress("UnstableApiUsage")
buildToolsVersion = Versions.ANDROID_BUILD_TOOLS.version
namespace = "com.bloomberg.selekt.android"
defaultConfig {
Expand All @@ -51,7 +52,7 @@ android {
arrayOf("debug", "main", "release", "test").forEach {
sourceSets[it].java.srcDir("src/$it/kotlin")
}
sourceSets["test"].resources.srcDir("$buildDir/intermediates/libs")
sourceSets["test"].resources.srcDir("${layout.buildDirectory.get()}/intermediates/libs")
publishing {
singleVariant("release") {
withJavadocJar()
Expand Down Expand Up @@ -91,10 +92,10 @@ koverReport {

tasks.register<Copy>("copyJniLibs") {
from(
fileTree("${project(":selekt-sqlite3").buildDir.absolutePath}/intermediates/libs"),
fileTree("${project(":Selektric").buildDir.absolutePath}/intermediates/libs")
fileTree("${project(":selekt-sqlite3").layout.buildDirectory.get()}/intermediates/libs"),
fileTree("${project(":Selektric").layout.buildDirectory.get()}/intermediates/libs")
)
into("${buildDir.path}/intermediates/libs/jni")
into("${layout.buildDirectory.get()}/intermediates/libs/jni")
}

tasks.register<Task>("buildNativeHost") {
Expand Down
6 changes: 3 additions & 3 deletions selekt-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sourceSets {
create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
resources.srcDir("$buildDir/intermediates/libs")
resources.srcDir("${layout.buildDirectory.get()}/intermediates/libs")
}
}

Expand Down Expand Up @@ -88,8 +88,8 @@ tasks.register<Task>("buildHostSQLite") {
}

tasks.register<Copy>("copyJniLibs") {
from(fileTree("${project(":selekt-sqlite3").buildDir}/intermediates/libs"))
into("${buildDir.path}/intermediates/libs/jni")
from(fileTree("${project(":selekt-sqlite3").layout.buildDirectory.get()}/intermediates/libs"))
into("${layout.buildDirectory.get()}/intermediates/libs/jni")
}

tasks.withType<ProcessResources>().configureEach {
Expand Down
2 changes: 1 addition & 1 deletion selekt-sqlite3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fun platformIdentifier() = "${osName()}-${System.getProperty("os.arch")}"
tasks.register<Copy>("buildHost") {
dependsOn("makeSQLite")
from(".cxx-host/sqlite3")
into("$buildDir/intermediates/libs/${platformIdentifier()}")
into("${layout.buildDirectory.get()}/intermediates/libs/${platformIdentifier()}")
include("*.dll", "*.dylib", "*.so")
}

Expand Down
Loading