Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bb53622ca | ||
|
|
b9308f060f | ||
|
|
f715367849 | ||
|
|
07b757b3c1 | ||
|
|
3325e393bc | ||
|
|
48a8c99c83 | ||
|
|
8d687158f6 | ||
|
|
f966793490 | ||
|
|
d824122219 | ||
|
|
65900b5881 | ||
|
|
e6ed1eab71 | ||
|
|
1a3c31a141 | ||
|
|
c0ef592f72 |
No files matched your search
+4
-9
@@ -1,14 +1,7 @@
|
||||
language: java
|
||||
sudo: false
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
before_deploy:
|
||||
- git config --global user.email ${GITHUB_EMAIL}
|
||||
- git config --global user.name ${GITHUB_NAME}
|
||||
- git tag ${TRAVIS_BUILD_NUMBER}
|
||||
- git push -q ${REPO} --tags
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key: ${DEPLOY_REPO}
|
||||
@@ -20,7 +13,9 @@ deploy:
|
||||
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}.exe
|
||||
- HMCSM/build/libs/HMCSM-${HMCSM_VERSION_ROOT}.${TRAVIS_BUILD_NUMBER}-MacOSApp.zip
|
||||
on:
|
||||
tags: false
|
||||
repo: mclauncher/HMCL
|
||||
branch: master
|
||||
tags: true
|
||||
skip_cleanup: true
|
||||
install: echo "skip 'gradle assemble' step"
|
||||
script: gradle build --continue
|
||||
|
||||
+6
-7
@@ -54,8 +54,7 @@ def readBuildNumber() {
|
||||
|
||||
if (versionPropsFile.canRead()) {
|
||||
versionProps.load(new FileInputStream(versionPropsFile))
|
||||
def code = versionProps['VERSION_CODE'].toInteger() + 1
|
||||
|
||||
def code = versionProps['VERSION_CODE'].toInteger()
|
||||
return code.toString()
|
||||
} else {
|
||||
versionPropsFile.createNewFile()
|
||||
@@ -66,10 +65,10 @@ def readBuildNumber() {
|
||||
def branches = json.getAsJsonArray('branches')
|
||||
if (branches != null && branches.size() > 0) {
|
||||
def info = branches.get(0).getAsJsonObject()
|
||||
def code = info.get('number').getAsInt()
|
||||
versionProps['VERSION_CODE'] = code.toString()
|
||||
def code = info.get('number').getAsInt().toString()
|
||||
versionProps['VERSION_CODE'] = code
|
||||
versionProps.store(versionPropsFile.newWriter(), null)
|
||||
return (code + 1).toString()
|
||||
return code
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,7 +87,7 @@ if (buildnumber == null)
|
||||
|
||||
def versionroot = System.getenv("VERSION_ROOT")
|
||||
if (versionroot == null)
|
||||
versionroot = "2.5.0"
|
||||
versionroot = "2.5.2"
|
||||
|
||||
String mavenGroupId = 'HMCL'
|
||||
String mavenVersion = versionroot + '.' + buildnumber
|
||||
@@ -187,7 +186,7 @@ launch4j {
|
||||
icon = new File(project.buildDir, '../icon.ico').absolutePath
|
||||
version = mavenVersion
|
||||
downloadUrl = 'http://java.com/download'
|
||||
copyright = "Copyright(c) 2013-2015 HMCLSoft."
|
||||
copyright = "Copyright(c) 2013-2016 HMCLSoft."
|
||||
|
||||
jar = new File(project.buildDir, 'libs/' + mavenGroupId + '-' + mavenVersion + '.jar').absolutePath
|
||||
outfile = mavenGroupId + '-' + mavenVersion + '.exe'
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class DynamicDownloadProvider extends MojangDownloadProvider {
|
||||
if (StrUtils.isNotBlank(launcherMetaAddr)) {
|
||||
str = str.replace("https://launchermeta.mojang.com", launcherMetaAddr);
|
||||
}
|
||||
if (StrUtils.isNotBlank(launcherMetaAddr)) {
|
||||
if (StrUtils.isNotBlank(launcherAddr)) {
|
||||
str = str.replace("https://launcher.mojang.com", launcherAddr);
|
||||
}
|
||||
return super.getParsedDownloadURL(str);
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class MojangDownloadProvider extends IDownloadProvider {
|
||||
return str.replace("http://files.minecraftforge.net/maven", "http://ftb.cursecdn.com/FTB2/maven/");
|
||||
else if (str.contains("typesafe") || str.contains("scala"))
|
||||
if (SupportedLocales.NOW_LOCALE.self == Locale.CHINA)
|
||||
return str.replace("http://files.minecraftforge.net/maven", "http://maven.oschina.net/content/groups/public");
|
||||
return str.replace("http://files.minecraftforge.net/maven", "http://maven.aliyun.com/nexus/content/groups/public");
|
||||
else
|
||||
return str.replace("http://files.minecraftforge.net/maven", "http://repo1.maven.org/maven2");
|
||||
else
|
||||
|
||||
+111
-111
@@ -31,122 +31,122 @@ import org.jackhuang.hellominecraft.util.StrUtils;
|
||||
*/
|
||||
public class MinecraftLibrary extends IMinecraftLibrary {
|
||||
|
||||
@SerializedName("rules")
|
||||
public ArrayList<Rules> rules;
|
||||
@SerializedName("url")
|
||||
public String url;
|
||||
@SerializedName("natives")
|
||||
public Natives natives;
|
||||
@SerializedName("extract")
|
||||
public Extract extract;
|
||||
@SerializedName("downloads")
|
||||
public LibrariesDownloadInfo downloads;
|
||||
@SerializedName("rules")
|
||||
public ArrayList<Rules> rules;
|
||||
@SerializedName("url")
|
||||
public String url;
|
||||
@SerializedName("natives")
|
||||
public Natives natives;
|
||||
@SerializedName("extract")
|
||||
public Extract extract;
|
||||
@SerializedName("downloads")
|
||||
public LibrariesDownloadInfo downloads;
|
||||
|
||||
public MinecraftLibrary(String name) {
|
||||
super(name);
|
||||
}
|
||||
public MinecraftLibrary(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public MinecraftLibrary(ArrayList<Rules> rules, String url, Natives natives, String name, Extract extract, LibraryDownloadInfo downloads) {
|
||||
super(name);
|
||||
this.rules = (rules == null) ? null : (ArrayList<Rules>) rules.clone();
|
||||
this.url = url;
|
||||
this.natives = (natives == null) ? null : (Natives) natives.clone();
|
||||
this.extract = (extract == null) ? null : (Extract) extract.clone();
|
||||
}
|
||||
public MinecraftLibrary(ArrayList<Rules> rules, String url, Natives natives, String name, Extract extract, LibraryDownloadInfo downloads) {
|
||||
super(name);
|
||||
this.rules = (rules == null) ? null : (ArrayList<Rules>) rules.clone();
|
||||
this.url = url;
|
||||
this.natives = (natives == null) ? null : (Natives) natives.clone();
|
||||
this.extract = (extract == null) ? null : (Extract) extract.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean allow() {
|
||||
if (rules != null) {
|
||||
boolean flag = false;
|
||||
for (Rules r : rules) {
|
||||
if ("disallow".equals(r.action()))
|
||||
return false;
|
||||
else if ("allow".equals(r.action()))
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private String formatArch(String nati) {
|
||||
return nati == null ? "" : nati.replace("${arch}", Platform.getPlatform().getBit());
|
||||
}
|
||||
|
||||
private String getNative() {
|
||||
switch (OS.os()) {
|
||||
case WINDOWS:
|
||||
return formatArch(natives.windows);
|
||||
case OSX:
|
||||
return formatArch(natives.osx);
|
||||
default:
|
||||
return formatArch(natives.linux);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRequiredToUnzip() {
|
||||
return natives != null && allow();
|
||||
}
|
||||
|
||||
public String formatName() {
|
||||
String[] s = name.split(":");
|
||||
if (s.length < 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(s[0].replace('.', '/')).append('/').append(s[1]).append('/').append(s[2]).append('/').append(s[1]).append('-').append(s[2]);
|
||||
if (natives != null) {
|
||||
sb.append('-').append(getNative());
|
||||
}
|
||||
|
||||
return sb.append(".jar").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFilePath(File gameDir) {
|
||||
LibraryDownloadInfo info = getDownloadInfo();
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
return new File(gameDir, "libraries/" + info.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Extract getDecompressExtractRules() {
|
||||
return extract == null ? new Extract() : extract;
|
||||
}
|
||||
|
||||
public LibraryDownloadInfo getDownloadInfo() {
|
||||
if (downloads == null) {
|
||||
downloads = new LibrariesDownloadInfo();
|
||||
}
|
||||
|
||||
LibraryDownloadInfo info = null;
|
||||
if (natives != null) {
|
||||
if (downloads.classifiers == null) {
|
||||
downloads.classifiers = new HashMap<>();
|
||||
} else {
|
||||
if (!downloads.classifiers.containsKey(getNative())) {
|
||||
downloads.classifiers.put(getNative(), info = new LibraryDownloadInfo());
|
||||
} else {
|
||||
info = downloads.classifiers.get(getNative());
|
||||
@Override
|
||||
public boolean allow() {
|
||||
if (rules != null) {
|
||||
boolean flag = false;
|
||||
for (Rules r : rules) {
|
||||
if ("disallow".equals(r.action())) {
|
||||
return false;
|
||||
} else if ("allow".equals(r.action())) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
} else if (downloads.artifact == null) {
|
||||
downloads.artifact = info = new LibraryDownloadInfo();
|
||||
} else {
|
||||
info = downloads.artifact;
|
||||
return flag;
|
||||
}
|
||||
|
||||
if (StrUtils.isBlank(info.path)) {
|
||||
info.path = formatName();
|
||||
if (info.path == null) {
|
||||
return null;
|
||||
return true;
|
||||
}
|
||||
|
||||
private String formatArch(String nati) {
|
||||
return nati == null ? "" : nati.replace("${arch}", Platform.getPlatform().getBit());
|
||||
}
|
||||
|
||||
private String getNative() {
|
||||
switch (OS.os()) {
|
||||
case WINDOWS:
|
||||
return formatArch(natives.windows);
|
||||
case OSX:
|
||||
return formatArch(natives.osx);
|
||||
default:
|
||||
return formatArch(natives.linux);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRequiredToUnzip() {
|
||||
return natives != null && allow();
|
||||
}
|
||||
|
||||
public String formatName() {
|
||||
String[] s = name.split(":");
|
||||
if (s.length < 3) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(s[0].replace('.', '/')).append('/').append(s[1]).append('/').append(s[2]).append('/').append(s[1]).append('-').append(s[2]);
|
||||
if (natives != null) {
|
||||
sb.append('-').append(getNative());
|
||||
}
|
||||
|
||||
return sb.append(".jar").toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFilePath(File gameDir) {
|
||||
LibraryDownloadInfo info = getDownloadInfo();
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
return new File(gameDir, "libraries/" + info.path);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Extract getDecompressExtractRules() {
|
||||
return extract == null ? new Extract() : extract;
|
||||
}
|
||||
|
||||
public LibraryDownloadInfo getDownloadInfo() {
|
||||
if (downloads == null) {
|
||||
downloads = new LibrariesDownloadInfo();
|
||||
}
|
||||
|
||||
LibraryDownloadInfo info = null;
|
||||
if (natives != null) {
|
||||
if (downloads.classifiers == null) {
|
||||
downloads.classifiers = new HashMap<>();
|
||||
}
|
||||
}
|
||||
|
||||
info.forgeURL = this.url;
|
||||
return info;
|
||||
}
|
||||
if (!downloads.classifiers.containsKey(getNative())) {
|
||||
downloads.classifiers.put(getNative(), info = new LibraryDownloadInfo());
|
||||
} else {
|
||||
info = downloads.classifiers.get(getNative());
|
||||
}
|
||||
} else if (downloads.artifact == null) {
|
||||
downloads.artifact = info = new LibraryDownloadInfo();
|
||||
} else {
|
||||
info = downloads.artifact;
|
||||
}
|
||||
|
||||
if (StrUtils.isBlank(info.path)) {
|
||||
info.path = formatName();
|
||||
if (info.path == null) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
info.forgeURL = this.url;
|
||||
return info;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 5.2 KiB |
Reference in new issue
Block a user