mirror of
https://github.com/chylex/Java-Checker.git
synced 2025-07-24 02:59:01 +02:00
Add a version of Java Checker for shading
This commit is contained in:
parent
5bdd2d965d
commit
abc0d3d959
@ -44,11 +44,18 @@ task java8Jar(type: Jar, dependsOn: "jar"){
|
|||||||
archiveName = "Java8Checker"+archiveSuffix
|
archiveName = "Java8Checker"+archiveSuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task shadeJar(type: Jar, dependsOn: "jar"){
|
||||||
|
from sourceSets.main.output
|
||||||
|
|
||||||
|
archiveName = "JavaCheckerShade"+archiveSuffix
|
||||||
|
}
|
||||||
|
|
||||||
jar.enabled = false
|
jar.enabled = false
|
||||||
|
|
||||||
reobf{
|
reobf{
|
||||||
reobf java7Jar{ classpath -> classpath = configurations.compile }
|
reobf java7Jar{ classpath -> classpath = configurations.compile }
|
||||||
reobf java8Jar{ classpath -> classpath = configurations.compile }
|
reobf java8Jar{ classpath -> classpath = configurations.compile }
|
||||||
|
reobf shadeJar{ classpath -> classpath = configurations.compile }
|
||||||
}
|
}
|
||||||
|
|
||||||
reobf.enabled = false
|
reobf.enabled = false
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package chylex.javacheck.report;
|
package chylex.javacheck.report;
|
||||||
import java.awt.Desktop;
|
import java.awt.Desktop;
|
||||||
import java.awt.Font;
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@ -41,6 +42,19 @@ public final class JavaCheckerReporter{
|
|||||||
JOptionPane.showMessageDialog(null,pane,"Outdated Java",JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(null,pane,"Outdated Java",JOptionPane.ERROR_MESSAGE);
|
||||||
throw new OutdatedJavaException();
|
throw new OutdatedJavaException();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
try{
|
||||||
|
Class cmm = findCoreModManager();
|
||||||
|
List coremods = (List)cmm.getMethod("getLoadedCoremods").invoke(null);
|
||||||
|
List reparsed = (List)cmm.getMethod("getReparseableCoremods").invoke(null);
|
||||||
|
|
||||||
|
String myFile = new File(JavaCheckerReporter.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getName();
|
||||||
|
coremods.remove(myFile);
|
||||||
|
reparsed.add(myFile);
|
||||||
|
}catch(Throwable t){
|
||||||
|
t.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getConsoleReport(JavaVersion minVersion){
|
private static String getConsoleReport(JavaVersion minVersion){
|
||||||
@ -72,4 +86,16 @@ public final class JavaCheckerReporter{
|
|||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Class findCoreModManager() throws Throwable{
|
||||||
|
try{
|
||||||
|
return Class.forName("cpw.mods.fml.relauncher.CoreModManager");
|
||||||
|
}catch(ClassNotFoundException e){}
|
||||||
|
|
||||||
|
try{
|
||||||
|
return Class.forName("net.minecraftforge.fml.relauncher.CoreModManager");
|
||||||
|
}catch(ClassNotFoundException e){}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user