Implement Rust-owned Android local and HTTPS onboarding (#95)
This commit is contained in:
1 parent
66b1d4a4c4
commit
36e5f55283
46 files changed
+3002
-79
No files matched your search
@@ -1,3 +1,6 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import java.io.File
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
@@ -10,6 +13,25 @@ dependencyResolutionManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
// The official verifier JVM support is shipped in the checksum-pinned Cargo crate.
|
||||
val cargo = providers.environmentVariable("CARGO").orElse(
|
||||
providers.environmentVariable("PATH").map { path ->
|
||||
path.split(File.pathSeparatorChar).map { File(it, "cargo") }
|
||||
.firstOrNull { it.isFile && it.canExecute() }?.absolutePath
|
||||
?: error("Cargo is required for the Android TLS verifier")
|
||||
}
|
||||
)
|
||||
val metadata = providers.exec {
|
||||
workingDir = file("..")
|
||||
commandLine(cargo.get(), "+1.97.1", "metadata", "--locked", "--offline", "--format-version", "1", "--filter-platform", "aarch64-linux-android")
|
||||
}.standardOutput.asText
|
||||
val packages = (JsonSlurper().parseText(metadata.get()) as Map<*, *>)["packages"] as List<*>
|
||||
val verifier = packages.map { it as Map<*, *> }.single { it["name"] == "rustls-platform-verifier-android" }
|
||||
check(verifier["version"] == "0.1.1") { "Update the verifier catalog pin with its Cargo component" }
|
||||
maven {
|
||||
url = uri(File(verifier["manifest_path"] as String).parentFile.resolve("maven"))
|
||||
content { includeModule("rustls", "rustls-platform-verifier") }
|
||||
}
|
||||
}
|
||||
}
|
||||
rootProject.name = "IronStorage"
|
||||
|
||||
Reference in new issue
Block a user