Skip to content

Commit

Permalink
Merge pull request TNG#267 from TNG/revert-shadow
Browse files Browse the repository at this point in the history
Revert use of shadow plugin
  • Loading branch information
janschaefer authored Dec 24, 2016
2 parents f9ba66b + fae0f3c commit 0ab8714
Show file tree
Hide file tree
Showing 94 changed files with 251 additions and 429 deletions.
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# v0.14.0

## Removal of Library Dependencies

JGiven does not directly depend on any libraries anymore, except for `slf4j`. All other dependencies like `Guava`,

## Switch from cglib to ByteBuddy

The internal JGiven interception mechanism was changed to use ByteBuddy instead of cglib. The main reason for this change is support for Android (see below).
Expand Down
20 changes: 8 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
dependencies {
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'net.sf.proguard:proguard-gradle:5.3.1'
}
}

Expand All @@ -16,7 +15,6 @@ plugins {
id 'com.github.ben-manes.versions' version '0.13.0'
id "org.sonarqube" version "2.0.1"
id "ru.vyarus.animalsniffer" version "1.2.0"
id 'com.github.johnrengelman.shadow' version '1.2.3'
}

apply plugin: 'com.github.kt3k.coveralls'
Expand All @@ -26,7 +24,7 @@ apply plugin: 'project-report'
description = 'JGiven - BDD in plain Java'

task wrapper(type: Wrapper) {
gradleVersion = '3.1'
gradleVersion = '3.2'
}

