Use README.md in details for repo

This commit is contained in:
topjohnwu
2017-02-16 05:45:31 +08:00
parent d1c939f48a
commit a03bb90754
25 changed files with 147 additions and 347 deletions
@@ -9,8 +9,7 @@ import java.util.List;
public abstract class BaseModule implements Comparable<BaseModule> {
protected String mId, mName, mVersion, mAuthor, mDescription, mSupportUrl, mDonateUrl;
protected boolean mIsCacheModule = false;
protected String mId, mName, mVersion, mAuthor, mDescription;
protected int mVersionCode = 0;
protected void parseProps(List<String> props) throws CacheModException { parseProps(props.toArray(new String[props.size()])); }
@@ -48,21 +47,14 @@ public abstract class BaseModule implements Comparable<BaseModule> {
case "description":
this.mDescription = prop[1];
break;
case "support":
this.mSupportUrl = prop[1];
break;
case "donate":
this.mDonateUrl = prop[1];
break;
case "cacheModule":
this.mIsCacheModule = Boolean.parseBoolean(prop[1]);
if (Boolean.parseBoolean(prop[1]))
throw new CacheModException(mId);
break;
default:
break;
}
}
if (mIsCacheModule)
throw new CacheModException(mId);
}
public String getName() {
@@ -77,7 +69,9 @@ public abstract class BaseModule implements Comparable<BaseModule> {
return mAuthor;
}
public String getId() {return mId; }
public String getId() {
return mId;
}
public String getDescription() {
return mDescription;
@@ -87,14 +81,6 @@ public abstract class BaseModule implements Comparable<BaseModule> {
return mVersionCode;
}
public String getDonateUrl() {
return mDonateUrl;
}
public String getSupportUrl() {
return mSupportUrl;
}
public static class CacheModException extends Exception {
public CacheModException(String id) {
Logger.error("Cache mods are no longer supported! id: " + id);
@@ -42,8 +42,6 @@ public class Repo extends BaseModule {
public void update(Date lastUpdate) throws CacheModException {
Logger.dev("Repo: Local: " + mLastUpdate + " Remote: " + lastUpdate);
if (mIsCacheModule)
throw new CacheModException(mId);
if (lastUpdate.after(mLastUpdate)) {
mLastUpdate = lastUpdate;
update();
@@ -75,6 +73,10 @@ public class Repo extends BaseModule {
return String.format(FILE_URL, repoName, "module.prop");
}
public String getDetailUrl() {
return String.format(FILE_URL, repoName, "README.md");
}
public Date getLastUpdate() {
return mLastUpdate;
}