diff --git a/recipes/transformManifest/build-logic/plugins/src/main/kotlin/CheckMergedManifestTask.kt b/recipes/transformManifest/build-logic/plugins/src/main/kotlin/CheckMergedManifestTask.kt index 84c4cde8..dc0d8560 100644 --- a/recipes/transformManifest/build-logic/plugins/src/main/kotlin/CheckMergedManifestTask.kt +++ b/recipes/transformManifest/build-logic/plugins/src/main/kotlin/CheckMergedManifestTask.kt @@ -48,7 +48,7 @@ abstract class CheckMergedManifestTask : DefaultTask() { val fileContents = mergedManifest.get().asFile.readText() val gitVersion = gitInfoFile.get().asFile.readText() - if (fileContents.contains("android:targetSdkVersion=\"$gitVersion\"")) { + if (fileContents.contains("android:versionName=\"$gitVersion\"")) { return } else { throw RuntimeException("Merged manifest does not contains transformed data.") diff --git a/recipes/transformManifest/build-logic/plugins/src/main/kotlin/ManifestTransformerTask.kt b/recipes/transformManifest/build-logic/plugins/src/main/kotlin/ManifestTransformerTask.kt index e767206b..d556db4e 100644 --- a/recipes/transformManifest/build-logic/plugins/src/main/kotlin/ManifestTransformerTask.kt +++ b/recipes/transformManifest/build-logic/plugins/src/main/kotlin/ManifestTransformerTask.kt @@ -39,7 +39,9 @@ abstract class ManifestTransformerTask: DefaultTask() { val gitVersion = gitInfoFile.get().asFile.readText() var manifest = mergedManifest.asFile.get().readText() - manifest = manifest.replace("android:targetSdkVersion=\"34\"", "android:targetSdkVersion=\"$gitVersion\"") + manifest = manifest.replace("package=\"com.example.android.recipes.transformManifest\" >", "" + + "package=\"com.example.android.recipes.transformManifest\"\n" + + "android:versionName=\"$gitVersion\" >") updatedManifest.get().asFile.writeText(manifest) } } \ No newline at end of file