Skip to content

Commit

Permalink
Fix a failing test, which was most likely introduced because a a tran…
Browse files Browse the repository at this point in the history
…sformation adding CapabilitiesService was removed in this commit.

fe87bbf

Also upgrading gradle.
We cannot upgrade to gradle 5.x as AppEngine plugin uses classesDir which is deprecated.
  • Loading branch information
kdabir committed Feb 5, 2019
1 parent 207dec1 commit 6db0a50
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 29 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Expand Up @@ -3,11 +3,11 @@ defaultTasks 'clean', 'build', 'templateProjectZip'
allprojects {
apply plugin: 'groovy'
apply plugin: 'idea'

repositories {
mavenCentral()
}


version = '2.3.0-SNAPSHOT'
group = 'org.gaelyk'
Expand All @@ -30,7 +30,7 @@ task templateProjectZip(type: Zip) {
from(templateProjectDir) {
include 'build.gradle'
}

from('.') {
include 'gradlew', 'gradlew.bat'
fileMode = 0755
Expand All @@ -39,6 +39,6 @@ task templateProjectZip(type: Zip) {
baseName 'gaelyk-template-project'
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
task generateWrapper(type: Wrapper) {
gradleVersion = '4.10.3'
}
4 changes: 2 additions & 2 deletions core/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Jul 28 15:57:46 PDT 2016
#Mon Feb 04 16:27:44 UTC 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
Expand Up @@ -97,6 +97,7 @@ class GaelykBindingsTransformation implements ASTTransformation {
addGetterIfNotExists(parent, Class, "getNamespace", GaelykBindingEnhancer, "getNamespaceManager")
addGetterIfNotExists(parent, LogService, "getLogService", LogServiceFactory, "getLogService")
addGetterIfNotExists(parent, SearchService, "getSearchService", SearchServiceFactory, "getSearchService")
addGetterIfNotExists(parent, CapabilitiesService, "getCapabilities", CapabilitiesServiceFactory, "getCapabilitiesService")
}

private void addGetterIfNotExists(ClassNode parent, Class serviceClass, String getterName, Class factoryClass, String factoryMethodName) {
Expand All @@ -113,11 +114,11 @@ class GaelykBindingsTransformation implements ASTTransformation {
block.addStatement(new ReturnStatement(new MethodCallExpression(
new ClassExpression(factoryType), factoryMethodName, new TupleExpression()
)))

new MethodNode(
accessorName,
Modifier.PRIVATE | Modifier.STATIC,
returnType,
accessorName,
Modifier.PRIVATE | Modifier.STATIC,
returnType,
Parameter.EMPTY_ARRAY,
ClassNode.EMPTY_ARRAY,
block
Expand Down
4 changes: 3 additions & 1 deletion core/src/test/groovyx/gaelyk/BindingEnhancerTest.groovy
Expand Up @@ -25,6 +25,7 @@ import com.google.appengine.tools.development.testing.LocalLogServiceTestConfig
import com.google.appengine.api.log.LogService
import com.google.appengine.tools.development.testing.LocalSearchServiceTestConfig
import com.google.appengine.api.search.SearchService
import com.google.appengine.api.capabilities.CapabilitiesService

/**
* Test the binding enhancer binds the GAE services in the binding.
Expand Down Expand Up @@ -125,8 +126,9 @@ class BindingEnhancerTest extends GroovyTestCase {
assert binding.prospectiveSearch instanceof ProspectiveSearchService
assert binding.logService instanceof LogService
assert binding.search instanceof SearchService
assert binding.capabilities instanceof CapabilitiesService
}

/**
* Lazy session is the default session.
*/
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
#Thu Jul 28 15:57:46 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
26 changes: 17 additions & 9 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
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
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

0 comments on commit 6db0a50

Please sign in to comment.