{"action":"created","issue":{"url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/563","labels_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/563/labels{/name}","comments_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/563/comments","events_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/563/events","html_url":"https://github.com/simpligility/android-maven-plugin/pull/563","id":54240437,"number":563,"title":"Work-around for manifest merger (v2) messing up certain CRLF EOL markers","user":{"login":"mstevens83","id":2787305,"avatar_url":"https://avatars.githubusercontent.com/u/2787305?v=3","gravatar_id":"","url":"https://api.github.com/users/mstevens83","html_url":"https://github.com/mstevens83","followers_url":"https://api.github.com/users/mstevens83/followers","following_url":"https://api.github.com/users/mstevens83/following{/other_user}","gists_url":"https://api.github.com/users/mstevens83/gists{/gist_id}","starred_url":"https://api.github.com/users/mstevens83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstevens83/subscriptions","organizations_url":"https://api.github.com/users/mstevens83/orgs","repos_url":"https://api.github.com/users/mstevens83/repos","events_url":"https://api.github.com/users/mstevens83/events{/privacy}","received_events_url":"https://api.github.com/users/mstevens83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-13T20:00:21Z","updated_at":"2015-01-14T15:22:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/simpligility/android-maven-plugin/pulls/563","html_url":"https://github.com/simpligility/android-maven-plugin/pull/563","diff_url":"https://github.com/simpligility/android-maven-plugin/pull/563.diff","patch_url":"https://github.com/simpligility/android-maven-plugin/pull/563.patch"},"body":"Work-around for manifest merger (v2) messing up certain CRLF EOL markers -- fixes #511\r\n\r\n**Problem:** When fed a manifest file with Windows-style line endings (CRLF) the manifest-merger mojo replaces certain CRLF occurrences (specifically in multi-line XML comments) with Unix-style LF line endings, leaving the file with inconsistent line endings. Note: the (deprecated) manifest-update mojo exhibits the same problem.\r\nBecause the manifest-merger mojo relies on the Android builder library the problem should actually be tackled there (and we should submit a bug report to Google to that effect). But in the meantime, here is a stopgap solution...\r\n\r\n**Work-around being committed:** before letting the builder merge the manifest(s) the I check whether the androidManifestFile has CRLF line endings, if so I copy the manifest to a temp file (in target/) and convert all line endings in there to LF and pass this temp file to the builder instead of the source manifest. After the builder has done its work the line endings of in the destinationManifestFile are converted by to CRLF if the original  androidManifestFile had CRLF line endings.\r\n\r\n**Known issue:** This work-around only applies to the manifest-merger mojo, and does not correct the problem for the deprecated manifest-update mojo."},"comment":{"url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/comments/69931668","html_url":"https://github.com/simpligility/android-maven-plugin/pull/563#issuecomment-69931668","issue_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/563","id":69931668,"user":{"login":"mstevens83","id":2787305,"avatar_url":"https://avatars.githubusercontent.com/u/2787305?v=3","gravatar_id":"","url":"https://api.github.com/users/mstevens83","html_url":"https://github.com/mstevens83","followers_url":"https://api.github.com/users/mstevens83/followers","following_url":"https://api.github.com/users/mstevens83/following{/other_user}","gists_url":"https://api.github.com/users/mstevens83/gists{/gist_id}","starred_url":"https://api.github.com/users/mstevens83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mstevens83/subscriptions","organizations_url":"https://api.github.com/users/mstevens83/orgs","repos_url":"https://api.github.com/users/mstevens83/repos","events_url":"https://api.github.com/users/mstevens83/events{/privacy}","received_events_url":"https://api.github.com/users/mstevens83/received_events","type":"User","site_admin":false},"created_at":"2015-01-14T15:22:28Z","updated_at":"2015-01-14T15:22:28Z","body":"Thanks!\r\nWell, first of all, in my opinion any text file with inconsistent line endings is essentially corrupt. That being said there was no real consequence with respect to the apk. *But* the inconsistent line endings do tend to confuse git. It considers the file as changed even when there are no real changes besides some (but not all) `CRLF`s having become `LF`s, which does not happen if the line endings change is consistent across the file -- provided git has been set up to automatically deal with line ending conversion (e.g. the *autocrlf* setting will make it convert `LF` endings to `CRLF` upon checkout and do reverse on commit/push, which is useful when a Windows user collaborates with people on unix based systems).\r\nSo for this sort of \"smart\" EOL handing to work properly git seems to expect that the line endings are consistent per file (yet not necessarily per repo).\r\nBesides git I can imagine there might be other SCMs or tools which might trip over such files."}}