Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add manifest validation, replace manifest build dir generation #104

Merged
merged 4 commits into from
Nov 8, 2021

Conversation

ikarenkov
Copy link
Collaborator

Added 2 flags to forma configuration for working with manifests:

  1. Remove generateManifest from android targets and add generateMissedManifests to forma global config
  2. Add validateManifestPackages for comparing build.gradle.kts packageName with manifest's package

@Merlinkoss
Copy link

Oh! Nice PR, im waiting them for my project!
@stepango is it include in next release?

"""<?xml version="1.0" encoding="utf-8"?>
<manifest package="$packageName"/>
""".trimIndent()
"""<manifest package="$packageName"/>"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we are skipping xml version here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never seen any effect of specifying xml version in android xml files like manifest or resources, I can roll back this

private fun LibraryExtension.maybeGenerateManifest(
project: Project,
feature: AndroidLibraryFeatureConfiguration
) {
val manifestFile = manifestFile(project.buildDir, feature.packageName)
val manifestFile = File(project.projectDir, "src/main/AndroidManifest.xml")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could be a few cases where we'll need different manifests in src/smth folders do we want to support that?

stepango
stepango previously approved these changes Nov 7, 2021
Copy link
Collaborator

@stepango stepango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, my only worry is xml version and encoding info which we are removing from the manifest. I wonder what's the implications would be in this case.

@ikarenkov ikarenkov merged commit 4ea82a2 into master Nov 8, 2021
@ikarenkov ikarenkov deleted the karenkovigor/manifestCheks branch November 8, 2021 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants