How to get GWT compiler output where I want it?
For reasons that I have to ask you to accept as a given, I need to have my GWT application be built such that all the output is available at "/Foo/bar/1.0", rather than the normal "/".
Specifically, I need the result of compiling my GWT app inside of IntelliJ to look like this:
~/.IntelliJIdea12/system/gwt/Project.534b2263/Test.ef6cd448/run/www/
- Foo
- bar
- 1.0
- Testing.html
- Testing.css
- (other files in here too, like favicon.ico, etc...)
- WEB-INF
-(contents left out here)
- testing
- testing.devmode.js
- testing.nocache.js
The best I can seem to do is to get the Testing.html, Testing.css, etc... in the right place. I get this by setting the "Output Relative Path" for my GWT module to "/Foo/bar/1.0/" *and* the "Path Relative to DeploymentRoot" for my Web Resource Directory to the same "/Foo/bar/1.0/".
However, the "testing" directory, containing the testing.devmode.js and testing.nocache.js seem to wind up in the ~/.IntelliJIdea12/system/gwt/Project/534b2263/Test.ef6cd448/run/www/testing directory. Obviously, this means that when the Testing.html tries to include the testing/testing.nocache.js it cannot be found, and my GWT app doesn't work.
I've attached a sample project I created similar to my real project. Hopefully I'm just missing something easy, but I've been digging around for hours...
Thanks for any help!
jay
Attachment(s):
IntelliJ-GWT-Output.tgz
Please sign in to leave a comment.
If you need to put GWT compiler output somewhere you need to create an artifact (File | Project Structure | Artifacts) and add 'GWT Compiler Output'
element to it. Also you can put 'Web facet resources' element to the same artifact. If you need to place the GWT output into a subfolder under the
artifact output root use 'New Folder' action in the 'Output layout' tree in the artifact editor.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Thanks! I was very close before, trying some other steps with Artificats, but (obviously) failed to get it just right.
Dang... I spoke too soon.
Turns out in my efforts to test things yesterday, I had copied the output into the correct directory. However, after I did an rm -rf on the Testing.ef6cd448 directory and then did a build and debug, there's no change to where the files are being generated.
Even if in the run configuration I choose to "Build Artifacts" before launch, it still doesn't generate the nocache.js and associated files into the correct place.
If you modified contents of an output directory by hand you need to invoke 'Rebuild'. Also files under .IntelliJIDEA/system directory aren't supposed
to be modified or accessed by hand.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
Right... This was just my attempt to see *if* I could get IntelliJ to put the output files where I want them, would the rest of what I'm trying to do work? The answer to that is yes.
So, now I'm back to my original question -- why can't I get IJ to put the compiler-generated files in my desired location? Is this a bug that I should file? (Note--I'm not interested in generating any kind of artifact here...I just want the result of running the GWT compiler to go the same directory as the other files.)
Thanks,
jay
Actually the artifact containing the GWT compile output element is the only way to tell IDEA to put GWT compiler output into your desired location.
Why don't you want to create an artifact?
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
I'm not opposed to creating an artifact, it's just that I don't need it.I just want to get the GWT compiler output into the same directory as the static content, e. g., the 1.0 directory in my example. And I want to get the output there every time I do a refresh of the browser (because I've made a code change that I want to get picked up.
Just to clarify: Right now, regardless of whether I have an artifact being generated or not, the static content is getting put into my ..../run/www/Foo/Bar/1.0 directory. (See the original post.) However, the GWT compiler output is going into ".../run/www/testing".
This means that when I try to open "/Foo/Bar/1.0/Testing.html" the first thing that happens is that the script to load the GWT module isn't found. E.g., the standard line in the HTML file:
<!--
This script loads your compiled module. If you add any GWT meta tags, they must
be added before this line.
-->
<script type="text/javascript" language="javascript" src="testing/testing.nocache.js"></script>
So, the result is that in the IntelliJ DevMode output window I see:
Connected to the target VM, address: '127.0.0.1:50614', transport: 'socket'
Dev Mode initialized. Startup URL:
http://127.0.1.1:8888/Foo/bar/1.0/Testing.html?gwt.codesvr=127.0.1.1:9997
[WARN] 404 - GET /Foo/bar/1.0/testing/testing.nocache.js (127.0.0.1) 1453 bytes
This is after configuring a GWT artifact that is like this:
<output root>
- Foo
- bar
- 1.0
- 'war' directory content
- 'testing' GWT compiler output
- WEB-INF
I did update my run configuation to add a "Before launch" step to build this artifact.
I can't tell you how much I appreciate your help and thoughts on this! It's one (more!) reason I stick with IntelliJ!!!!
Jay
GWT compiler isn't called when you start GWT in the Development mode so 'Output relative path' in GWT Compiler settings isn't taken into account. To
get your project working in the both production and development modes you can do the following:
1) change 'Output relative path' in GWT Compiler setting to its default value '/testing'.
2) change 'Path related to deployment root' in Web facet settings to '/'.
3) wrap 'GWT Compiler Output' and 'Web facet resources' items in the artifact layout tree with 'Foo', 'bar', '1.0' folders.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
So, this does produce the desired result in the IJ module's output path (out/artifacts/...).
However, for running in the debugger, when the code is loaded from ~/.IntelliJIdea12/system/gwt/Project.534b2263/Test.ef6cd448/run/www/ the directory structure isn't being created. So, a request for /Foo/bar/1.0/Testing.html fails.
Not sure if it matters, and I should have mentioned this before, but I'm using the latest 12.1 EA (currently 128.18).
thanks,
jay
GWT files under .../run/www directory are generated by the GWT Dev Mode process and there is no way to change their layout from IDEA. You can use
'Testing.html' as a start page in the GWT Run configuration to fix the problem.
--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"