allprojects {
Expand Down Expand Up @@ -92,7 +90,7 @@ configure(subprojects.findAll {!it.name.contains("android")}) {
publishing {
publications {
mavenJava(MavenPublication) {
from project.name == 'jgiven-core' ? components.shadow : components.java
from components.java
}
}
}
Expand All @@ -114,22 +112,20 @@ configure(subprojects.findAll {!it.name.contains("android")}) {
options.encoding = 'UTF-8'
}

jar {
manifest {
attributes(
tasks.withType(Jar) {
def now = new Date()
manifest = project.manifest().attributes(
'Built-By': "Gradle ${gradle.gradleVersion}",
'Build-Date': new Date().format('yyyy-MM-dd HH:mm:ss.S'),
// TODO destroys incremental build feature, but maybe date without time is ok as well?
'Copyright': "2013-" + new Date().format('yyyy') + " TNG Technology Consulting GmbH",
'Build-Date': now.format('yyyy-MM-dd HH:mm:ss.S'), // TODO destroys incremental build feature, but maybe date without time is ok as well?
'Copyright': "2013-" + now.format('yyyy') + " TNG Technology Consulting GmbH",
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'TNG Technology Consulting GmbH',
'License': 'Apache License v2.0, January 2004',
'Specification-Title': project.name,
'Specification-Version': project.version,
'Specification-Vendor': 'TNG Technology Consulting GmbH',
)
}
)
}

task javadocJar(type: Jar, dependsOn: javadoc) {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Nov 02 15:56:27 CET 2016
#Fri Dec 23 09:50:42 CET 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.2-bin.zip
2 changes: 1 addition & 1 deletion jgiven-android-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.android.tools.build:gradle:2.3.0-beta1'
}
}
apply plugin: 'com.android.application'
Expand Down
2 changes: 1 addition & 1 deletion jgiven-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-alpha1'
classpath 'com.android.tools.build:gradle:2.3.0-beta1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
28 changes: 5 additions & 23 deletions jgiven-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,28 +1,10 @@
apply plugin: 'com.github.johnrengelman.shadow'

description = "JGiven core module"

dependencies {
compile project(path: ':jgiven-deps', configuration: 'shadow')
}

shadowJar {
classifier = ''
}

idea {
module {
scopes.COMPILE.plus += [configurations.shadow]

iml {
whenMerged { module ->
def dep = new org.gradle.plugins.ide.idea.model.ModuleLibrary(
[new org.gradle.plugins.ide.idea.model.Path('file://$MODULE_DIR$/../jgiven-deps/build/libs/jgiven-deps.jar')],
[], [], [], 'COMPILE')
dep.exported = true
module.dependencies.add(dep)
}
}
}
compile group: 'com.google.guava', name: 'guava', version: guavaVersion
compile group: 'com.google.code.gson', name: 'gson', version: gsonVersion
compile group: 'com.thoughtworks.paranamer', name: 'paranamer', version: paranamerVersion
compile group: 'net.bytebuddy', name: 'byte-buddy', version: bytebuddyVersion
compile group: 'org.fusesource.jansi', name: 'jansi', version: jansiVersion
}

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Arrays;

import com.tngtech.jgiven.relocated.guava.collect.Iterables;
import com.google.common.collect.Iterables;

/**
* A utility class to create data tables.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.tngtech.jgiven.attachment;

import com.tngtech.jgiven.relocated.guava.io.BaseEncoding;
import com.tngtech.jgiven.relocated.guava.io.ByteStreams;
import com.tngtech.jgiven.relocated.guava.io.CharStreams;
import com.tngtech.jgiven.relocated.guava.io.Files;
import com.google.common.io.BaseEncoding;
import com.google.common.io.ByteStreams;
import com.google.common.io.CharStreams;
import com.google.common.io.Files;
import com.tngtech.jgiven.exception.JGivenWrongUsageException;
import com.tngtech.jgiven.impl.util.ResourceUtil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tngtech.jgiven.base;

import com.tngtech.jgiven.relocated.guava.reflect.TypeToken;
import com.google.common.reflect.TypeToken;
import com.tngtech.jgiven.impl.Scenario;
import com.tngtech.jgiven.impl.ScenarioBase;
import com.tngtech.jgiven.integration.CanWire;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tngtech.jgiven.base;

import com.tngtech.jgiven.relocated.guava.reflect.TypeToken;
import com.google.common.reflect.TypeToken;
import com.tngtech.jgiven.impl.Scenario;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.lang.annotation.Annotation;
import java.util.Map;

import com.tngtech.jgiven.relocated.guava.collect.Maps;
import com.google.common.collect.Maps;
import com.tngtech.jgiven.format.Formatter;
import com.tngtech.jgiven.impl.format.FormatterCache;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.concurrent.ExecutionException;

import com.tngtech.jgiven.relocated.guava.base.Throwables;
import com.tngtech.jgiven.relocated.guava.cache.CacheBuilder;
import com.tngtech.jgiven.relocated.guava.cache.CacheLoader;
import com.tngtech.jgiven.relocated.guava.cache.LoadingCache;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.tngtech.jgiven.annotation.JGivenConfiguration;
import com.tngtech.jgiven.impl.util.ReflectionUtil;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tngtech.jgiven.config;

import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.google.common.collect.Lists;
import com.tngtech.jgiven.annotation.TagDescriptionGenerator;
import com.tngtech.jgiven.annotation.TagHrefGenerator;
import com.tngtech.jgiven.impl.tag.DefaultTagDescriptionGenerator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.Collections;
import java.util.List;

import com.tngtech.jgiven.relocated.guava.collect.ImmutableList;
import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.tngtech.jgiven.annotation.Table;
import com.tngtech.jgiven.config.FormatterConfiguration;
import com.tngtech.jgiven.exception.JGivenWrongUsageException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import java.util.List;
import java.util.Set;

import com.tngtech.jgiven.relocated.guava.base.Function;
import com.tngtech.jgiven.relocated.guava.base.Predicate;
import com.tngtech.jgiven.relocated.guava.collect.FluentIterable;
import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.tngtech.jgiven.relocated.guava.collect.Sets;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.tngtech.jgiven.annotation.Table;
import com.tngtech.jgiven.config.FormatterConfiguration;
import com.tngtech.jgiven.format.DefaultFormatter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.lang.annotation.Annotation;
import java.util.List;

import com.tngtech.jgiven.relocated.guava.collect.ImmutableList;
import com.google.common.collect.ImmutableList;
import com.tngtech.jgiven.annotation.Table;
import com.tngtech.jgiven.config.FormatterConfiguration;
import com.tngtech.jgiven.format.ObjectFormatter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.tngtech.jgiven.impl;

import static com.tngtech.jgiven.relocated.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.any;

import com.tngtech.jgiven.impl.intercept.ByteBuddyMethodInterceptor;
import com.tngtech.jgiven.impl.intercept.StageInterceptorInternal;
import com.tngtech.jgiven.impl.intercept.StepInterceptor;

import com.tngtech.jgiven.relocated.bytebuddy.ByteBuddy;
import com.tngtech.jgiven.relocated.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import com.tngtech.jgiven.relocated.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.MethodDelegation;
import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.dynamic.scaffold.subclass.ConstructorStrategy;
import net.bytebuddy.implementation.MethodDelegation;

public class ByteBuddyStageCreator implements StageCreator {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.tngtech.jgiven.impl;

import com.tngtech.jgiven.relocated.guava.base.Optional;
import com.google.common.base.Optional;
import com.tngtech.jgiven.config.ConfigValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.tngtech.jgiven.impl;

import static com.tngtech.jgiven.relocated.guava.collect.Lists.newArrayList;
import static com.tngtech.jgiven.relocated.guava.collect.Lists.reverse;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Lists.reverse;
import static com.tngtech.jgiven.impl.ScenarioExecutor.State.FINISHED;
import static com.tngtech.jgiven.impl.ScenarioExecutor.State.STARTED;

Expand All @@ -14,9 +14,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tngtech.jgiven.relocated.guava.base.Optional;
import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.tngtech.jgiven.relocated.guava.collect.Maps;
import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.tngtech.jgiven.CurrentScenario;
import com.tngtech.jgiven.CurrentStep;
import com.tngtech.jgiven.annotation.AfterScenario;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tngtech.jgiven.relocated.guava.base.Optional;
import com.tngtech.jgiven.relocated.guava.base.Strings;
import com.tngtech.jgiven.relocated.guava.collect.ImmutableSet;
import com.tngtech.jgiven.relocated.guava.collect.Iterables;
import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.google.common.base.Optional;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.tngtech.jgiven.annotation.As;
import com.tngtech.jgiven.annotation.AsProvider;
import com.tngtech.jgiven.annotation.CaseDescription;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.util.Map;
import java.util.concurrent.ExecutionException;

import com.tngtech.jgiven.relocated.guava.base.Throwables;
import com.tngtech.jgiven.relocated.guava.cache.CacheBuilder;
import com.tngtech.jgiven.relocated.guava.cache.CacheLoader;
import com.tngtech.jgiven.relocated.guava.cache.LoadingCache;
import com.tngtech.jgiven.relocated.guava.collect.Maps;
import com.google.common.base.Throwables;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import com.tngtech.jgiven.format.DefaultFormatter;
import com.tngtech.jgiven.format.Formatter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import java.util.List;
import java.util.Set;

import com.tngtech.jgiven.relocated.guava.base.Throwables;
import com.tngtech.jgiven.relocated.guava.collect.Iterables;
import com.tngtech.jgiven.relocated.guava.collect.Lists;
import com.tngtech.jgiven.relocated.guava.collect.Sets;
import com.google.common.base.Throwables;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.tngtech.jgiven.annotation.AnnotationFormat;
import com.tngtech.jgiven.annotation.Format;
import com.tngtech.jgiven.annotation.Table;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tngtech.jgiven.relocated.guava.collect.Maps;
import com.google.common.collect.Maps;
import com.tngtech.jgiven.annotation.ExpectedScenarioState;
import com.tngtech.jgiven.annotation.ProvidedScenarioState;
import com.tngtech.jgiven.annotation.ScenarioState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Map;

import com.tngtech.jgiven.relocated.guava.collect.Maps;
import com.google.common.collect.Maps;

/**
* Holds values based on their type or name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

import com.tngtech.jgiven.impl.intercept.StepInterceptor.Invoker;

import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.AllArguments;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.BindingPriority;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.DefaultCall;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.Origin;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.RuntimeType;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.SuperCall;
import com.tngtech.jgiven.relocated.bytebuddy.implementation.bind.annotation.This;
import net.bytebuddy.implementation.bind.annotation.AllArguments;
import net.bytebuddy.implementation.bind.annotation.BindingPriority;
import net.bytebuddy.implementation.bind.annotation.DefaultCall;
import net.bytebuddy.implementation.bind.annotation.Origin;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import net.bytebuddy.implementation.bind.annotation.SuperCall;
import net.bytebuddy.implementation.bind.annotation.This;

/**
* StepInterceptorImpl that uses ByteBuddy Method interceptor with annotations for intercepting JGiven methods
Expand Down
Loading

0 comments on commit 0ab8714

Please sign in to comment.