mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-03 17:03:04 +01:00
Compare commits
340 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abdad4cde8 | ||
|
|
fecb30a86e | ||
|
|
c7ec3ab837 | ||
|
|
2a7b58bf46 | ||
|
|
7d5b0b1565 | ||
|
|
3620db3a92 | ||
|
|
69cad04875 | ||
|
|
d533cdc619 | ||
|
|
ae455d2615 | ||
|
|
7f27e52e58 | ||
|
|
4b10c19569 | ||
|
|
3f7f43d506 | ||
|
|
b4296c1e4b | ||
|
|
b62b5ea8ef | ||
|
|
db5cced91b | ||
|
|
b677827c86 | ||
|
|
fc0e902cbf | ||
|
|
6fbf4d4ae6 | ||
|
|
95149764eb | ||
|
|
a37680685f | ||
|
|
2b163a9acd | ||
|
|
2f41d15a41 | ||
|
|
d2c8b6e14c | ||
|
|
6877b9163b | ||
|
|
6ee14d5e7c | ||
|
|
824ff18ba5 | ||
|
|
548adb831d | ||
|
|
501ef69f97 | ||
|
|
a62f07db11 | ||
|
|
1b6cfe9fc6 | ||
|
|
eaa1124e71 | ||
|
|
380036195a | ||
|
|
d2619a6abd | ||
|
|
4d2f23ec37 | ||
|
|
6c1897d8d5 | ||
|
|
39de824bf0 | ||
|
|
889ebcadd4 | ||
|
|
db17d1fd24 | ||
|
|
cc282276c8 | ||
|
|
a5e00c4319 | ||
|
|
dba5252be6 | ||
|
|
874bc1a1c9 | ||
|
|
4b95851ae5 | ||
|
|
fbe907f1e9 | ||
|
|
cf0157c59d | ||
|
|
8f4dff8d53 | ||
|
|
1b3fb60cb0 | ||
|
|
ecbf9d60cb | ||
|
|
117c3ac2db | ||
|
|
9571215175 | ||
|
|
754dc8dab4 | ||
|
|
7caccd341b | ||
|
|
ef6c69a960 | ||
|
|
e82d11e035 | ||
|
|
a687fe09ff | ||
|
|
d19c536000 | ||
|
|
55e029e81d | ||
|
|
df89f8879d | ||
|
|
2b1db2943c | ||
|
|
1687f6966b | ||
|
|
2b685fb42e | ||
|
|
73f5a3398c | ||
|
|
35cf24b577 | ||
|
|
be920148e7 | ||
|
|
456aaa54f1 | ||
|
|
a872097c31 | ||
|
|
33c3c48bd5 | ||
|
|
cd24691130 | ||
|
|
5d92fb1cc4 | ||
|
|
c9e6204a8d | ||
|
|
b4ec935762 | ||
|
|
30426ee42a | ||
|
|
1a70449c4c | ||
|
|
374347da04 | ||
|
|
276662026e | ||
|
|
cd3e9a4009 | ||
|
|
7fb866fcfb | ||
|
|
d06febd5b5 | ||
|
|
04813fe345 | ||
|
|
6a3d1634b9 | ||
|
|
c554c0d456 | ||
|
|
e88f63f54d | ||
|
|
7ff051a638 | ||
|
|
ac9405e874 | ||
|
|
d18c5a7fad | ||
|
|
bdc90f3c02 | ||
|
|
94e28eddd0 | ||
|
|
6100664287 | ||
|
|
54aa477b28 | ||
|
|
3c5774960a | ||
|
|
5140c41c58 | ||
|
|
2b9bb3fb5c | ||
|
|
9500f4a59c | ||
|
|
a64b77d6f2 | ||
|
|
4f9e77e7cd | ||
|
|
13444136bd | ||
|
|
7beb4dd939 | ||
|
|
51e6ae8f03 | ||
|
|
7aca5f77f6 | ||
|
|
02ce6c62a8 | ||
|
|
b0b2c32a6f | ||
|
|
cf7fee2de8 | ||
|
|
bb730c137f | ||
|
|
da2eb02cde | ||
|
|
f271c85aef | ||
|
|
bd5f25ffc7 | ||
|
|
3d78d5473e | ||
|
|
49d3f7652d | ||
|
|
5b543c5212 | ||
|
|
2356bb6da2 | ||
|
|
c2bdc11832 | ||
|
|
2bd440e07c | ||
|
|
6eee4db87b | ||
|
|
e7d1db446b | ||
|
|
ff50755ba2 | ||
|
|
f8ef262b3d | ||
|
|
f8737995fa | ||
|
|
1bbefea857 | ||
|
|
143630c41b | ||
|
|
577eaa1eae | ||
|
|
316b071c81 | ||
|
|
5a6f55c0a8 | ||
|
|
e008a50acc | ||
|
|
41c3913482 | ||
|
|
803ff76678 | ||
|
|
309081437a | ||
|
|
5f152b73c2 | ||
|
|
f8d3336a1e | ||
|
|
dc1fdffe6a | ||
|
|
622d9c909f | ||
|
|
4e3ef19c1f | ||
|
|
b054a30fa7 | ||
|
|
7266c24354 | ||
|
|
5ec2877bcc | ||
|
|
0d93446c7d | ||
|
|
1e395ab416 | ||
|
|
0acb5ac7cd | ||
|
|
3b18b5d2b7 | ||
|
|
16e63a061d | ||
|
|
a6c8b940c9 | ||
|
|
74d9e3248b | ||
|
|
3af8b6050c | ||
|
|
da966753a1 | ||
|
|
0ad4b3f73e | ||
|
|
e8d072d4be | ||
|
|
b0eed4a095 | ||
|
|
ba720efe61 | ||
|
|
e23d575460 | ||
|
|
7fbcd17759 | ||
|
|
a95ebb2158 | ||
|
|
8a36425cac | ||
|
|
4261ed39dc | ||
|
|
ca37a884fd | ||
|
|
9fbb7683bc | ||
|
|
42e275ef0a | ||
|
|
19ece12e93 | ||
|
|
3ef0d3e4a3 | ||
|
|
602ea46b8b | ||
|
|
95c0bc6052 | ||
|
|
bd4ce1788c | ||
|
|
20d16a8433 | ||
|
|
db4c11cd53 | ||
|
|
f439e1f8e3 | ||
|
|
080b1aab83 | ||
|
|
61ba2ac97a | ||
|
|
7eebb38eda | ||
|
|
43e7d65af5 | ||
|
|
386d8bb312 | ||
|
|
3fbd72092c | ||
|
|
4e5b15cd88 | ||
|
|
8b2aeba3bd | ||
|
|
1d2334b920 | ||
|
|
38a234ae66 | ||
|
|
2c1226dc02 | ||
|
|
1df8ef6464 | ||
|
|
f8d40bf86d | ||
|
|
58ab03b4e3 | ||
|
|
0bf54e6b45 | ||
|
|
8fca0c69ac | ||
|
|
70eb4ca2a1 | ||
|
|
9d9e30725e | ||
|
|
ff9585ec7d | ||
|
|
a418c2750a | ||
|
|
9581994050 | ||
|
|
316d0e67c5 | ||
|
|
503bf04ec5 | ||
|
|
d6b76936dd | ||
|
|
c53d16717b | ||
|
|
2c747daa50 | ||
|
|
0b2d3edcce | ||
|
|
955bcde062 | ||
|
|
a91aa72fb4 | ||
|
|
163ece75b2 | ||
|
|
a8fb5f2598 | ||
|
|
3a62ad67e1 | ||
|
|
48f4e1ddc6 | ||
|
|
c37bb96aab | ||
|
|
a2057e20d2 | ||
|
|
577e05eb51 | ||
|
|
65a30cf2a7 | ||
|
|
121f0c6134 | ||
|
|
7d1897a9d2 | ||
|
|
415dbd1b61 | ||
|
|
cfc1c35203 | ||
|
|
911d7f3be8 | ||
|
|
c06944da13 | ||
|
|
b6dd4a3579 | ||
|
|
b057e145c5 | ||
|
|
772ad3b929 | ||
|
|
46681868d3 | ||
|
|
75795bd7d5 | ||
|
|
1908723fbe | ||
|
|
549992c08a | ||
|
|
845704b9fe | ||
|
|
ba03ca5e0c | ||
|
|
92a9f12b58 | ||
|
|
3437ac63bb | ||
|
|
d798a35c38 | ||
|
|
01b56995d9 | ||
|
|
3f190efb4e | ||
|
|
bb6b149c2e | ||
|
|
65b96fff16 | ||
|
|
0b8e8a7b2f | ||
|
|
a8a6fec19d | ||
|
|
a3fce4c149 | ||
|
|
85265412da | ||
|
|
e636a94de0 | ||
|
|
08509f6693 | ||
|
|
d28fc98cfd | ||
|
|
f584ef1d72 | ||
|
|
67a6df57c8 | ||
|
|
fadbb0adc5 | ||
|
|
58774033b7 | ||
|
|
66f0470960 | ||
|
|
68137cb66f | ||
|
|
4d6cacdb3d | ||
|
|
cf862af3ca | ||
|
|
a8d106a292 | ||
|
|
6155140de4 | ||
|
|
a4637248e8 | ||
|
|
8c4470a27e | ||
|
|
071fbfd916 | ||
|
|
1968438ebb | ||
|
|
7b31383b88 | ||
|
|
093a79045d | ||
|
|
e4928b0084 | ||
|
|
03420cf501 | ||
|
|
541b4674a8 | ||
|
|
6e108a03d1 | ||
|
|
c9dd332abd | ||
|
|
7e605fb6de | ||
|
|
fa2b0aedb0 | ||
|
|
402f49edd9 | ||
|
|
caf2e555dd | ||
|
|
32dc36d937 | ||
|
|
771d49bfa8 | ||
|
|
70dc78601a | ||
|
|
b4d781ddbb | ||
|
|
9c29601b55 | ||
|
|
28c37cb3ac | ||
|
|
bd121e47c8 | ||
|
|
7428e1e2ea | ||
|
|
376cb926b0 | ||
|
|
4ed0056d2a | ||
|
|
177ef8a555 | ||
|
|
7244a1f52f | ||
|
|
8d311923c1 | ||
|
|
9359d56880 | ||
|
|
3214200188 | ||
|
|
841ab7f983 | ||
|
|
53b3728432 | ||
|
|
cf9f98efc9 | ||
|
|
b5c666a1f4 | ||
|
|
b1954a509c | ||
|
|
c2c91cfe42 | ||
|
|
cccbec5744 | ||
|
|
4c89b20fad | ||
|
|
2328fa3e88 | ||
|
|
e19d4624c1 | ||
|
|
345f58ed48 | ||
|
|
4c14ce3937 | ||
|
|
82684c0169 | ||
|
|
2607328255 | ||
|
|
484ce3a1da | ||
|
|
85d5f62301 | ||
|
|
b0571f8184 | ||
|
|
b80dd28b40 | ||
|
|
e0cf0808cf | ||
|
|
ffdd5b62ae | ||
|
|
3b5376ef8b | ||
|
|
cd57fb0d76 | ||
|
|
6986acd6f4 | ||
|
|
2bc571ffd3 | ||
|
|
a8dddf33f8 | ||
|
|
46582a685b | ||
|
|
ad381783f7 | ||
|
|
b81c1eb65c | ||
|
|
2c4d3b3ee4 | ||
|
|
d1400928ce | ||
|
|
49abece92b | ||
|
|
b48b1f031e | ||
|
|
9cefe0bc04 | ||
|
|
ee73b0e229 | ||
|
|
ab0ce58812 | ||
|
|
333a206d36 | ||
|
|
86bb7666ea | ||
|
|
58b5ebf39d | ||
|
|
47947b85c7 | ||
|
|
6910ba6d2e | ||
|
|
08254edae6 | ||
|
|
e67307a961 | ||
|
|
9922621945 | ||
|
|
c7476a2a07 | ||
|
|
ac59528f5c | ||
|
|
97c9728c65 | ||
|
|
80d1694e6e | ||
|
|
28c6e31c7d | ||
|
|
8836b2a570 | ||
|
|
786c2b888b | ||
|
|
c91275c5da | ||
|
|
7b362460e7 | ||
|
|
a1862c3420 | ||
|
|
44ea9ccc59 | ||
|
|
4c9cdf3b8f | ||
|
|
4a6d4f197d | ||
|
|
ae04749336 | ||
|
|
caa743aba2 | ||
|
|
a4469a4285 | ||
|
|
2771b31aab | ||
|
|
5c418a4260 | ||
|
|
17dbdf3b74 | ||
|
|
8315ae47c4 | ||
|
|
50b59805ca | ||
|
|
58bc387d0b | ||
|
|
d2dd6790a0 | ||
|
|
78c7795b89 | ||
|
|
73c25f3476 | ||
|
|
6f9f89734d | ||
|
|
da68bee742 | ||
|
|
e5f1f9394d |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -33,3 +33,4 @@ maps.key
|
||||
kls_database.db
|
||||
.kotlin
|
||||
lefthook-local.yml
|
||||
sample-videos/
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
import com.android.build.api.dsl.ManagedVirtualDevice
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.provider.ValueSource
|
||||
import org.gradle.api.provider.ValueSourceParameters
|
||||
import org.gradle.api.tasks.InputDirectory
|
||||
import org.gradle.api.tasks.InputFile
|
||||
import org.gradle.api.tasks.Optional
|
||||
import org.gradle.api.tasks.PathSensitive
|
||||
import org.gradle.api.tasks.PathSensitivity
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import java.io.File
|
||||
import java.time.Instant
|
||||
import java.time.ZoneOffset
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.Locale
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
@@ -30,9 +24,9 @@ plugins {
|
||||
|
||||
apply(from = "static-ips.gradle.kts")
|
||||
|
||||
val canonicalVersionCode = 1649
|
||||
val canonicalVersionName = "7.74.1"
|
||||
val currentHotfixVersion = 0
|
||||
val canonicalVersionCode = 1670
|
||||
val canonicalVersionName = "8.4.2"
|
||||
val currentHotfixVersion = 1
|
||||
val maxHotfixVersions = 100
|
||||
|
||||
// We don't want versions to ever end in 0 so that they don't conflict with nightly versions
|
||||
@@ -50,9 +44,16 @@ val languagesForBuildConfigProvider = languagesProvider.map { languages ->
|
||||
languages.joinToString(separator = ", ") { language -> "\"$language\"" }
|
||||
}
|
||||
|
||||
val localPropertiesFile = File(rootProject.projectDir, "local.properties")
|
||||
val localProperties: Properties? = if (localPropertiesFile.exists()) {
|
||||
Properties().apply { localPropertiesFile.inputStream().use { load(it) } }
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val quickstartCredentialsDir: String? = localProperties?.getProperty("quickstart.credentials.dir")
|
||||
val benchmarkBackupFile: String? = localProperties?.getProperty("benchmark.backup.file")
|
||||
|
||||
val selectableVariants = listOf(
|
||||
"nightlyBackupRelease",
|
||||
"nightlyBackupSpinner",
|
||||
"nightlyProdSpinner",
|
||||
"nightlyProdPerf",
|
||||
"nightlyProdRelease",
|
||||
@@ -72,6 +73,8 @@ val selectableVariants = listOf(
|
||||
"playStagingPerf",
|
||||
"playStagingInstrumentation",
|
||||
"playStagingRelease",
|
||||
"playProdQuickstart",
|
||||
"playStagingQuickstart",
|
||||
"websiteProdSpinner",
|
||||
"websiteProdRelease",
|
||||
"githubProdSpinner",
|
||||
@@ -259,7 +262,7 @@ android {
|
||||
buildConfigField("String", "STRIPE_PUBLISHABLE_KEY", "\"pk_live_6cmGZopuTsV8novGgJJW9JpC00vLIgtQ1D\"")
|
||||
buildConfigField("boolean", "TRACING_ENABLED", "false")
|
||||
buildConfigField("boolean", "LINK_DEVICE_UX_ENABLED", "false")
|
||||
buildConfigField("boolean", "USE_STRING_ID", "true")
|
||||
buildConfigField("boolean", "USE_STRING_ID", "false")
|
||||
|
||||
ndk {
|
||||
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||
@@ -358,8 +361,13 @@ android {
|
||||
isDebuggable = false
|
||||
isMinifyEnabled = true
|
||||
matchingFallbacks += "debug"
|
||||
applicationIdSuffix = ".benchmark"
|
||||
|
||||
buildConfigField("String", "BUILD_VARIANT_TYPE", "\"Benchmark\"")
|
||||
buildConfigField("boolean", "TRACING_ENABLED", "true")
|
||||
buildConfigField("String[]", "UNIDENTIFIED_SENDER_TRUST_ROOTS", "new String[]{ \"BVT/2gHqbrG1xzuIypLIOjFgMtihrMld1/5TGADL6Dhv\"}")
|
||||
|
||||
manifestPlaceholders["applicationClass"] = "org.thoughtcrime.securesms.BenchmarkApplicationContext"
|
||||
}
|
||||
|
||||
create("mocked") {
|
||||
@@ -370,6 +378,8 @@ android {
|
||||
matchingFallbacks += "debug"
|
||||
buildConfigField("String", "BUILD_VARIANT_TYPE", "\"Benchmark\"")
|
||||
buildConfigField("boolean", "TRACING_ENABLED", "true")
|
||||
|
||||
manifestPlaceholders["applicationClass"] = "org.thoughtcrime.securesms.ApplicationContext"
|
||||
}
|
||||
|
||||
create("canary") {
|
||||
@@ -379,6 +389,14 @@ android {
|
||||
matchingFallbacks += "debug"
|
||||
buildConfigField("String", "BUILD_VARIANT_TYPE", "\"Canary\"")
|
||||
}
|
||||
|
||||
create("quickstart") {
|
||||
initWith(getByName("debug"))
|
||||
isDefault = false
|
||||
isMinifyEnabled = false
|
||||
matchingFallbacks += "debug"
|
||||
buildConfigField("String", "BUILD_VARIANT_TYPE", "\"Quickstart\"")
|
||||
}
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
@@ -445,22 +463,10 @@ android {
|
||||
buildConfigField("String", "RECAPTCHA_PROOF_URL", "\"https://signalcaptchas.org/staging/challenge/generate.html\"")
|
||||
buildConfigField("org.signal.libsignal.net.Network.Environment", "LIBSIGNAL_NET_ENV", "org.signal.libsignal.net.Network.Environment.STAGING")
|
||||
buildConfigField("int", "LIBSIGNAL_LOG_LEVEL", "org.signal.libsignal.protocol.logging.SignalProtocolLogger.DEBUG")
|
||||
buildConfigField("boolean", "USE_STRING_ID", "false")
|
||||
|
||||
buildConfigField("String", "BUILD_ENVIRONMENT_TYPE", "\"Staging\"")
|
||||
buildConfigField("String", "STRIPE_PUBLISHABLE_KEY", "\"pk_test_sngOd8FnXNkpce9nPXawKrJD00kIDngZkD\"")
|
||||
}
|
||||
|
||||
create("backup") {
|
||||
initWith(getByName("staging"))
|
||||
|
||||
dimension = "environment"
|
||||
|
||||
applicationIdSuffix = ".backup"
|
||||
|
||||
buildConfigField("boolean", "MANAGES_APP_UPDATES", "true")
|
||||
buildConfigField("String", "BUILD_ENVIRONMENT_TYPE", "\"Backup\"")
|
||||
}
|
||||
}
|
||||
|
||||
lint {
|
||||
@@ -502,12 +508,39 @@ android {
|
||||
val nightlyVersionCode = (canonicalVersionCode * maxHotfixVersions) + (getNightlyBuildNumber(tag) * 10) + nightlyBuffer
|
||||
|
||||
variant.outputs.forEach { output ->
|
||||
output.versionName.set(tag)
|
||||
output.versionName.set("$tag | ${getLastCommitDateTimeUtc()}")
|
||||
output.versionCode.set(nightlyVersionCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onVariants(selector().withBuildType("quickstart")) { variant ->
|
||||
val environment = variant.flavorName?.let { name ->
|
||||
when {
|
||||
name.contains("staging", ignoreCase = true) -> "staging"
|
||||
name.contains("prod", ignoreCase = true) -> "prod"
|
||||
else -> "prod"
|
||||
}
|
||||
} ?: "prod"
|
||||
|
||||
val taskProvider = tasks.register<CopyQuickstartCredentialsTask>("copyQuickstartCredentials${variant.name.capitalize()}") {
|
||||
if (quickstartCredentialsDir != null) {
|
||||
inputDir.set(File(quickstartCredentialsDir))
|
||||
}
|
||||
filePrefix.set("${environment}_")
|
||||
}
|
||||
variant.sources.assets?.addGeneratedSourceDirectory(taskProvider) { it.outputDir }
|
||||
}
|
||||
|
||||
onVariants(selector().withBuildType("benchmark")) { variant ->
|
||||
val taskProvider = tasks.register<CopyBenchmarkBackupTask>("copyBenchmarkBackup${variant.name.capitalize()}") {
|
||||
if (benchmarkBackupFile != null) {
|
||||
inputFile.set(File(benchmarkBackupFile))
|
||||
}
|
||||
}
|
||||
variant.sources.assets?.addGeneratedSourceDirectory(taskProvider) { it.outputDir }
|
||||
}
|
||||
}
|
||||
|
||||
val releaseDir = "$projectDir/src/release/java"
|
||||
@@ -535,7 +568,8 @@ android {
|
||||
applicationVariants.configureEach {
|
||||
outputs.configureEach {
|
||||
if (this is com.android.build.gradle.internal.api.BaseVariantOutputImpl) {
|
||||
outputFileName = outputFileName.replace(".apk", "-$versionName.apk")
|
||||
val fileVersionName = versionName.substringBefore(" |")
|
||||
outputFileName = outputFileName.replace(".apk", "-$fileVersionName.apk")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,6 +612,7 @@ dependencies {
|
||||
implementation(project(":core:models"))
|
||||
implementation(project(":core:models-jvm"))
|
||||
implementation(project(":feature:camera"))
|
||||
implementation(project(":feature:registration"))
|
||||
|
||||
implementation(libs.androidx.fragment.ktx)
|
||||
implementation(libs.androidx.appcompat) {
|
||||
@@ -619,6 +654,7 @@ dependencies {
|
||||
implementation(libs.androidx.concurrent.futures)
|
||||
implementation(libs.androidx.autofill)
|
||||
implementation(libs.androidx.biometric)
|
||||
implementation(libs.androidx.core.telecom)
|
||||
implementation(libs.androidx.sharetarget)
|
||||
implementation(libs.androidx.profileinstaller)
|
||||
implementation(libs.androidx.asynclayoutinflater)
|
||||
@@ -773,6 +809,16 @@ fun getNightlyBuildNumber(tag: String?): Int {
|
||||
return match?.groupValues?.get(1)?.toIntOrNull() ?: 0
|
||||
}
|
||||
|
||||
fun getLastCommitDateTimeUtc(): String {
|
||||
val timestamp = providers.exec {
|
||||
commandLine("git", "log", "-1", "--pretty=format:%ct")
|
||||
}.standardOutput.asText.get().trim().toLong()
|
||||
val instant = Instant.ofEpochSecond(timestamp)
|
||||
val formatter = DateTimeFormatter.ofPattern("MMM d '@' HH:mm 'UTC'", Locale.US)
|
||||
.withZone(ZoneOffset.UTC)
|
||||
return formatter.format(instant)
|
||||
}
|
||||
|
||||
fun getMapsKey(): String {
|
||||
return providers
|
||||
.gradleProperty("mapsKey")
|
||||
@@ -832,3 +878,62 @@ abstract class PropertiesFileValueSource : ValueSource<Properties?, PropertiesFi
|
||||
fun String.capitalize(): String {
|
||||
return this.replaceFirstChar { it.uppercase() }
|
||||
}
|
||||
|
||||
abstract class CopyQuickstartCredentialsTask : DefaultTask() {
|
||||
@get:InputDirectory
|
||||
@get:Optional
|
||||
abstract val inputDir: DirectoryProperty
|
||||
|
||||
@get:Input
|
||||
abstract val filePrefix: Property<String>
|
||||
|
||||
@get:OutputDirectory
|
||||
abstract val outputDir: DirectoryProperty
|
||||
|
||||
@TaskAction
|
||||
fun copy() {
|
||||
if (!inputDir.isPresent) {
|
||||
throw GradleException("quickstart.credentials.dir is not set in local.properties. This is required for quickstart builds.")
|
||||
}
|
||||
|
||||
val prefix = filePrefix.get()
|
||||
val candidates = inputDir.get().asFile.listFiles()
|
||||
?.filter { it.extension == "json" && it.name.startsWith(prefix) }
|
||||
?: emptyList()
|
||||
|
||||
if (candidates.isEmpty()) {
|
||||
throw GradleException("No credential files matching '$prefix*.json' found in ${inputDir.get().asFile}. Add files like '${prefix}account1.json' to your credentials directory.")
|
||||
}
|
||||
|
||||
val chosen = candidates.random()
|
||||
logger.lifecycle("Selected quickstart credential: ${chosen.name}")
|
||||
|
||||
val dest = outputDir.get().asFile.resolve("quickstart")
|
||||
dest.mkdirs()
|
||||
chosen.copyTo(dest.resolve(chosen.name), overwrite = true)
|
||||
}
|
||||
}
|
||||
|
||||
abstract class CopyBenchmarkBackupTask : DefaultTask() {
|
||||
@get:InputFile
|
||||
@get:Optional
|
||||
abstract val inputFile: RegularFileProperty
|
||||
|
||||
@get:OutputDirectory
|
||||
abstract val outputDir: DirectoryProperty
|
||||
|
||||
@TaskAction
|
||||
fun copy() {
|
||||
val dest = outputDir.get().asFile.resolve("backups")
|
||||
dest.mkdirs()
|
||||
|
||||
if (!inputFile.isPresent) {
|
||||
logger.lifecycle("benchmark.backup.file is not set in local.properties. Benchmark tests using backup data will crash at runtime.")
|
||||
return
|
||||
}
|
||||
|
||||
val backupFile = inputFile.get().asFile
|
||||
logger.lifecycle("Using benchmark backup: ${backupFile.absolutePath} (${backupFile.length() / 1024}KB)")
|
||||
backupFile.copyTo(dest.resolve("backup.binproto"), overwrite = true)
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user