-
Notifications
You must be signed in to change notification settings - Fork 40
Provide more friendly methods and accessors for configuring nested extensions added to the AppEngineExtension #191
Comments
+1 |
I'll take a look, but this requires a rewrite given how invested we are in using the dynamic extension addition. Any idea how close they are supporting it in Kotlin? Edit: It's possible it's not a terribly large rewrite. But would still like Kotlin to just support it. |
There is an open PR at gradle/kotlin-dsl-samples#624 , so I know that those guys are aware of it. I would expect that issue and PR to get more traction before 1.0 (which last time I heard was projected for Q1 2018). I'm not sure how many users will run into this as |
@loosebazooka would it be an option to generate marker interfaces as described here? https://docs.gradle.org/current/userguide/custom_plugins.html#sec:using_the_java_gradle_plugin_development_plugin |
@loosebazooka and would the route as JUnit 5 plugin took be an option to add to the AppEngine plugin to simplify users using a Kotlin build script? That sounds like an easy intermedia solution while waiting for gradle/kotlin-dsl-samples#457. |
The solutions in those links don't appear to handle the case here that we generate different extension hierarchies for standard and flex projects (for example "run" doesn't appear in the appengine configuration block for flex projects). I think the point is that we just have to statically build our two different extensions (standard, flex) instead of building them up as we do now. |
on that note, I'm working towards statically creating these extensions. |
@loosebazooka if you need a tester or something, let me know if I can be of help. |
@marceloverdijk I've tried this out and it doesn't seem to break my test suite, but not specifically with kotlin. You can try the code in #192 if you want to see if it fixes your issues. Here are some simple instructions if you need them:
change your build file to add in pulling from mavenLocal and use the snapshot you just installed
|
@loosebazooka I'm getting this error:
|
Any chance you can post a simple kotlin build file with appengine config? |
Yes np, will setup a small Kotlin project later today. |
@loosebazooka you can checkout this simple project setup https://github.com/marceloverdijk/kotlin-app-gradle-plugin |
I don't actually know what What you actually need to do is either regenerate that file somehow (how would one do this?) or just change what the extension resolves to : It's quite a strange file, and it be interesting to know why and how it's generated. |
Aha, yes this file is generated by |
Had to do a couple of trick to re-generate it but it worked. I pushed the changes to my repo for reference as well. I can now simply configure the plugin like:
which is really great! 💪 |
I was also able to remove the appengine |
Sorry, I don't know what you mean by marker artifacts? It looks like that block of code with
instead of
but the sample you sent me puts it in We don't publish to the gradle plugin portal yet, since they do not provide the necessary statistics we need (for example downloading). |
Yes you are probably right. For me it does not matter to have it part of the |
Hey @marceloverdijk can you describe how you regenerated the project-schema file with |
I simply executed |
even if the file is deleted? might be a local config issue. Thanks for your help, I'll look at this on my side. |
Hmmm, indeed that fails... let me think. UPDATE I'm not able to do get it re-generated again atm :-( (have to to check it out again from git)... |
1.3.5 is out, but @marceloverdijk do you have any update on how to generate this file? |
I just upgraded successfully to the latest Here are the steps I had to do:
That's it! It worked flawlessly; I think we can close this issue now 😄 |
Alright, I'm going to leave this open for a little, since I'm not super familiar with the kotlin builds. |
I've got error in step 3:
and in step 5
How to get the following work in Kotlin DSL?:
|
Nevermind... I got it working. My syntax was incorrect. Kotlin DSL syntax is: import com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardExtension
the<AppEngineStandardExtension>().apply {
run {
port = 80
}
} |
The Kotlin DSL from Gradle is painful to use with this plugin because it extends an extension and doesn't provide methods for those nested objects on the root extension type. \
For an example of what a user would have to do, see this SO answer. Gradle currently doesn't generate nested accessors (see gradle/kotlin-dsl-samples#457 for that improvement) so it would be nice for this plugin to provide convenience methods for those nested objects.
The text was updated successfully, but these errors were encountered: