Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Build automation and publishing  (Read 1665 times)
0 Members and 1 Guest are viewing this topic.
Offline Gudradain
« Posted 2012-06-21 12:49:56 »

Hello,

I have a game I'm working on currently and I would like to make a lot of quick updates to it. The game is still in it's infancy but I would like to build it in front of the public. For example, some days I would be working on it 30 minutes but I would like to make those 30 minutes of work available for testing right away.

Currently, publishing something takes me a while. I'm working with eclipse. What I usually do is put all my classes files in some place with the resources, go with command line to that place build the jar specifying the entry point. Log into my ftp account, select the jar and upload it to my web site. And I write a simple applet tag for my website. It's not that long but it still takes a few minutes and it's boring work.

Is there a better/faster way to do it?

Recently I heard about Gradle and took a quick glance at it. It seems to be the thing that I need to build my jar and upload it in 1 click. Am-I right?

Offline Regenuluz
« Reply #1 - Posted 2012-06-21 12:55:12 »

Well, Eclipse can build the Jar file for you. Under "File"->"Export" select runnable jar, for a standalone jar file, or just jar if you use it as an applet.

Or else you could probably write a script that does all of the work for you. Smiley
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #2 - Posted 2012-06-21 12:56:24 »

Is there a better/faster way to do it?

Yes, make yourself an Ant build script that can compile, jar and upload your game in a single task. Then it's a one-click operation. Eclipse has Ant support built in so you can run it within Eclipse as well.

Someone will probably be along in a moment to suggest you use Maven instead, which is essentially the same thing but more complicated.  Wink

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Danny02
« Reply #3 - Posted 2012-06-21 13:21:54 »

Is there a better/faster way to do it?

Yes, make yourself an Ant build script that can compile, jar and upload your game in a single task. Then it's a one-click operation. Eclipse has Ant support built in so you can run it within Eclipse as well.

Someone will probably be along in a moment to suggest you use Maven instead, which is essentially the same thing but more complicated.  Wink

sry Orangy Tang, but can there be something more complicated then ANT?

with ANT one have to programm huge script files to do basic stuff,
with maven you copy past 3 lines and change some parameters and you get a build which packs all dependencie together, zip, pack, sign and upload them to your ftp
MAVEN!!!!

Offline Gudradain
« Reply #4 - Posted 2012-06-21 14:24:51 »

Well currently I don't Ant or Maven so both look complicated Smiley

Is an ftp account enough to automatically upload something with Ant or Maven?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2012-06-21 14:53:26 »

Yes, there's an FTP task in Ant: http://ant.apache.org/manual/Tasks/ftp.html

It's got some external dependencies so you need to download a couple of extra jars but that's pretty simple.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline impaler

Senior Newbie





« Reply #6 - Posted 2012-06-21 15:16:05 »

Spending even half a day on learning something like this will pay off big time! Not just on your hobby projects but pretty much in any job you will get as a software developer you will need to use these.

Also laziness is one of the 3 virtues remember? http://c2.com/cgi/wiki?LazinessImpatienceHubris

Now be lazy and write a script that will do that for you!
Offline sproingie

JGO Kernel


Medals: 202



« Reply #7 - Posted 2012-06-21 15:19:41 »

This is the maven 'deploy' goal.  You just point maven at a remote server and do 'mvn deploy'

http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

http://www.sonatype.com/books/mvnref-book/reference/

Offline Gudradain
« Reply #8 - Posted 2012-06-21 15:56:57 »

Hmmm, but how do you use Maven with Eclipse? Do you need to create the project with Maven first then you create an eclipse project with Eclipse then you link to the source of the Maven Project?

Edit : It seems to work that way. But could you do it the other way around? Creating eclipse project first then adding the POM.xml file?
Offline impaler

Senior Newbie





« Reply #9 - Posted 2012-06-21 16:05:52 »

You can use the maven eclipse plugin.
http://www.sonatype.org/m2eclipse

All you need is a pom.xml file and you can right click in eclipse on the project and pick Maven -> Enable or something similar and there you have it.

Even without having it in eclipse, you would need to write at the prompt: mvn deploy

That's it.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 202



« Reply #10 - Posted 2012-06-21 16:38:50 »

You're not going to want to overlay maven onto an existing eclipse project, since that'd not only force you to write a POM from scratch, you'd also have to override all the directory layouts.  Just install the plugin from the eclipse marketplace (search for "maven"), restart eclipse, then when you create a new project, pick "Maven Project".

You can run goals from eclipse using the maven window, but I tend to use the command line for stuff that isn't build or test related.
Offline Damocles
« Reply #11 - Posted 2012-06-21 17:16:06 »

Why not write a simple batch script?

I never understand this fuzz with ant for small Projects.
Its fine when you have experience in ant anyhow or for a colaborative project, but why use something complicated
when you just want some build-commands to be executed linearily.

Offline impaler

Senior Newbie





« Reply #12 - Posted 2012-06-21 17:31:11 »

Isn't this what Ant is doing? Just instead of shell scripting, one writes in XML.

For what is needed here, 2 commands in a shell-script suffice though...
Offline Gudradain
« Reply #13 - Posted 2012-06-21 17:32:19 »

I guess it's good learning Smiley

OK, maven setup and it build an executable jar file when I type mvn package in command prompt. Is there a faster way to do it using the eclipse plugin?

Now, I'm stuck on deployment.
http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html

It says that you need to add something in your Setting.xml file but I don't have a Setting.xml file? Do I just create one in my project next to the pom.xml file?

Edit : Or does it just say to put a tag <settings> into your pom.xml file?
Offline impaler

Senior Newbie





« Reply #14 - Posted 2012-06-21 17:47:53 »

The settings.xml file is your maven configuration.
It can be found in your HOME_DIRECTORY/.m2/settings.xml

If you're on windows is
c:\Users\<you>\m2\settings.xml  (win 7)
c:\Documents and Settings\<you>\m2\settings.xml (XP and 2003)

For unix systems is ~/.m2/settings.xml

More on the settings.xml can be found here: http://maven.apache.org/settings.html but I wouldn't worry too much about reading it.
Offline Gudradain
« Reply #15 - Posted 2012-06-21 17:58:49 »

I found a settings.xml file in the conf folder. I guess it's that one!

Can I change the name ftp-repository for what I want here?

1  
2  
3  
4  
5  
6  
<distributionManagement>
    <repository>
      <id>ftp-repository</id>
      <url>ftp://repository.mycompany.com/repository</url>
   </repository>
</distributionManagement>


Edit : yes I can...
Offline Gudradain
« Reply #16 - Posted 2012-06-21 18:21:51 »

Thx for the help everyone. Everything is setup and work Smiley
Offline sproingie

JGO Kernel


Medals: 202



« Reply #17 - Posted 2012-06-22 02:13:53 »

I found a settings.xml file in the conf folder. I guess it's that one!

Can I change the name ftp-repository for what I want here?


Those are your global settings that affect every project using that installation of maven.  You can put it there, and it does make sense to put some deployment stuff there, but otherwise most stuff should go in pom.xml instead.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (24 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!