3
\$\begingroup\$

I am new to compiling games with libgdx to be played on the web and I have some doubts perhaps someone can point me in the right direction:

Using the new gradle setup I wrote a simple game to learn how to deploy a game to be played on the web, but I am not sure what files have to be uploaded to my server.

1) Where is the compiled code I should deploy?: In some places I found that the "war" directory has the files I need to deploy. In other places I found that the "build/dist" (generated running gradle's dist task) has the files.

2) What files should I deploy: The war directory gives me the hint I should deploy everything into a servlet container like Tomcat because, besides of the name, I have a war directory structure (it has a WEB-INF sub-dir). But in the badlogic info I found it says I only need to deploy Assets, html, and the index.html file to a WEBSERVER.

Note: Both ways work, so perhaps the deployment of the full war is to be done under certain conditions. So which would these conditions be?

3) I've read about the SuperDev mode to debug the app. When I run the application I get a SuperDev blue button in the browser. When I compile using GWT (I understand this generates production mode) I stilll get the blue SuperDev button. Do I have to remove it manually, or am I doing something wrong?

Please, can someone put a bit of light on this?

\$\endgroup\$

1 Answer 1

4
\$\begingroup\$

The question is a little stale, but in case it still helps:

After you run ./gradlew html:dist to generate production code, you want to copy everything inside ./html/build/dist/ to your server. Running that command produces the code in that directory.

The code that's under the war directory and that has a Tomcat-like structure, I believe all that is for debugging. I think that is what gets produced from ./gradlew html:superDev. Running that code from a server will work too, but I think it still has dependencies on java applets or GWT. The production code doesn't have those dependencies--it's just html and javascript running webgl.

And finally, you're right that the issue of SuperDev button is annoying. The HTML template for index.html is in ./html/webapp/index.html, so you can take out the button there, but it will take it out for both production and debug builds. I don't know of a way to specify different templates for the two builds, so I just manually remove it before pushing to the server. All you have to remove it just that one anchor tag, and everything else works fine.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .