Compare commits

...
13 Commits
Author SHA1 Message Date
南宫临风 5bb53622ca Update HMCL version 2016-08-18 11:36:36 +08:00
南宫临风 b9308f060f oschina的Maven下载失效 2016-08-18 11:25:03 +08:00
南宫临风 f715367849 Update HMCL version 2016-07-12 19:07:15 +08:00
南宫临风 07b757b3c1 try fix travis 2016-07-12 18:03:04 +08:00
南宫临风 3325e393bc try fix travis file 2016-07-12 17:51:07 +08:00
南宫临风 48a8c99c83 Update travis 2016-07-12 16:17:09 +08:00
南宫临风 8d687158f6 Update travis 2016-07-12 15:28:55 +08:00
南宫临风 f966793490 Fix travis 2016-07-12 15:06:03 +08:00
南宫临风 d824122219 Fix travis-ci file 2016-07-12 14:49:32 +08:00
南宫临风 65900b5881 update tag style 2016-07-12 14:37:13 +08:00
南宫临风 e6ed1eab71 难用的travis-ci 2016-07-12 14:34:14 +08:00
南宫临风 1a3c31a141 Fix Library resolve bug 2016-07-12 14:17:17 +08:00
南宫临风 c0ef592f72 Restore icon and must manually add tag 2016-07-12 10:37:18 +08:00
7 changed files with 123 additions and 129 deletions

No files matched your search

+4 -9
View File
@@ -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
View File
@@ -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'
@@ -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);
@@ -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
@@ -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