mirror of
https://github.com/chylex/Java-Checker.git
synced 2025-08-30 00:53:09 +02:00
Updated to MC 1.8 and added Java8 version
This commit is contained in:
47
build.gradle
47
build.gradle
@@ -18,12 +18,13 @@ buildscript {
|
|||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
|
||||||
version = ""
|
version = ""
|
||||||
group= "chylex.java7check" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
|
group = "chylex.java7check"
|
||||||
archivesBaseName = "Java7Checker"
|
archivesBaseName = "Java7Checker MC-1.8 v1.1"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.7.10-10.13.0.1184"
|
version = "1.8-11.14.1.1306"
|
||||||
assetDir = "eclipse/assets"
|
assetDir = "eclipse/assets"
|
||||||
|
mappings = "snapshot_nodoc_20141130"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
@@ -32,38 +33,28 @@ jar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
processResources {
|
||||||
// you may put jars on which you depend on in ./libs
|
|
||||||
// or you may define them like so..
|
|
||||||
//compile "some.group:artifact:version:classifier"
|
|
||||||
//compile "some.group:artifact:version"
|
|
||||||
|
|
||||||
// real examples
|
|
||||||
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
|
||||||
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
|
||||||
|
|
||||||
// for more info...
|
|
||||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
|
||||||
// http://www.gradle.org/docs/current/userguide/dependency_management.html
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
processResources
|
|
||||||
{
|
|
||||||
// this will ensure that this task is redone when the versions change.
|
|
||||||
inputs.property "version", project.version
|
inputs.property "version", project.version
|
||||||
inputs.property "mcversion", project.minecraft.version
|
inputs.property "mcversion", project.minecraft.version
|
||||||
|
|
||||||
// replace stuff in mcmod.info, nothing else
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include 'mcmod.info'
|
include 'mcmod.info'
|
||||||
|
|
||||||
// replace version and mcversion
|
|
||||||
expand 'version':project.version, 'mcversion':project.minecraft.version
|
expand 'version':project.version, 'mcversion':project.minecraft.version
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy everything else, thats not the mcmod.info
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
exclude 'mcmod.info'
|
exclude 'mcmod.info'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
task java8Jar(type: Jar, dependsOn "jar") {
|
||||||
|
from sourceSets.main.output
|
||||||
|
manifest { your manifest stuff here}
|
||||||
|
}
|
||||||
|
|
||||||
|
reobf{
|
||||||
|
reobf java8Jar { classpath -> classpath = confgurations.compile }
|
||||||
|
}
|
@@ -1,28 +0,0 @@
|
|||||||
package chylex.java7check;
|
|
||||||
import java.util.Map;
|
|
||||||
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
|
|
||||||
|
|
||||||
public class JavaCheckerCoremod implements IFMLLoadingPlugin{
|
|
||||||
@Override
|
|
||||||
public String[] getASMTransformerClass(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getAccessTransformerClass(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getModContainerClass(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getSetupClass(){
|
|
||||||
return "chylex.java7check.report.JavaCheckerReporter";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void injectData(Map<String,Object> data){}
|
|
||||||
}
|
|
18
src/main/java/chylex/javacheck/Java7CheckerCoremod.java
Normal file
18
src/main/java/chylex/javacheck/Java7CheckerCoremod.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package chylex.javacheck;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||||
|
import org.apache.commons.lang3.JavaVersion;
|
||||||
|
import chylex.javacheck.report.JavaCheckerReporter;
|
||||||
|
|
||||||
|
public class Java7CheckerCoremod implements IFMLLoadingPlugin{
|
||||||
|
@Override
|
||||||
|
public String getSetupClass(){
|
||||||
|
JavaCheckerReporter.minVersion = JavaVersion.JAVA_1_7;
|
||||||
|
return "chylex.javacheck.report.JavaCheckerReporter";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public String[] getASMTransformerClass(){ return null; }
|
||||||
|
@Override public String getAccessTransformerClass(){ return null; }
|
||||||
|
@Override public String getModContainerClass(){ return null; }
|
||||||
|
@Override public void injectData(Map<String,Object> data){}
|
||||||
|
}
|
18
src/main/java/chylex/javacheck/Java8CheckerCoremod.java
Normal file
18
src/main/java/chylex/javacheck/Java8CheckerCoremod.java
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
package chylex.javacheck;
|
||||||
|
import java.util.Map;
|
||||||
|
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
|
||||||
|
import org.apache.commons.lang3.JavaVersion;
|
||||||
|
import chylex.javacheck.report.JavaCheckerReporter;
|
||||||
|
|
||||||
|
public class Java8CheckerCoremod implements IFMLLoadingPlugin{
|
||||||
|
@Override
|
||||||
|
public String getSetupClass(){
|
||||||
|
JavaCheckerReporter.minVersion = JavaVersion.JAVA_1_8;
|
||||||
|
return "chylex.javacheck.report.JavaCheckerReporter";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public String[] getASMTransformerClass(){ return null; }
|
||||||
|
@Override public String getAccessTransformerClass(){ return null; }
|
||||||
|
@Override public String getModContainerClass(){ return null; }
|
||||||
|
@Override public void injectData(Map<String,Object> data){}
|
||||||
|
}
|
@@ -1,15 +1,17 @@
|
|||||||
package chylex.java7check.report;
|
package chylex.javacheck.report;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
|
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
|
||||||
|
import net.minecraftforge.fml.relauncher.IFMLCallHook;
|
||||||
import org.apache.commons.lang3.JavaVersion;
|
import org.apache.commons.lang3.JavaVersion;
|
||||||
import org.apache.commons.lang3.SystemUtils;
|
import org.apache.commons.lang3.SystemUtils;
|
||||||
import cpw.mods.fml.relauncher.FMLRelaunchLog;
|
|
||||||
import cpw.mods.fml.relauncher.IFMLCallHook;
|
|
||||||
|
|
||||||
public final class JavaCheckerReporter implements IFMLCallHook{
|
public final class JavaCheckerReporter implements IFMLCallHook{
|
||||||
|
public static JavaVersion minVersion = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Void call() throws Exception{
|
public Void call() throws Exception{
|
||||||
if (!SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_1_7)){
|
if (!SystemUtils.isJavaVersionAtLeast(minVersion)){
|
||||||
FMLRelaunchLog.severe(getConsoleReport());
|
FMLRelaunchLog.severe(getConsoleReport());
|
||||||
JOptionPane.showMessageDialog(null, "<html>"+getWindowReport()+"</html>","Outdated Java",JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(null, "<html>"+getWindowReport()+"</html>","Outdated Java",JOptionPane.ERROR_MESSAGE);
|
||||||
throw new OutdatedJavaException();
|
throw new OutdatedJavaException();
|
@@ -1,4 +1,4 @@
|
|||||||
package chylex.java7check.report;
|
package chylex.javacheck.report;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
@@ -1,14 +1,11 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid": "Java7Checker",
|
"modid": "JavaVersionChecker",
|
||||||
"name": "Java 7 Checker",
|
"name": "Java Version Checker",
|
||||||
"description": "If you see this description inside Minecraft, then you're fine!",
|
"description": "Nobody ever sees this!",
|
||||||
"version": "1.0",
|
"version": "1.1",
|
||||||
"url": "",
|
"authorList": [ "chylex" ],
|
||||||
"updateUrl": "",
|
"url": "http://chylex.com",
|
||||||
"authorList": ["chylex"],
|
"updateUrl": ""
|
||||||
"logoFile": "",
|
|
||||||
"screenshots": [],
|
|
||||||
"dependencies": []
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user