zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 45 forks source link

Add version to fatjar, stop plugin from crashing if version is missing #53

Closed vexorian closed 10 years ago

vexorian commented 10 years ago

build.gradle Fixes the issues I was having after the build was updated. The other commit just allows to detect this issue if it happens again.

wookayin commented 10 years ago

Nice fix! (BTW manual handling of null streams is better rather than catching NPE)

However, the root cause seems to be (from 6ae9e5e1)

readVersionFromStream(new FileInputStream("version"))

we shouldn't depend on the version file (from the root of the project working directory) on runtime, because it is just for build informations. How about this?

vexorian commented 10 years ago

That line is only called when development mode is on. Since I was using a jar, the error comes from AppInfo.class.getResourceAsStream("/version") which fails if there is no /verion in the jar.

zen0wu commented 10 years ago

Very COOL! I was taking some time to see how to package "version" into the jar, didn't find out. Awesome fix for the build.gradle!