Skip to content

Commit

Permalink
default android jniLibs folder
Browse files Browse the repository at this point in the history
  • Loading branch information
DatL4g committed Dec 10, 2024
1 parent 170d2f6 commit 6c0106f
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package dev.datlag.sekret.gradle.extension

import dev.datlag.sekret.gradle.common.existsSafely
import dev.datlag.sekret.gradle.common.isDirectorySafely
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.file.RegularFileProperty
import org.gradle.api.model.ObjectFactory
Expand Down Expand Up @@ -99,7 +102,9 @@ open class PropertiesExtension(objectFactory: ObjectFactory) {
open val desktopComposeResourcesFolder: DirectoryProperty = objectFactory.directoryProperty()

internal fun setupConvention(project: Project) {
// ToDo("check if jniLibs folder exists")
androidJNIFolder.convention(
resolveFolder(project.layout.projectDirectory.dir("src/androidMain/jniLibs"))
)
// ToDo("check if compose resources folder exists")
}
}
Expand All @@ -108,5 +113,13 @@ open class PropertiesExtension(objectFactory: ObjectFactory) {
internal const val sekretFileName = "sekret.properties"
internal const val sekretPackageName = "dev.datlag.sekret"
internal const val googleServicesFileName = "google-services.json"

private fun resolveFolder(dir: Directory): Directory? {
return if (dir.asFile.existsSafely() && dir.asFile.isDirectorySafely()) {
dir
} else {
null
}
}
}
}

0 comments on commit 6c0106f

Please sign in to comment.