Skip to content

Commit

Permalink
Organise imports and add formatter settings to project
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumfrey committed Jan 7, 2016
1 parent fb2360c commit 8c6be0e
Show file tree
Hide file tree
Showing 21 changed files with 351 additions and 44 deletions.
295 changes: 295 additions & 0 deletions extra/formatter.xml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions extra/mixin.importorder
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Organize Import Order
#Thu Jan 07 16:47:26 GMT 2016
4=com
3=org
2=javax
1=java
0=\#
15 changes: 8 additions & 7 deletions src/agent/java/org/spongepowered/tools/agent/MixinAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
*/
package org.spongepowered.tools.agent;

import net.minecraft.launchwrapper.Launch;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.transformer.MixinReloadException;
import org.spongepowered.asm.mixin.transformer.MixinTransformer;
import org.spongepowered.asm.mixin.transformer.debug.IHotSwap;

import java.lang.instrument.ClassDefinition;
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.IllegalClassFormatException;
Expand All @@ -39,6 +32,14 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.transformer.MixinReloadException;
import org.spongepowered.asm.mixin.transformer.MixinTransformer;
import org.spongepowered.asm.mixin.transformer.debug.IHotSwap;

import net.minecraft.launchwrapper.Launch;

/**
* An agent that re-transforms a mixin's target classes if the mixin has been
* redefined. Basically this agent enables hot-swapping of mixins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
*/
package org.spongepowered.tools.agent;

import java.util.HashMap;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.lib.ClassWriter;
Expand All @@ -32,9 +35,6 @@
import org.spongepowered.asm.lib.Type;
import org.spongepowered.asm.mixin.MixinEnvironment;

import java.util.HashMap;
import java.util.Map;

/**
* Class loader that is used to load fake mixin classes so that they can be
* re-defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic.Kind;

import net.minecraftforge.srg2source.rangeapplier.MethodData;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.struct.InvalidMemberDescriptorException;
import org.spongepowered.asm.mixin.injection.struct.MemberInfo;
Expand All @@ -58,6 +56,8 @@
import org.spongepowered.tools.obfuscation.IMixinValidator.ValidationPass;
import org.spongepowered.tools.obfuscation.struct.Message;

import net.minecraftforge.srg2source.rangeapplier.MethodData;


/**
* Information about a mixin stored during processing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.tools.Diagnostic.Kind;
import javax.tools.FileObject;
import javax.tools.StandardLocation;
import javax.tools.Diagnostic.Kind;

import org.spongepowered.asm.mixin.injection.struct.MemberInfo;
import org.spongepowered.asm.mixin.injection.struct.ReferenceMapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/
package org.spongepowered.asm.bridge;

import org.objectweb.asm.commons.Remapper;
import org.spongepowered.asm.mixin.extensibility.IRemapper;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.objectweb.asm.commons.Remapper;
import org.spongepowered.asm.mixin.extensibility.IRemapper;

public class RemapperAdapterFML extends RemapperAdapter {

private final Method mdUnmap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@

import java.util.List;

import net.minecraft.launchwrapper.Launch;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.MixinEnvironment.Phase;

import net.minecraft.launchwrapper.Launch;

/**
* Bootstaps the mixin subsystem. This class acts as a bridge between the mixin
* subsystem and the tweaker or coremod which is boostrapping it. Without this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
*/
package org.spongepowered.asm.launch;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.File;
import java.net.URI;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


/**
* Launch agent base class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
import java.net.URI;
import java.util.List;

import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.extensibility.IRemapper;

import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.extensibility.IRemapper;

/**
* Launch agent for use under FML.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/spongepowered/asm/launch/MixinTweaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@
import java.util.List;
import java.util.Map;

import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel;
import org.spongepowered.asm.mixin.MixinEnvironment.Phase;

import net.minecraft.launchwrapper.ITweaker;
import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;


/**
* TweakClass for running mixins in production. Being a tweaker ensures that we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;

import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.transformer.IReferenceMapperContext;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
*/
package org.spongepowered.asm.mixin.injection.struct;

import net.minecraftforge.srg2source.rangeapplier.MethodData;

import org.spongepowered.asm.lib.Type;
import org.spongepowered.asm.lib.tree.AbstractInsnNode;
import org.spongepowered.asm.lib.tree.FieldInsnNode;
import org.spongepowered.asm.lib.tree.MethodInsnNode;
import org.spongepowered.asm.mixin.transformer.IReferenceMapperContext;
import org.spongepowered.asm.util.SignaturePrinter;

import net.minecraftforge.srg2source.rangeapplier.MethodData;


/**
* <p>Information bundle about a member (method or field) parsed from a String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
import java.util.HashMap;
import java.util.Map;

import net.minecraft.launchwrapper.Launch;

import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import net.minecraft.launchwrapper.Launch;

public final class ReferenceMapper implements Serializable {

private static final long serialVersionUID = 2L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.spongepowered.asm.lib.Type;
import org.spongepowered.asm.lib.tree.AnnotationNode;
import org.spongepowered.asm.lib.tree.MethodNode;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.transformer.ClassInfo.Method;
import org.spongepowered.asm.mixin.transformer.meta.MixinRenamed;
import org.spongepowered.asm.util.ASMHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
import org.spongepowered.asm.lib.tree.MethodNode;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.MixinEnvironment.Option;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.struct.InjectionInfo;
import org.spongepowered.asm.mixin.transformer.meta.MixinMerged;
import org.spongepowered.asm.mixin.transformer.meta.MixinRenamed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
import java.util.Map;
import java.util.Set;

import net.minecraft.launchwrapper.Launch;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.launch.MixinInitialisationError;
import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.MixinEnvironment.Option;
import org.spongepowered.asm.mixin.extensibility.IMixinConfig;
Expand All @@ -52,6 +50,8 @@
import com.google.gson.Gson;
import com.google.gson.annotations.SerializedName;

import net.minecraft.launchwrapper.Launch;

/**
* Mixin configuration bundle
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
import java.util.List;
import java.util.Set;

import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;

import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -61,6 +58,9 @@
import com.google.common.base.Functions;
import com.google.common.collect.Lists;

import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;

/**
* Runtime information bundle about a mixin
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
import org.spongepowered.asm.lib.Opcodes;
import org.spongepowered.asm.lib.Type;
import org.spongepowered.asm.lib.tree.*;
import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel;
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.MixinEnvironment.CompatibilityLevel;
import org.spongepowered.asm.mixin.SoftOverride;
import org.spongepowered.asm.mixin.injection.struct.ReferenceMapper;
import org.spongepowered.asm.mixin.injection.struct.Target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
import java.io.InputStream;
import java.net.URLClassLoader;

import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.launchwrapper.Launch;

import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
Expand All @@ -39,6 +36,9 @@
import org.spongepowered.asm.mixin.MixinEnvironment;
import org.spongepowered.asm.mixin.transformer.MixinTransformer.ReEntranceState;

import net.minecraft.launchwrapper.IClassTransformer;
import net.minecraft.launchwrapper.Launch;

/**
* Base class for "info" objects which use ASM tree API to do stuff, with things
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
*/
package org.spongepowered.asm.transformers;

import net.minecraft.launchwrapper.IClassTransformer;

import org.spongepowered.asm.lib.ClassReader;
import org.spongepowered.asm.lib.ClassWriter;
import org.spongepowered.asm.lib.tree.ClassNode;
import org.spongepowered.asm.mixin.transformer.MixinClassWriter;

import net.minecraft.launchwrapper.IClassTransformer;

/**
* Base class for transformers which work with ASM tree model
*/
Expand Down

0 comments on commit 8c6be0e

Please sign in to comment.