Skip to content

Commit

Permalink
fixed a few bugs with the version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
AbrarSyed committed Aug 9, 2015
1 parent 4cd84cb commit db14487
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public BaseExtension(BasePlugin<? extends BaseExtension> plugin)
try
{
URL url = BaseExtension.class.getClassLoader().getResource("forgegradle.version.txt");
version = Resources.toString(url, Constants.CHARSET);
version = Resources.toString(url, Constants.CHARSET).trim();

if (version.equals("${version}"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ protected void doFGVersionCheck(List<String> outLines)

if (webVersion == null || webVersion.status == FGBuildStatus.FINE)
{
System.out.println("NULL OR FINE");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ protected void onVersionCheck(FGVersion version, FGVersionWrapper wrapper)
int maxBuild = version.ext.get("forgeMaxBuild").getAsInt();

if (buildNum < minBuild)
throw new GradleConfigurationException("This version of FOrgeGradle ("+getExtension().forgeGradleVersion+") does not support forge builds less than #"+minBuild);
throw new GradleConfigurationException("This version of ForgeGradle ("+getExtension().forgeGradleVersion+") does not support forge builds less than #"+minBuild);
else if (buildNum > maxBuild)
throw new GradleConfigurationException("This version of FOrgeGradle ("+getExtension().forgeGradleVersion+") does not support forge builds greater than #"+maxBuild);
throw new GradleConfigurationException("This version of ForgeGradle ("+getExtension().forgeGradleVersion+") does not support forge builds greater than #"+maxBuild);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package net.minecraftforge.gradle.util.json.fgversion;

import java.util.Arrays;

import com.google.gson.JsonObject;

public class FGVersion
Expand All @@ -9,4 +11,10 @@ public class FGVersion
public FGBuildStatus status;
public int index;
public JsonObject ext;

@Override
public String toString()
{
return "FGVersion [version=" + version + ", docUrl=" + docUrl + ", changes=" + Arrays.toString(changes) + ", bugs=" + Arrays.toString(bugs) + ", status=" + status + ", index=" + index + ", ext=" + ext + "]";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ public class FGVersionWrapper
{
public List<String> versions = Lists.newArrayList();
public Map<String, FGVersion> versionObjects = Maps.newHashMap();

@Override
public String toString()
{
return "FGVersionWrapper [versions=" + versions + ", versionObjects=" + versionObjects + "]";
}
}
2 changes: 1 addition & 1 deletion versionCheck/ForgeGradleVersion.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"bugs": [
],
"pluginSpecific": {
"ext": {
"forgeMinBuild": "1234",
"forgeMaxBuild": "1234"
}
Expand Down
2 changes: 1 addition & 1 deletion versionCheck/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ result.eachWithIndex { version, index ->
}
}
// check 'broken' status
else if (version.status == "BROKEN" && version.bugs.isEmpty())
else if (version.status == "BROKEN")
{
if (!version.bugs)
{
Expand Down

0 comments on commit db14487

Please sign in to comment.