Skip to content

Commit 6ad30db

Browse files
committed
move changes to auto-update json to a different PR
1 parent f1e7af5 commit 6ad30db

File tree

4 files changed

+1
-254
lines changed

4 files changed

+1
-254
lines changed

firebase-dataconnect/connectors/connectors.gradle.kts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
18-
import com.google.firebase.dataconnect.gradle.plugin.UpdateDataConnectExecutableVersionsTask
1918

2019
plugins {
2120
id("com.android.library")
@@ -110,41 +109,3 @@ tasks.withType<KotlinCompile>().all {
110109
}
111110
}
112111
}
113-
114-
// Adds a Gradle task that updates the JSON file that stores the list of Data Connect
115-
// executable versions.
116-
//
117-
// Example 1: Add versions 1.4.3 and 1.4.4 to the JSON file, and set 1.4.4 as the default:
118-
// ../../gradlew -Pversions=1.4.3,1.4.4 -PdefaultVersion=1.4.4 updateJson --info
119-
//
120-
// Example 2: Add version 1.2.3 to the JSON file, but do not change the default version:
121-
// ../../gradlew -Pversion=1.2.3 updateJson --info
122-
//
123-
// The `--info` argument can be omitted; it merely controls the level of log output.
124-
tasks.register<UpdateDataConnectExecutableVersionsTask>("updateJson") {
125-
outputs.upToDateWhen { false }
126-
jsonFile.set(project.layout.projectDirectory.file(
127-
"../gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/" +
128-
"plugin/DataConnectExecutableVersions.json"))
129-
workDirectory.set(project.layout.buildDirectory.dir("updateJson"))
130-
131-
val singleVersion: String? = project.providers.gradleProperty("version").orNull
132-
val multipleVersions: List<String>? = project.providers.gradleProperty("versions").orNull?.split(',')
133-
versions.set(buildList {
134-
singleVersion?.let{add(it)}
135-
multipleVersions?.let{addAll(it)}
136-
if (isEmpty()) {
137-
throw Exception("bm6d5ezxzd 'version' or 'versions' property must be specified")
138-
}
139-
})
140-
141-
updateMode.set(project.providers.gradleProperty("updateMode").map {
142-
when (it) {
143-
"overwrite" -> UpdateDataConnectExecutableVersionsTask.UpdateMode.Overwrite
144-
"update" -> UpdateDataConnectExecutableVersionsTask.UpdateMode.Update
145-
else -> throw Exception("ahe4zadcjs 'updateMode' must be 'overwrite' or 'update', but got: $it")
146-
}
147-
})
148-
149-
defaultVersion.set(project.providers.gradleProperty("defaultVersion"))
150-
}

firebase-dataconnect/gradleplugin/plugin/src/main/kotlin/com/google/firebase/dataconnect/gradle/plugin/UpdateDataConnectExecutableVersionsTask.kt

Lines changed: 0 additions & 174 deletions
This file was deleted.

firebase-dataconnect/gradleplugin/plugin/src/main/kotlin/com/google/firebase/dataconnect/gradle/plugin/Util.kt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package com.google.firebase.dataconnect.gradle.plugin
1717

1818
import java.util.Locale
1919
import java.util.concurrent.atomic.AtomicLong
20-
import kotlin.random.Random
2120
import kotlin.time.Duration
2221
import kotlin.time.DurationUnit
2322
import kotlin.time.toDuration
@@ -47,24 +46,3 @@ class Debouncer(val period: Duration) {
4746
}
4847
}
4948
}
50-
51-
/**
52-
* Generates and returns a string containing random alphanumeric characters.
53-
*
54-
* The characters returned are taken from the set of characters comprising of the 10 numeric digits
55-
* and the 26 lowercase English characters.
56-
*
57-
* @param length the number of random characters to generate and include in the returned string;
58-
* must be greater than or equal to zero.
59-
* @return a string containing the given number of random alphanumeric characters.
60-
*/
61-
fun Random.nextAlphanumericString(length: Int): String {
62-
require(length >= 0) { "invalid length: $length" }
63-
return (0 until length).map { ALPHANUMERIC_ALPHABET.random(this) }.joinToString(separator = "")
64-
}
65-
66-
// The set of characters consisting of the 10 numeric digits and the 26 lowercase letters of the
67-
// English alphabet with some characters removed that can look similar in different fonts, like
68-
// '1', 'l', and 'i'.
69-
@Suppress("SpellCheckingInspection")
70-
private const val ALPHANUMERIC_ALPHABET = "23456789abcdefghjkmnpqrstvwxyz"

firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"defaultVersion": "1.4.4",
2+
"defaultVersion": "1.4.3",
33
"versions": [
44
{
55
"version": "1.3.4",
@@ -180,24 +180,6 @@
180180
"os": "linux",
181181
"size": 25034904,
182182
"sha512DigestHex": "c25fd2cb9ef4896cadc05fab79f767f8fc8212e3b967f2ae535855befd63339539a4f6cd648743c024f40139b668cc69fb9c6691490259664af5821d116896cf"
183-
},
184-
{
185-
"version": "1.4.4",
186-
"os": "windows",
187-
"size": 25567744,
188-
"sha512DigestHex": "6c548bf1b8303f0bae1070ac3f149ac6e77433cd7d570ad38e2f3d9a3d68d0f1325b4944f44e7d8089e5c72ef658a8294aed6509dfa9506fe6d2f9ede7ac358a"
189-
},
190-
{
191-
"version": "1.4.4",
192-
"os": "macos",
193-
"size": 25142016,
194-
"sha512DigestHex": "4e19d2a8d09fcc1937fd15411659e03199eb6bab6263d17594cce700b3f3451445fce3c02622fac36207a5d023fe9ed85bc7de1489d47ae6543d8ba38cc6fba6"
195-
},
196-
{
197-
"version": "1.4.4",
198-
"os": "linux",
199-
"size": 25055384,
200-
"sha512DigestHex": "fdc7775fcd626fed385886abde98dc24d0a2ba7f8d991888bbf7609d597adeb492e85d601ca393e22026548a56ccb90f49678adf0d33993b00a6e2fe04fd39f3"
201183
}
202184
]
203185
}

0 commit comments

Comments
 (0)