Integrate sandbox properly with top-level build, create fat jar and remove unused imports. (#575)

This commit is contained in:
Chris Rankin 2017-04-24 20:30:21 +01:00 committed by GitHub
parent ab8bfec76f
commit f715ab39a2
7 changed files with 16 additions and 17 deletions

View File

@ -22,7 +22,7 @@ buildscript {
ext.jersey_version = '2.25' ext.jersey_version = '2.25'
ext.jolokia_version = '2.0.0-M3' ext.jolokia_version = '2.0.0-M3'
ext.assertj_version = '3.6.1' ext.assertj_version = '3.6.1'
ext.slf4j_version = '1.7.24' ext.slf4j_version = '1.7.25'
ext.log4j_version = '2.7' ext.log4j_version = '2.7'
ext.bouncycastle_version = '1.56' ext.bouncycastle_version = '1.56'
ext.guava_version = constants.getProperty("guavaVersion") ext.guava_version = constants.getProperty("guavaVersion")

View File

@ -1,13 +1,9 @@
group 'net.corda'
version '0.6-SNAPSHOT'
apply plugin: 'java' apply plugin: 'java'
apply plugin: 'kotlin' apply plugin: 'kotlin'
sourceCompatibility = 1.8
buildscript { buildscript {
ext.asm_version = '5.1' ext.asm_version = '5.1'
ext.logback_version = '1.2.3'
} }
dependencies { dependencies {
@ -21,7 +17,20 @@ dependencies {
compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version" compile "net.sf.jopt-simple:jopt-simple:$jopt_simple_version"
// Simple Logging Facade: makes the code independent of the chosen logging framework. // Simple Logging Facade: makes the code independent of the chosen logging framework.
compile "org.slf4j:slf4j-api:1.7.21" compile "org.slf4j:slf4j-api:$slf4j_version"
compile "ch.qos.logback:logback-classic:$logback_version"
testCompile "junit:junit:$junit_version" testCompile "junit:junit:$junit_version"
} }
task standaloneJar(type: Jar) {
// Create a fat jar by packing all deps into the output
from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
manifest {
attributes 'Main-Class': 'net.corda.sandbox.tools.SandboxCreator'
}
archiveName "corda-sandbox-creator-${version}.jar"
}

View File

@ -1,11 +1,7 @@
package net.corda.sandbox; package net.corda.sandbox;
import net.corda.sandbox.visitors.CostInstrumentingMethodVisitor;
import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.ClassRemapper;
/** /**
* *

View File

@ -9,7 +9,6 @@ import java.nio.file.*;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream; import java.util.zip.ZipInputStream;
import net.corda.sandbox.visitors.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import joptsimple.OptionParser; import joptsimple.OptionParser;

View File

@ -9,13 +9,11 @@ import net.corda.sandbox.Utils;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.corda.sandbox.*;
import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import static net.corda.sandbox.CandidateMethod.State.*;
import static org.objectweb.asm.Opcodes.*; import static org.objectweb.asm.Opcodes.*;
/** /**

View File

@ -2,13 +2,11 @@ package net.corda.sandbox.visitors;
import net.corda.sandbox.CandidacyStatus; import net.corda.sandbox.CandidacyStatus;
import net.corda.sandbox.CandidateMethod; import net.corda.sandbox.CandidateMethod;
import net.corda.sandbox.*;
import org.objectweb.asm.Handle; import org.objectweb.asm.Handle;
import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes; import org.objectweb.asm.Opcodes;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import static net.corda.sandbox.CandidateMethod.State.*;
import net.corda.sandbox.Utils; import net.corda.sandbox.Utils;
import org.objectweb.asm.Label; import org.objectweb.asm.Label;

View File

@ -1,6 +1,5 @@
package net.corda.sandbox; package net.corda.sandbox;
import net.corda.sandbox.CandidateMethod;
import org.junit.Test; import org.junit.Test;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;