Skip to content

Commit 320665e

Browse files
authored
skip experimental templates when experimental flag is off (#1131)
* skip experimental templates when experimental flag is off * skip experimental templates when experimental and feature flag experimental is absent
1 parent 0b71c7f commit 320665e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.itsaky.androidide.templates.Widget
1414
import com.itsaky.androidide.templates.base.baseZipProject
1515
import com.itsaky.androidide.templates.booleanParameter
1616
import com.itsaky.androidide.templates.stringParameter
17+
import com.itsaky.androidide.utils.FeatureFlags
1718
import org.slf4j.LoggerFactory
1819
import java.io.File
1920
import java.util.zip.ZipFile
@@ -43,8 +44,15 @@ object ZipTemplateReader {
4344
log.debug("indexJson: $indexJson")
4445
for (templateRef in indexJson.templates) {
4546
try {
47+
4648
val basePath = templateRef.path
4749
log.debug("basePath: $basePath")
50+
51+
if (templateRef.experimental && !FeatureFlags.isExperimentsEnabled) {
52+
log.debug("Skipping experimental template: $basePath")
53+
continue
54+
}
55+
4856
val metaEntry = zip.getEntry("$basePath/$META_FOLDER/$META_JSON") ?: continue
4957

5058
val metaJsonString = zip.getInputStream(metaEntry).bufferedReader().use { reader ->

0 commit comments

Comments
 (0)