Skip to content

Commit 3baee9a

Browse files
authored
Rename CleanProperties to ReproducibleProperties (#1869)
1 parent edcba4e commit 3baee9a

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/CleanProperties.kt renamed to src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ReproducibleProperties.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.util.Properties
99
/**
1010
* Provides functionality for reproducible serialization.
1111
*/
12-
internal class CleanProperties : Properties() {
12+
internal class ReproducibleProperties : Properties() {
1313
override fun store(writer: Writer, comments: String) {
1414
throw UnsupportedOperationException("use writeWithoutComments()")
1515
}

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.jengelman.gradle.plugins.shadow.transformers
22

3-
import com.github.jengelman.gradle.plugins.shadow.internal.CleanProperties
3+
import com.github.jengelman.gradle.plugins.shadow.internal.ReproducibleProperties
44
import com.github.jengelman.gradle.plugins.shadow.internal.mapProperty
55
import com.github.jengelman.gradle.plugins.shadow.internal.property
66
import com.github.jengelman.gradle.plugins.shadow.internal.setProperty
@@ -108,7 +108,7 @@ public open class PropertiesFileTransformer @Inject constructor(
108108
internal val conflicts: MutableMap<String, MutableMap<String, Int>> = mutableMapOf()
109109

110110
@get:Internal
111-
internal val propertiesEntries = mutableMapOf<String, CleanProperties>()
111+
internal val propertiesEntries = mutableMapOf<String, ReproducibleProperties>()
112112

113113
@get:Input
114114
public open val paths: SetProperty<String> = objectFactory.setProperty()
@@ -149,7 +149,7 @@ public open class PropertiesFileTransformer @Inject constructor(
149149
}
150150

151151
override fun transform(context: TransformerContext) {
152-
val props = propertiesEntries.computeIfAbsent(context.path) { CleanProperties() }
152+
val props = propertiesEntries.computeIfAbsent(context.path) { ReproducibleProperties() }
153153
loadAndTransformKeys(context.inputStream) { key, value ->
154154
if (props.containsKey(key)) {
155155
when (MergeStrategy.from(mergeStrategyFor(context.path))) {

src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/CleanPropertiesTest.kt renamed to src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/ReproduciblePropertiesTest.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ import java.nio.charset.StandardCharsets
99
import org.junit.jupiter.params.ParameterizedTest
1010
import org.junit.jupiter.params.provider.MethodSource
1111

12-
class CleanPropertiesTest {
12+
class ReproduciblePropertiesTest {
1313
@ParameterizedTest
1414
@MethodSource("generalCharsetsProvider")
1515
fun emptyProperties(charset: Charset) {
16-
val output = CleanProperties().writeToString(charset)
16+
val output = ReproducibleProperties().writeToString(charset)
1717

1818
assertThat(output).isEqualTo("")
1919
}
2020

2121
@ParameterizedTest
2222
@MethodSource("generalCharsetsProvider")
2323
fun asciiProps(charset: Charset) {
24-
val output = CleanProperties().also { props ->
24+
val output = ReproducibleProperties().also { props ->
2525
props["key"] = "value"
2626
props["key2"] = "value2"
2727
props["a"] = "b"
@@ -50,7 +50,7 @@ class CleanPropertiesTest {
5050
@ParameterizedTest
5151
@MethodSource("utfCharsetsProvider")
5252
fun utfProps(charset: Charset) {
53-
val output = CleanProperties().also { props ->
53+
val output = ReproducibleProperties().also { props ->
5454
props["äöüß"] = "aouss"
5555
props["áèô"] = "aeo"
5656
props["€²³"] = "x"
@@ -81,7 +81,7 @@ class CleanPropertiesTest {
8181
StandardCharsets.UTF_16,
8282
)
8383

84-
fun CleanProperties.writeToString(charset: Charset): String {
84+
fun ReproducibleProperties.writeToString(charset: Charset): String {
8585
return ByteArrayOutputStream().also { writeWithoutComments(charset, it) }
8686
.toString(charset.name()).invariantEolString
8787
}

0 commit comments

Comments
 (0)