Fix for CIs.
This commit is contained in:
parent
3011075f9c
commit
71e70884ce
5 changed files with 18 additions and 18 deletions
|
@ -73,7 +73,7 @@ tasks.withType(SpotBugsTask) {
|
||||||
xml.enabled = false
|
xml.enabled = false
|
||||||
html.enabled = true
|
html.enabled = true
|
||||||
}
|
}
|
||||||
excludeFilter = file("config/spotbugs/excludeFilter.xml")
|
excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml")
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
|
|
|
@ -18,12 +18,12 @@ public final class ReleaseInfo {
|
||||||
|
|
||||||
public final static String PROJECT = "mobibot";
|
public final static String PROJECT = "mobibot";
|
||||||
public final static LocalDateTime BUILDDATE =
|
public final static LocalDateTime BUILDDATE =
|
||||||
LocalDateTime.ofInstant(Instant.ofEpochMilli(1531553255553L), ZoneId.systemDefault());
|
LocalDateTime.ofInstant(Instant.ofEpochMilli(1531606310641L), ZoneId.systemDefault());
|
||||||
public final static int MAJOR = 0;
|
public final static int MAJOR = 0;
|
||||||
public final static int MINOR = 7;
|
public final static int MINOR = 7;
|
||||||
public final static int PATCH = 3;
|
public final static int PATCH = 3;
|
||||||
public final static String PRERELEASE = "beta";
|
public final static String PRERELEASE = "beta";
|
||||||
public final static String BUILDMETA = "006";
|
public final static String BUILDMETA = "009";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The full version string.
|
* The full version string.
|
||||||
|
|
|
@ -80,6 +80,17 @@ public class Weather2 extends AbstractModule {
|
||||||
return Math.round(d) + " \u00B0F, " + Math.round(c) + " \u00B0C";
|
return Math.round(d) + " \u00B0F, " + Math.round(c) + " \u00B0C";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private OWM.Country getCountry(String countryCode) {
|
||||||
|
for (OWM.Country c : OWM.Country.values()) {
|
||||||
|
if (c.name().equalsIgnoreCase(countryCode)) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return OWM.Country.UNITED_STATES;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +101,7 @@ public class Weather2 extends AbstractModule {
|
||||||
bot.send(sender, "For example:");
|
bot.send(sender, "For example:");
|
||||||
bot.send(sender, bot.helpIndent(bot.getNick() + ": " + WEATHER_CMD + " paris, fr"));
|
bot.send(sender, bot.helpIndent(bot.getNick() + ": " + WEATHER_CMD + " paris, fr"));
|
||||||
bot.send(sender, "The default ISO 3166 country code is " + Utils.bold("US")
|
bot.send(sender, "The default ISO 3166 country code is " + Utils.bold("US")
|
||||||
+ ". Zip codes are supported in the US.");
|
+ ". Zip codes are supported in most countries.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,7 +133,7 @@ public class Weather2 extends AbstractModule {
|
||||||
try {
|
try {
|
||||||
final CurrentWeather cwd;
|
final CurrentWeather cwd;
|
||||||
if (city.matches("\\d+")) {
|
if (city.matches("\\d+")) {
|
||||||
cwd = owm.currentWeatherByZipCode(Integer.parseInt(city), OWM.Country.UNITED_STATES);
|
cwd = owm.currentWeatherByZipCode(Integer.parseInt(city), getCountry(country));
|
||||||
} else {
|
} else {
|
||||||
cwd = owm.currentWeatherByCityName(city, getCountry(country));
|
cwd = owm.currentWeatherByCityName(city, getCountry(country));
|
||||||
}
|
}
|
||||||
|
@ -184,15 +195,4 @@ public class Weather2 extends AbstractModule {
|
||||||
final double kmh = w * 1.60934;
|
final double kmh = w * 1.60934;
|
||||||
return Math.round(w) + " mph, " + Math.round(kmh) + " km/h";
|
return Math.round(w) + " mph, " + Math.round(kmh) + " km/h";
|
||||||
}
|
}
|
||||||
|
|
||||||
private OWM.Country getCountry(String countryCode) {
|
|
||||||
for (OWM.Country c : OWM.Country.values()) {
|
|
||||||
if (c.name().equalsIgnoreCase(countryCode)) {
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return OWM.Country.UNITED_STATES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Generated by the Semver Plugin for Gradle
|
#Generated by the Semver Plugin for Gradle
|
||||||
#Sat Jul 14 00:27:34 PDT 2018
|
#Sat Jul 14 15:11:49 PDT 2018
|
||||||
version.buildmeta=006
|
version.buildmeta=009
|
||||||
version.major=0
|
version.major=0
|
||||||
version.minor=7
|
version.minor=7
|
||||||
version.patch=3
|
version.patch=3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue