Comments (11)
@aleixmorgadas @d-led I implemented this as I stated above. It's all pushed to vlingo-actors master and vlingo-http master. Here are the two sets of configurations:
# vlingo-actors.properties
proxy.generated.sources.main = target/generated-sources/
proxy.generated.sources.test = target/generated-test-sources/
proxy.generated.classes.main = target/classes/
proxy.generated.classes.test = target/test-classes/
----------------------------
# vlingo-http.properties
resource.dispatcher.generated.sources.main = target/generated-sources/
resource.dispatcher.generated.sources.test = target/generated-test-sources/
resource.dispatcher.generated.classes.main = target/classes/
resource.dispatcher.generated.classes.test = target/test-classes/
from xoom-common.
while the target directories are indeed based on the Maven convention, as the classes are loaded at run-time, the code generation and caching logic works in gradle or a fat jar context just as well. Check out this project: https://github.com/d-led/hello_vlingo (all 3 version run in CI)
from xoom-common.
from xoom-common.
In the Gradle docs I can't find an explicit and official generated source location for Gradle or how to determine at runtime which environment is in use. I could use help here, if even making it a configuration.
from xoom-common.
That would be indeed helpful to know which context you are talking about exactly, e.g. IntellJ or Eclipse and what difference you mean between release and development. Just bumped the vlingo-actors version to see if it still works. It does: https://travis-ci.org/d-led/hello_vlingo/builds/404155607
from xoom-common.
@aleixmorgadas it would be nice if you could set up an example project that could be to debug
from xoom-common.
I created the vlingo-http-gradle-issue-4 repository with the minimum code to throw the error.
The IDE used is IntelliJ & I started the application in the same IDE. The same structure with Maven works.
Here some stack trace (skipped some lines)
vlingo/http: Generating handler dispatcher for main: com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource
vlingo/http: Generating handler dispatcher for test: com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource
vlingo/http: Failed to load resource: hello because: Resource cannot be created for: com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource
java.lang.IllegalArgumentException: Resource instance with dispatcher for com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource not created because: Cannot generate resource dispatcher class for com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource because there is no corresponding:
target/test-classes/com/github/aleixmorgadas/vlingohttpgradle/HelloWorldResource.class
at io.vlingo.http.resource.Resource.tryGenerateCompile(Resource.java:127)
//. ......
at com.github.aleixmorgadas.vlingohttpgradle.Application.main(Application.java:10)
Caused by: java.lang.IllegalArgumentException: Cannot generate resource dispatcher class for com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource because there is no corresponding:
target/test-classes/com/github/aleixmorgadas/vlingohttpgradle/HelloWorldResource.class
at io.vlingo.http.resource.ResourceDispatcherGenerator.generateFor(ResourceDispatcherGenerator.java:87)
at io.vlingo.http.resource.Resource.tryGenerateCompile(Resource.java:122)
... 8 more
Exception in thread "main" java.lang.IllegalStateException: Resource cannot be created for: com.github.aleixmorgadas.vlingohttpgradle.HelloWorldResource
at io.vlingo.http.resource.Loader.resourceFor(Loader.java:79)
from xoom-common.
@aleixmorgadas Thanks for the stack trace and sample project. I have struggled to find anything specific in Gradle docs and various forum discussions regarding where generated source should be located. Can you make a recommendation based on your experience with Gradle and IntelliJ? My thought is to provide a configuration root for both main and test. The following is an example for vlingo-http.properties, or would be included in your DSL configuration.
#=====================================
# generated resource dispatchers
#=====================================
resource.dispatcher.generated.sources.main = target/generated-sources/
resource.dispatcher.generated.sources.test = target/generated-test-sources/
resource.dispatcher.generated.classes.main = target/classes/
resource.dispatcher.generated.classes.test = target/test-classes/
The values would be replaced for Gradle and/or IntelliJ. Please provide your thoughts.
from xoom-common.
Unrelated to the issue per se, why do you need to compile the classes at run time?
Regarding the solution by configuration, it works, but I think vlingo is relying a lot to configuration files, it should provide better error reporting to help the developer find the issues/solutions earlier. En example is that, if vlingo-actors.properties
file isn't present, it throws a NullPointerException
and should throw something more descriptive, my 5 cents.
from xoom-common.
Checked. Working with the latest version 0.4.0
from xoom-common.
@aleixmorgadas Thanks. I answer your questions here.
-
We don't require runtime code generation and compilation unless the developer has not arranged for proxies to be pre-generated. For
vlingo-actors
you can use thevlingo-maven-plugin
. See thevlingo-maven-plugin-test
for usage. Forvlingo-http
thevlingo-maven-plugin
has not yet been enabled for dispatcher proxy generation support. Still, using runtime dynamically generated proxies is nice for testing, because you can quickly change/refactor the tested and test code before it is well-designed green. -
There are configuration files now, but very minimal configuration is required. It has always been my intention to support fluent configuration APIs, but right now I am focused on more important features/functionality. As you can see most of the projects are at
0.5.0
or less. This is something that developers of the tools should be willing to work with for a short time until there is time to make it more seamless. If you can't live with that right now for some reason please change it. -
The configuration is minimal, and in
vlingo-actors
there is no consumer-programmer configuration necessary for reasonable default behavior (removevlingo-actors.properties
and useWorld.start("worldname" true)
and see). Yes, current default behavior for proxy generation is for Maven, not Gradle, but it's simple to understand why when considering overall industry usage of Maven. It's not a judgment as to which build tool is better, it's just a matter of numbers of projects/users.
from xoom-common.
Related Issues (11)
- BasicCompletes Must Handle Latent Registration of recoverFrom(Exception) HOT 2
- Completes.recoverFrom() should support a handler that returns a Completes<Y> not just Y
- Support for composition of Completes
- Support Completes<T> and CompletableFuture<T> In One Pipeline
- Redesign Completes<T> so it decouples composition and execution time HOT 5
- failedOutcomeValue ignored if chained with multiple AndThen statements HOT 8
- moved to trello
- Set up publishing snapshot builds to bintray HOT 1
- please update vlingo-common in repository HOT 2
- Completes with map and flatmap HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xoom-common.