I have received an email from GCP to migrate my project from Cloud Endpoints 1.0 to Cloud Endpoints Frameworks 2.0.
I've followed the steps outlined here: https://cloud.google.com/appengine/docs/java/endpoints/migrating?authuser=0
In my previous build.gradle I had this directive to enhance my endpoints and it worked fine:
appengine {
downloadSdk = true
appcfg {
oauth2 = true
}
endpoints {
getClientLibsOnBuild = true
getDiscoveryDocsOnBuild = true
}
enhancer {
version = "v2"
api="jdo" // or "jpa"
enhanceOnBuild = true
}
}
However, after migration and on compile, I get the following error:
Error:(60, 0) Could not find method enhancer() for arguments [build_2dn4fni12bkrsqgsi25gsx3hh$_run_closure2$_closure7@6b02ee9e] on object of type com.google.cloud.tools.gradle.appengine.core.AppEngineExtension.
And if I remove the enhancer
part, I get the following error:
org.datanucleus.metadata.MetaDataManager initialiseFileMetaDataForUse: Found Meta-Data for class [...] but this class is not enhanced!! Please enhance the class before running DataNucleus.
So, what is the equivalent enhancing in the new framework? (I'm using Android Studio 2.3.3)
The problem is that the new gradle plugin doesn't have the task
appengineEnhance
which is required to enhance your classes for jpa/jdo.There's a workaround for this here https://stackoverflow.com/a/29279504/3190492
It's also worth nothing that the
enhancer {...}
section in theappengine
block won't be required and that configuration should be done in the script in the link above.I got this response directly from Google Cloud Support:
This is not the answer I hoped for, but at least till they officially support these features, we should not migrate to Endpoints Framework v2.0.