{"action":"created","issue":{"url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/511","labels_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/511/labels{/name}","comments_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/511/comments","events_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/511/events","html_url":"https://github.com/simpligility/android-maven-plugin/issues/511","id":49288645,"number":511,"title":"manifest-update messes up line-endings","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":21,"created_at":"2014-11-18T20:23:22Z","updated_at":"2015-01-13T20:07:22Z","closed_at":null,"body":"I have noticed that `manifest-update` produces an `AndroidManifest.xml` file with *changed* and *inconsistent* line-endings.\r\nIn a nutshell: my source file has only `CRLF` endings but the one produced by `android:manifest-update` has a mixture of both `CRLF` and `LF` line-endings, which really can't be right if you ask me.\r\n\r\n**Relevant `pom.xml` snippet**\r\n````\r\n<plugin>\r\n\t<groupId>org.codehaus.mojo</groupId>\r\n\t<artifactId>build-helper-maven-plugin</artifactId>\r\n\t<version>1.9.1</version>\r\n\t<executions>\r\n\t\t<execution>\r\n\t\t\t<id>parse-version</id>\r\n\t\t\t<goals>\r\n\t\t\t\t<goal>parse-version</goal>\r\n\t\t\t</goals>\r\n\t\t</execution>\r\n\t</executions>\r\n</plugin>\r\n<plugin>\r\n\t<groupId>com.jayway.maven.plugins.android.generation2</groupId>\r\n\t<artifactId>android-maven-plugin</artifactId>\r\n\t<version>4.0.0-rc.2</version>\r\n\t<configuration>\r\n\t\t<sdk>\r\n\t\t\t<platform>19</platform>\r\n\t\t</sdk>\r\n\t\t<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>\r\n\t\t<mergeManifests>true</mergeManifests>\r\n\t\t<assetsDirectory>${project.basedir}/assets</assetsDirectory>\r\n\t\t<resourceDirectory>${project.basedir}/res</resourceDirectory>\r\n\t\t<release>false</release>\r\n\t\t<classifier>debug</classifier>\r\n\t\t<sign>\r\n\t\t\t<debug>true</debug>\r\n\t\t</sign>\r\n\t</configuration>\r\n\t<extensions>true</extensions>\r\n\t<executions>\r\n\t\t<execution>\r\n\t\t\t<id>default-cli</id>\r\n\t\t\t<!-- the \"default-cli\" id is needed for the configuration below to be used when android:manifest-update is called directly from the command line -->\r\n\t\t\t<phase>process-resources</phase>\r\n\t\t\t<goals>\r\n\t\t\t\t<goal>manifest-update</goal>\r\n\t\t\t</goals>\r\n\t\t\t<configuration>\r\n\t\t\t\t<updatedManifestFile>${project.basedir}/AndroidManifest.xml</updatedManifestFile>\r\n\t\t\t\t<manifest>\r\n\t\t\t\t\t<versionName>${project.version}</versionName>\r\n\t\t\t\t\t<versionCode>${parsedVersion.majorVersion}${parsedVersion.minorVersion}${parsedVersion.incrementalVersion}</versionCode>\r\n\t\t\t\t</manifest>\r\n\t\t\t</configuration>\r\n\t\t</execution>\r\n\t</executions>\r\n</plugin>\r\n````\r\n\r\n**Result**\r\nPlease have a careful look at before-after comparison in the screenshot below.\r\nThe parts with changed line-endings are highlighted in red. The change seems to affect only multi-line XML comments. As you can see `CRLF` becomes `LF` in those. All other lines retain their `CRLF` ending.\r\nIn addition, also highlighted in red, the multi-line comment on top also entirely *loses* the line-ending following `-->`.\r\nJust to be clear the only thing I wanted to achieve by running `android:manifest-update` was to change the `android:versionName` (highlighted in green). Any other changes, especially this line-endings business simply shouldn't happen...\r\n\r\n![androidmanifest xml_before-after](https://cloud.githubusercontent.com/assets/2787305/5095023/bc9cf6c0-6f5d-11e4-9e9e-8d3584e60df3.png)\r\n\r\n**My platform**\r\n````\r\nApache Maven 3.2.3 (33f8c3e1027c3ddde99d3cdebad2656a31e8fdf4; 2014-08-11T21:58:10+01:00)\r\nMaven home: C:\\dev\\Java\\Maven\\bin\\..\r\nJava version: 1.8.0_20, vendor: Oracle Corporation\r\nJava home: C:\\dev\\Java\\JDK\\jre\r\nDefault locale: en_GB, platform encoding: Cp1252\r\nOS name: \"windows 8.1\", version: \"6.3\", arch: \"amd64\", family: \"dos\"\r\n````"},"comment":{"url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/comments/69810380","html_url":"https://github.com/simpligility/android-maven-plugin/issues/511#issuecomment-69810380","issue_url":"https://api.github.com/repos/simpligility/android-maven-plugin/issues/511","id":69810380,"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-13T20:07:22Z","updated_at":"2015-01-13T20:07:22Z","body":"Ah, so the same place a general Android bugs, Sorry. I should have googled ;-).\r\nThanks."}}