Update for CI.

This commit is contained in:
huanghongxun 2015-07-31 18:06:31 +08:00
parent 022c1ade39
commit 4a167253db
7 changed files with 682 additions and 619 deletions

View File

@ -25,8 +25,11 @@ if (!hasProperty('mainClass')) {
ext.mainClass = 'org.jackhuang.hellominecraft.launcher.Main'
}
def buildnumber = System.getenv("BUILD_NUMBER") == null ? "" : "-"+System.getenv("BUILD_NUMBER")
String mavenGroupId = 'HMCL'
String mavenVersion = '2.3.3'
String mavenVersion = '2.3.3' + buildnumber
String bundleName = "Hello Minecraft! Launcher"
group = mavenGroupId

File diff suppressed because it is too large Load Diff

View File

@ -77,12 +77,24 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
if (v.hasJavaArgs())
res.addAll(Arrays.asList(StrUtils.tokenize(v.getJavaArgs())));
if (!v.isNoJVMArgs() && !(jv != null && jv.isEarlyAccess())) {
res.add("-XX:+UseConcMarkSweepGC");
res.add("-XX:+CMSIncrementalMode");
res.add("-XX:-UseAdaptiveSizePolicy");
if (!v.isNoJVMArgs()) {
appendJVMArgs(res);
res.add("-Xmn128m");
if (jv == null || !jv.isEarlyAccess()) {
if (OS.os() == OS.WINDOWS)
res.add("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump");
res.add("-XX:+UseConcMarkSweepGC");
res.add("-XX:+CMSIncrementalMode");
res.add("-XX:-UseAdaptiveSizePolicy");
res.add("-XX:-OmitStackTraceInFastThrow");
res.add("-Xmn128m");
}
if (!StrUtils.isBlank(v.getPermSize()))
if (jv == null || jv.getParsedVersion() < JdkVersion.JAVA_18)
res.add("-XX:PermSize=" + v.getPermSize() + "m");
else if (jv.getParsedVersion() >= JdkVersion.JAVA_18)
res.add("-XX:MetaspaceSize=" + v.getPermSize() + "m");
}
if (jv != null) {
@ -109,13 +121,6 @@ public abstract class AbstractMinecraftLoader implements IMinecraftLoader {
res.add(a);
}
if (!StrUtils.isBlank(v.getPermSize()) && !v.isNoJVMArgs())
if (jv != null && jv.getParsedVersion() >= JdkVersion.JAVA_18); else res.add("-XX:MaxPermSize=" + v.getPermSize() + "m");
if (!v.isNoJVMArgs()) appendJVMArgs(res);
HMCLog.log("On making java.library.path.");
res.add("-Djava.library.path=" + provider.getDecompressNativesToLocation().getPath());
res.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
res.add("-Dfml.ignorePatchDiscrepancies=true");

View File

@ -0,0 +1,43 @@
/*
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
*/
package org.jackhuang.hellominecraft.launcher.utils;
import java.io.File;
import javax.swing.filechooser.FileFilter;
/**
*
* @author huangyuhui
*/
public class FileNameFilter extends FileFilter {
String acceptedName;
public FileNameFilter(String acceptedName) {
this.acceptedName = acceptedName;
}
@Override
public boolean accept(File f) {
return f.isDirectory() || f.getName().equals(acceptedName);
}
@Override
public String getDescription() {
return acceptedName;
}
}

View File

@ -27,7 +27,7 @@
<Component id="btnIncludeMinecraft" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
<Component id="tabVersionEdit" alignment="0" pref="684" max="32767" attributes="0"/>
<Component id="tabVersionEdit" alignment="0" max="32767" attributes="0"/>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">

View File

@ -32,6 +32,8 @@ import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import javax.swing.table.DefaultTableModel;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
@ -48,6 +50,7 @@ import org.jackhuang.hellominecraft.launcher.utils.installers.optifine.vanilla.O
import org.jackhuang.hellominecraft.launcher.utils.download.DownloadType;
import org.jackhuang.hellominecraft.launcher.settings.Profile;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
import org.jackhuang.hellominecraft.launcher.utils.FileNameFilter;
import org.jackhuang.hellominecraft.launcher.version.GameDirType;
import org.jackhuang.hellominecraft.launcher.version.MinecraftVersion;
import org.jackhuang.hellominecraft.tasks.Task;
@ -1125,6 +1128,9 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.i18n("settings.choose_javapath"));
fc.setMultiSelectionEnabled(false);
fc.setFileFilter(new FileNameFilter("javaw.exe"));
fc.addChoosableFileFilter(new FileNameFilter("java.exe"));
fc.addChoosableFileFilter(new FileNameFilter("java"));
fc.showOpenDialog(this);
if (fc.getSelectedFile() == null)
return;
@ -1133,7 +1139,7 @@ btnRefreshLiteLoader.addActionListener(new java.awt.event.ActionListener() {
txtJavaDir.setText(path);
profile.setJavaDir(txtJavaDir.getText());
} catch (IOException e) {
HMCLog.warn("Failed to set background path.", e);
HMCLog.warn("Failed to set java path.", e);
MessageBox.Show(C.i18n("ui.label.failed_set") + e.getMessage());
}
}//GEN-LAST:event_btnChoosingJavaDirActionPerformed

View File

@ -20,6 +20,7 @@ import java.awt.Color;
import java.io.IOException;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;
import org.jackhuang.hellominecraft.C;
import org.jackhuang.hellominecraft.HMCLog;
import org.jackhuang.hellominecraft.launcher.settings.Settings;
@ -258,6 +259,8 @@ public class LauncherSettingsPanel extends javax.swing.JPanel {
fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
fc.setDialogTitle(C.i18n("launcher.choose_bgpath"));
fc.setMultiSelectionEnabled(false);
fc.setFileFilter(new FileNameExtensionFilter("*.png", "png"));
fc.addChoosableFileFilter(new FileNameExtensionFilter("*.jpg", "jpg"));
fc.showOpenDialog(this);
if (fc.getSelectedFile() == null)
return;