Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ class ZipRecipeExecutor(
.build()

val className = data.name.replace(CLASS_NAME_PATTERN, "")
val (baseIdentifiers, warnings) = metaJson.pebbleParams(data, defModule, params)
val identifiers = baseIdentifiers + (KEY_CLASS_NAME to className)
val (baseIdentifiers, warnings) = metaJson.pebbleParams(data, defModule, params)
val identifiers = baseIdentifiers + (KEY_CLASS_NAME to className)

if (warnings.isNotEmpty()) {
warn("Identifier warnings: ${warnings.joinToString(System.lineSeparator())}")
}
Expand Down Expand Up @@ -227,10 +228,8 @@ class ZipRecipeExecutor(
if (saveLocation.usedDefault) warnings += "Missing 'saveLocation', defaulted to $KEY_SAVE_LOCATION"

val language = resolveString(parameters?.optional?.language?.identifier, KEY_LANGUAGE)
if (language.usedDefault) warnings += "Missing 'language', defaulted to $KEY_LANGUAGE"

val minSdk = resolveString(parameters?.optional?.minsdk?.identifier, KEY_MIN_SDK)
if (minSdk.usedDefault) warnings += "Missing 'minsdk', defaulted to $KEY_MIN_SDK"

val agpVersion = resolveString(system?.agpVersion?.identifier, KEY_AGP_VERSION)
if (agpVersion.usedDefault) warnings += "Missing 'agpVersion', defaulted to $KEY_AGP_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ object ZipTemplateReader {
try {
ZipFile(zipFile).use { zip ->

val indexEntry = zip.getEntry(ARCHIVE_JSON) ?: return emptyList()
val indexEntry = requireNotNull(zip.getEntry(ARCHIVE_JSON)) {
"${zip.name} does not contain $ARCHIVE_JSON"
}

val indexJson = zip.getInputStream(indexEntry).bufferedReader().use {
gson.fromJson(it, TemplatesIndex::class.java)
}
Expand Down
Loading