-
Notifications
You must be signed in to change notification settings - Fork 378
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
Do not bundle README.txt in class jars #246
Comments
I am having the same issue. Temporary workaround is to downgrade hamcrest back to 1.3
|
The README.txt is there to give people a hint that the jar is deprecated, and you should update your dependencies. Is there any reason why you can't remove the |
The documentation says that both artifacts are required for compatibility with JUnit 4.12. |
It's a bit more subtle than that. Neither |
If I understand you correctly, you are saying that including hamcrest-core-2.1 and hamcrest-library-2.1 provides an automated version conflict resolution mechanism when using JUnit 4.12, and it is possible to achieve the same result by manually excluding specific dependencies in Gradle build files. Is that what you mean? It would seem appropriate to actually make the automated mechanism work, instead of suggesting how to not use it. Or blame D8 if you think it's defective and wait for a fix, but it would seem so much easier for everyone to remove the offending files from the jars; I don't know a lot of developers these days who crack open binary jars in their Gradle builds to look for usage instructions. |
The version conflict resolution mechanism is working, and correctly pulling in all the dependencies. However, you appear to be doing something with all the dependencies that breaks your build. There's a long stack trace above which seems to imply that the build is trying to merge all the dependant jars into a single file, and hence getting the conflict. Is that correct? What is the merge for? Can you avoid merging all the jars? |
The tool that is doing the merge is D8, it's a non-optional Android build tool. All Gradle builds of Android apps using hamcrest 2.1 and JUnit 4.12 with the suggested conflict resolution mechanism are bound to fail. |
I'm curious to see what this looks like. Can you point me towards and example? |
I believe you'd have to install a recent Android Studio version or the Android SDK to get this to work; that may be somewhat time-consuming. |
How about we rename the README.txt to DEPRECATED.txt? |
Of course, the amusing part is that we get no support or interest from Google who rely on our free effort. |
From what I understand, having the a file with the same name in both jars will always be a problem. I've just pushed a commit which will give the files different names, and hopefully resolve this issue (after the next release, of course) |
I built and tested a snapshot and can confirm that this change resolved the issue. |
Thanks for confirming, @bubenheimer. I've just updated the CHANGES.md, so I'll close this issue now. |
Just FYI: as of right now I am able to build with the original hamcrest 2.1 artifacts again. I suspect Google changed the behavior of the D8 tool, but it could be a temporary fluke in my build process. |
Not working for me with D8
|
Did you use the latest D8, though? I'm on AS 3.6 Canary 3 |
Both
hamcrest-core-2.1.jar
andhamcrest-library-2.1.jar
containREADME.txt
, which prevents me from running Android tests due to a name clash.The text was updated successfully, but these errors were encountered: