New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate gestalt-module with Terasology, replacing previous module system #1152
Conversation
I could fix it by explicitly specifying the type of the last parameter as:
|
|
|
Could it be a package swap between sun.reflect instead of java.lang.reflect or something like that somewhere? Since generally sun stuff is shunned I ran it through my integration workspace with all "stable" modules - the following modules look to have compile errors: Cities - @msteiger I figure most are simple fixes just tweaking packages and methods. Ideally we'd get the primary maintainer to fix, but should we try to be proactive, especially where the current maintainer is unavailable or low on time? LightAndShadow comes to mind, it needs some extra attention anyway. Overall: Very impressive stuff :-) We can push it to the Nanoware repos if we want to do some Jenkins testing / bundle with modules to see if any runtime/binary issues pop up. Can fork any missing modules for extra testing. |
Good point. Most compiler errors I encountered should be easy to fix. I can also look into some of the un-maintained ones if you want. |
I recognize the error - previously I had I don't know what this means for non-Sun java distributions though. |
Will test NameGenerator and try to fix the errors in Cities tonight (or tomorrow) and see if it works. OpenJDK has the same packages as the Oracle implementation, so this shouldn't cause any problems. It works with IcedTea on Linux Mint at least. |
I will wait to fix any issues in the mods I work on, once this is merged into develop. |
Both Cities and NameGenerator work. |
Currently driving thu Iowa, Minnisota, South Dakota in last hour. On the On Tuesday, July 1, 2014, Martin Steiger notifications@github.com wrote:
|
…nabled by default for IntelliJ project) Set the module metadata filename explicitly. Added serverSideOnly extension to metadata. Fixed Input Configuration UI to correctly discover buttons from modules.
Integrate gestalt-module with Terasology, replacing previous module system
Any chance of changing the toString() method in Name to either return normalised, or introduce a method to the class that returns it? |
I don't want to change toString(), as I want to keep any camel casing for display purposes, and store it that way. At the moment, I don't see any reason to return a "normalised" string - it is merely an implementation detail. If it is for comparison or hashing, makes more sense to use the name (and convert what you want to compare it to into a name). Effectively Name doesn't have a normalised form, it merely guarantees case-insenstive comparison and hashing. |
BTW ColorTextureAssetResolver will not work for that reason, and will not be able to distinguish between "Color:XXX" and "color:XXX". It also doesn't work right now due to: |
Without the access to normalised string, most of the AssetResolvers might have problems, and it's something I use quite a bit for generated assets. |
@mkienenb - nice! Enjoy your trip, we'll keep on the lights :-) I added a slight tweak to let standalone modules build, otherwise looks good, just need a few more module fixes |
@MarcinSc
|
I don't think the built-in split method is required, as everyone will use a different structure for their resources, so probably just the "toLowercase", or "getNormalised" will be enough. |
I noticed that
However, I still get this for the NameGenerator tests:
What's missing to make it work again? |
The test moduleManager's registry doesn't include every module. For unit testing a specific module, you should add that module and dependencies. |
That's surprising. It gives me all modules plus "unittest". I tried adding NameGenerator only and adding all available modules (and ModuleEnvironment seems to have them all), but still no luck. The warning disappears if I qualify the asset with the module name (prefix with "NameGenerator:"), but loading still fails. |
Bump - any luck @msteiger or ideas @immortius ? Would like to get NameGenerator & friends fixed for stable build :-) |
I think I need more details. In what way does loading fail? Additionally you shouldn't just grab every module from the ModuleRegistry, because there could potentially be multiple versions of the same Module - use the Dependency Resolver to pull a compatible set out of the registry based on the module being tested. (see the user doc for details) |
In other news I think other than a quick Rails fix the NameGenerator tests looks to be the only broken thing left. Several of the modules I listed above may have failed from module compilation errors instead Miinion had a simple fix and with that MOO is all set too |
One problem is that AssetManager is not synced with ModuleManager's environment. I manually set the new env. using:
This helped, but loading still fails, because the PrefabSerializer does not know the components in the module:
I assumed that the StorageManager needs updating as well, so I set the new module env. there, but it didn't change a thing. So I tried setting the right module env. when creating the ModuleManager. This fails in EntitySystemBuilder.registerComponents(), because environment.getModuleProviding(CreatureName.class) returns |
That last error is because you need to add the module being tested as a classpath module, as it is on the classpath when running unit tests. |
Ka-ching - found it! Apparently, the assets folder has to reside inside the src/main/resources folder now. Is that correct? I wish it hadn't took me so long to find this out.
Similarly, I moved the |
Is that specific to unit testing? Since modules are working normally without any file movement (tested a few). Plus unit tests in modules are still pretty rare so easy for them to go funny |
Oh, hmm. For PathModules (so a directory), the assets path is supposed to be in the root path. Same for ArchiveModules (root of the zip). For classpath modules, the assets path is expected to be in the root of the classes folder, since that is the classpath. This all works well except for unit tests, since the module being tested is on the classpath, but the assets folder won't be there. I'll have a think about this. On module.txt, it should be at the root of the module (not under assets). And yes, again this is a problem when unit testing a module as you point out. |
I split this out into a new issue so we can stop talking in a closed one :-) |
No description provided.