Skip to content

Commit ad74fe8

Browse files
authored
Merge pull request #7 from StringCare/develop
Develop
2 parents 7a1ae4f + 5edf8b4 commit ad74fe8

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
}
77

88
group 'com.stringcare'
9-
version '3.5'
9+
version '3.6'
1010

1111
def siteUrl = 'https://github.com/StringCare/KotlinGradlePlugin'
1212
def gitUrl = 'https://github.com/StringCare/KotlinGradlePlugin.git'

src/main/kotlin/StringCare.kt

+14-6
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ open class StringCare : Plugin<Project> {
8282
},
8383
mergeResourcesStart = { module, variant ->
8484
fingerPrint(variantMap, module, variant, extension.debug) { key ->
85-
if ("none" == key) {
86-
return@fingerPrint
87-
}
8885
when {
8986
moduleMap.containsKey(module) -> {
9087
val variantOrFlavor = extension.variants.find {
@@ -95,6 +92,11 @@ open class StringCare : Plugin<Project> {
9592
return@fingerPrint
9693
}
9794

95+
if ("none" == key || key.trim().isEmpty()) {
96+
PrintUtils.print("No SHA1 key found for :$module:$variant")
97+
return@fingerPrint
98+
}
99+
98100
PrintUtils.print(module, "$variant:$key")
99101
PrintUtils.print(module, backupStringRes)
100102
moduleMap[module]?.let { configuration ->
@@ -116,6 +118,10 @@ open class StringCare : Plugin<Project> {
116118
val defaultConfiguration = defaultConfig().apply {
117119
name = module
118120
}
121+
if ("none" == key || key.trim().isEmpty()) {
122+
PrintUtils.print("No SHA1 key found for :$module:$variant")
123+
return@fingerPrint
124+
}
119125
PrintUtils.print(module, "$variant:$key")
120126
PrintUtils.print(module, backupStringRes)
121127
backupResourceFiles(absoluteProjectPath, defaultConfiguration)
@@ -141,9 +147,6 @@ open class StringCare : Plugin<Project> {
141147
},
142148
mergeAssetsStart = { module, variant ->
143149
fingerPrint(variantMap, module, variant, extension.debug) { key ->
144-
if ("none" == key) {
145-
return@fingerPrint
146-
}
147150
when {
148151
moduleMap.containsKey(module) -> {
149152
val variantOrFlavor = extension.variants.find {
@@ -154,6 +157,11 @@ open class StringCare : Plugin<Project> {
154157
return@fingerPrint
155158
}
156159

160+
if ("none" == key || key.trim().isEmpty()) {
161+
PrintUtils.print("No SHA1 key found for :$module:$variant")
162+
return@fingerPrint
163+
}
164+
157165
PrintUtils.print(module, "$variant:$key")
158166
PrintUtils.print(module, backupAssets)
159167
moduleMap[module]?.let { configuration ->

src/main/kotlin/components/Extensions.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ fun File.validForXMLConfiguration(configuration: Configuration): Boolean {
107107
}
108108
}
109109
}
110-
if (configuration.debug && excludedForXML().not()) {
111-
println("${if (valid) "" else "❌ not"} valid file ${this.absolutePath}")
110+
if (configuration.debug && excludedForXML().not() && valid) {
111+
println(" valid file ${this.absolutePath}")
112112
}
113113
return valid
114114
}
@@ -131,8 +131,8 @@ fun File.validForAssetsConfiguration(configuration: Configuration): Boolean {
131131
}
132132
}
133133
}
134-
if (configuration.debug && excludedForAssets().not()) {
135-
println("${if (valid) "" else "❌ not"} valid file ${this.absolutePath}")
134+
if (configuration.debug && excludedForAssets().not() && valid) {
135+
println(" valid file ${this.absolutePath}")
136136
}
137137
return valid
138138
}

src/main/kotlin/components/Fingerprint.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ private class Fingerprint {
7575
/**
7676
* Gets the signing report trace and extracts the fingerprint
7777
*/
78-
fun fingerPrint(variantMap: MutableMap<String, StringCare.VariantApplicationId>, module: String, variant: String, debug: Boolean, keyFound: (key: String) -> Unit) {
78+
fun fingerPrint(
79+
variantMap: MutableMap<String, StringCare.VariantApplicationId>,
80+
module: String,
81+
variant: String,
82+
debug: Boolean,
83+
keyFound: (key: String) -> Unit
84+
) {
7985
if (variantMap.containsKey(variant)) {
8086
if (variantMap[variant]!!.mockedFingerprint.isNotEmpty()) {
8187
keyFound(variantMap[variant]!!.mockedFingerprint)

src/main/kotlin/components/PrintUtils.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class PrintUtils {
1616
}
1717

1818
private fun _print(value: String) {
19-
logger.info(value)
19+
println(value)
2020
}
2121

2222
fun print(message: String, tab: Boolean = false) {

src/main/kotlin/components/Vars.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package components
22

33
import java.io.File
44

5-
internal const val version = "3.5"
5+
internal const val version = "3.6"
66
internal const val testProjectName = "KotlinSample"
77
internal const val defaultDebug = false
88
internal const val defaultMainModule = "app"
@@ -13,7 +13,7 @@ internal const val gradleTaskNameObfuscate = "stringcareTestObfuscate"
1313
internal const val extensionName = "stringcare"
1414
internal const val winLib = "libsignKey.dll"
1515
internal const val osxLib = "libsignKey.dylib"
16-
internal const val wrapperOsX = "./gradlew"
16+
internal const val wrapperOsX = "sh gradlew"
1717
internal const val wrapperWindows = "gradlew.bat"
1818
internal const val copyCommandOsX = "cp"
1919
internal const val copyCommandWindows = "copy"

0 commit comments

Comments
 (0)