I'm working on a GWT project in Eclipse and for some reason the .nocache.js file is no longer being built, but a .devmode.js is. I cannot find any setting that would control this. Could anyone point me in the right direction?
Edit: My gwt.xml is below
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='myapp'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.gadgets.Gadgets' />
<inherits name='org.adamtacy.GWTEffects' />
<inherits name='com.google.gwt.user.theme.clean.Clean' />
<entry-point class='myapp.Entry' />
</module>
Update
This appears to be related to the use of gwt-gadgets. Inheriting the library and the use of a class that extends Gadget as an entry point causes things to be built only with devmode.js and not nocache.js.
Has anyone therefore developed any Google Gadgets using GWT and deployed them successfully?
Update 2
Turns out this is not an issue, although it seems a bit odd. If Gadgets are deployed using the generated gadget.xml, then this references devmode.js and so things work as expected. The naming is off-putting though.
Related
We are using PMD to assess the quality of our "main" source code. We have our own customized ruleset that includes some category rulesets and excludes some specific rules.
Simplified example, file called pmd.xml:
<?xml version="1.0"?>
<ruleset name="Main rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Main rules</description>
<rule ref="category/java/bestpractices.xml">
<exclude name="GuardLogStatement"/>
</rule>
<rule ref="category/java/security.xml"/>
</ruleset>
Analysis is launched from gradle, it works fine for our "main" source code.
Now we would like to get another more lenient ruleset for our "test" source code. As we don't want to duplicate our set of rules, what we would like to do is import this main ruleset, and exclude some more rules.
So we basically would like to keep the GuardLogStatement excluded, and also exclude rule UnusedPrivateMethod, with a file looking like this one.
<?xml version="1.0"?>
<ruleset name="Test rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>Test rules</description>
<!-- Test rules are based on rules for main -->
<rule ref="./config/pmd.xml">
<exclude name="UnusedPrivateMethod"/>
</rule>
</ruleset>
This doesn't work:
GuardLogStatement is excluded, but
UnusedPrivateMethod still runs.
I don't see any reference in the documentation on how to exclude a rule from a ruleset.
Anyone managed to do something similar?
It turns out this actually works fine.
Pure PEBKAC, the problem was due to my work environment.
I am keeping the question as it demonstrates a nifty way of having a ruleset for the test code derived from the ruleset for the main code.
I have a library that comes from a private nuget feed. I have the url and credentials for that but dont know how to connect to the feed properly with visual studio code. I am using dotnetcore framework.
I created a Nuget.Config file in the root of my console application with the feed url and username and password but this didn't seem to pick up the packages from that feed when imputting them in the project.json. Even doing a restore would produce errors.
Does anyone have an example of how they would set up a project to do this? I know it is not normal to have the Nuget.Config file in the project but this is a test project so would not live there once the project got past proof of concept.
My nuget.config looked like this
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="CustomRepo" value="https://nuget.feed/nuget/" />
</packageSources>
<!-- Used to store credentials -->
<packageSourceCredentials>
<CustomRepo>
<add key="Username" value="something" />
<add key="ClearTextPassword" value="thepassword" />
</CustomRepo>
</packageSourceCredentials>
<!-- Used to disable package sources -->
<disabledPackageSources />
</configuration>
Apoligies this is now resolved and working with the nuget.config file in the root folder. I dont know what I did. Only thing I did was re-type the whole xml but dont know what what would have done. Anyway it is working which is great.
I generated Sample Application using Intellij 14, but standard.css is missing both in generated artifact and when I run super dev mode configuration.
As a result of missing standard css, all widgets look ugly or will not be shown at all.
Did I configure something the wrong way or is it a bug?
standard.css is part of one of the four themes coming with the GWT SDK, and is only included if the theme-specific module is inherited by your module.
You need to add:
<inherits name='com.google.gwt.user.theme.standard.Standard' />
to your module to apply the "standard" theme, or possibly:
<inherits name='com.google.gwt.user.theme.standard.StandardResources' />
if you include the standard.css by your own means (using a <link> tag in your HTML host page, or the StyleInjector; i.e. this module will only copy the files to the output without applying them)
See also: http://www.gwtproject.org/doc/latest/tutorial/style.html#GWTtheme
Having hard time installing GWT plugin. Tried to search for GWT plugins and all I was able to find was GWT Imagebundle which is pretty outdated. Tried File Menu -> configure plugins but didn't help as the plugin is not installed yet.
Is there a support for GWT plugin in intelliJ 10 community edition? If there is can some one please point me to the right document to install it? Just to make sure, I installed scala plugin and I am able to see it in "Add modules" section.
This is my first time using intellij and I love it so far.
There is no GWT support in the Community Edition.
Starting from the version 11 it's not possible to add PROJECT_FOLDER/src as it was described in the previously posted (by ctorx) link http://java.dzone.com/tips/gwt-development-intellij-idea. Once we add a source folder it appears as an "Empty library" and doesn't work. This is because IDEA treats it as a folder where should be compiled classes not sources.
But there is a workaround. To fix it we have to hack the module's IML file. Find the following lines in the IML file of your entry point module
<orderEntry type="module-library">
<library>
<CLASSES />
<JAVADOC />
<SOURCES>
<root url="file://$MODULE_DIR$/src/main/java" />
</SOURCES>
</library>
</orderEntry>
and move your path into the CLASSES tag, so the entire thing looks like the following
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="file://$MODULE_DIR$/src/main/java" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
I would like to have my GWT application use different constants when debugging or developing vs when deployed. What is the right way to do this? My web searches turn up a lot of pages about debugging GWT applications, which isn't what I'm looking for.
This looks like a job for deferred binding! ;)
It would look something like this (put this in your module XML file, I haven't actually tested it, but you should get the gist of it):
<define-property name="debug" values="true,false" />
<set-property name="debug" value="true" />
<replace-with class="package.Constants">
<when-type-is class="package.Constants"/>
</replace-with>
<replace-with class="package.ConstantsDebug">
<when-type-is class="package.Constants" />
<when-property-is name="debug" value="true"/>
</replace-with>
See the docs for more information on available parameters, rules and whatnot.