Skip to content

Commit

Permalink
Fix building. Updated gradle wrapper to version 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Cybermaxke committed Apr 18, 2017
1 parent 8523070 commit 1af3517
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 24 deletions.
14 changes: 9 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ dependencies {
// Asm
compile 'org.ow2.asm:asm-all:5.0.3'

testCompile 'junit:junit:4.11'
testCompile 'org.mockito:mockito-core:1.9.0'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile 'org.mockito:mockito-core:2.7.4'
}

idea.module {
Expand Down Expand Up @@ -258,7 +259,7 @@ shadowJar {
exclude 'Version.java.template'
exclude 'log4j2_indev.xml'

from zipTree(api.tasks.genEventImpl.outputs.files.first())
from fileTree(api.tasks.genEventImpl.outputs.files.first())

// Make sure that the jar is generated
afterEvaluate {
Expand Down Expand Up @@ -326,9 +327,12 @@ shadowJar {

task sourceJar(type: Jar) {
classifier = 'sources'
from api.sourceSets.main.allSource

from sourceSets.java6.allSource
from sourceSets.main.allSource

from api.sourceSets.main.allSource
from api.sourceSets.ap.allSource
}

// Run shadowJar and sourceJar on build
Expand Down Expand Up @@ -407,5 +411,5 @@ license {

// Gradle version used for generating the Gradle wrapper
task wrapper(type: Wrapper) {
gradleVersion = '2.14'
gradleVersion = '3.5'
}
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 @@
#Tue Apr 18 18:52:44 CEST 2017
#Tue Apr 18 23:23:59 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
22 changes: 15 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Provider;
import joptsimple.OptionParser;
import org.junit.Test;
import org.lanternpowered.server.inject.option.OptionModule;

import javax.inject.Named;

public class InjectionTest {

public static class TestObject {
Expand All @@ -56,7 +53,13 @@ protected void configure() {
install(new InjectionPointProvider());
final OptionParser optionParser = new OptionParser();
optionParser.allowsUnrecognizedOptions();
install(new OptionModule.Simple(new String[] { "--my-option=500", "--my-other-option=10.684" }, optionParser));
install(new OptionModule() {
@Override
protected void configure0() {
bindArguments().toInstance(new String[]{"--my-option=500", "--my-other-option=10.684"});
bindParser().toInstance(optionParser);
}
});
}
};
final Injector injector = Guice.createInjector(module);
Expand Down

0 comments on commit 1af3517

Please sign in to comment.