https://github.com/libgdx/libgdx/wiki/Running-demos-%26-tests
Yes, I read that.
>If you did not run 'ant -f fetch.xml' before this point, you will encounter many errors here due to missing backends.
I worked up to this point and I'm getting literally thousands of errors. Everything is not there. I have no idea how to use ant, and I'm having a lot of trouble figuring out how to install it and "run ant -f fetch.xml".
I went to http://ant.apache.org/ and found a download, but it's just got a bunch of .bat and other files in there. No installer or anything. I'm pretty much lost at this point.
make
's fine. I mean, could use Ant if you want to get even more fancy, or perhaps Grunt or Gulp if ya really wanna get fancy. But make is generally fine I feel. It just sounded like this person is tired of micromanaging a build pipeline and wants to automate it so that it watches for changes and automagically recompiles everything necessary in the appropriate order or executon. Except now your talking about using a build system like a scripting system and will spend significant portions of your time ironing out the process. And when all is said and done, now a new project is brought into it all, and now you need to revisit your pipeline and cram the new thing in amongst the other things and requires another significant investment of time.
When at the end of the day, I think he's looking for a system script to just simply automate poking the makes, like python or vbs or something.
You need to tell javac where to look for compiled classes:
javac -classpath classes -d classes src/rps/Strategy.java
This is why it's usually better to use an IDE, or if that's not allowed, a build system such as Ant.
Also, in looking at the other classes you uploaded, the packaging appears incorrect. You have classes in the strategy directory, but the package in the code is rps. This will not compile.
Look at your Netbeans generated build.xml, it will list some hooks, You can add a "-post-jar" target that will automatically get called as part of the normal build process everytime netbeans builds the jar. Inside that use a zip task to zip all the files you want into a zip file. Ant zip task
Honestly, my opinion might be unpopular but you really don't need all that much to program. Sure XCode, eclipse, etc. are all great IDEs, but you lose out on a lot by not learning how to compile and build software systems from command line. Like, if you work with java, learn how to compile a project using ant.
Certainly text editors such as Atom are must. But in production software, it may be rare to use debuggers or native compilers from an IDE.
To contribute to useful utilities, I would recommend CyberDuck for FTP/SFTP connections.
Here's a link to the manual of Ant that details the installation process. It's the first thing that comes up when googling for 'install ant'. Ant is only required if you want to work from source.
This is not intended to sound mean, but we have to assume that our users are vapable of installing the 5 dependencies required to work with libGDX by reading the install guides if these tools.
Something like Maven,Gradle,Ant. They allow automatic dependencies managment (So you don't have paths like X:/Libraries/Downloads/bcel-6.5.0.jar in your .classpath).
So people can simply download your script and run: "mvn compile", it downloads a bunch of jars+ dependencies and then for example "mvn package" to generate a .jar file...
http://ant.apache.org/ivy/features.html
Google clearly never heard of Apache Ivy and were determined to repeat all of its mistakes.
Apache Maven may have a steep learning curve and suffers lazy dev's copy pasting errors, generally they all build with a little effort constructing a m2 setting file and they build. Then a day or two to delete rubbish config.
Some of the Ivy setups I've inherited have been horrific, my favourite was one requiring 3 mapped drives, in specific locations, with the same config littered on each share, using different property values.
But Google wouldn't let that kind of idiocy...
Someone asked me to look over a Gradle project they were reviewing, person had put the java all under src/java with no package folders and hacked Gradle to deal with it, alas the config for this was a Gradle file pulled from the users local machine. Our only hinting was a local file being loaded under a profile.
Sigh (yes you can write nice Gradle, but like Ivy its easy to create a horrific mess)
I was stumped on that at first, too. I had to download Apache Ant and set it up according to their instructions. Try searching for "ant xml" on google and you might find yourself down the same rabbit hole I found myself at last night. Essentially though, you download it, extract it, set up some stuff in your windows variables, then run it through the commandline with the command: ant -buildfile "c:\directory\build.xml" Although, I believe they said they used Maven and NSIS, so maybe better luck would be had with those? Here's the page where they posted how to compile Xadrian, which mentions those two programs. I think Maven may possibly contain ant, I have no idea. Their instructions on how to mod Xadrian are very vague. They're literally "here's some files, I'm not gonna tell you what to do with them. Good luck." lol
Yeah, there are sysadmin jobs and release management jobs that fit under that category. There's an entire team at the company I work at, they work very closely with Jenkins, POM files, Ant builds, Groovy scripts, shell scripts, etc.
There's more to it than coding, though. What you'll lack in knowledge of programming you'll have to make up for in knowledge of systems management, source code management, sysadmin, release management, etc.
There are also tons of jobs that similarly involve databases, where you're not necessarily programming but more using a programming language to interface with a database, data analysis, reporting, etc.
> Am I supposed to handcode my build.xml?
I always have, but there are probably generators for you out there, including maybe something in eclipse?
> Ant's buildfiles will let anyone build it (as long as they have javac)
Well, as long as you have ant, javac, and whatever else your build file requires.
> Why package things as .jars?
When you run or install something do you get a folder of 10,000 files or a single file that can be run / executed?
> Can someone point me to some good tutorials to learn Ant?
> Should I even use Ant over other build automators like Gradle/Maven?
I don't have much experience with either of these but they are certainly options. I know gradle has templates which sounds like something you're looking for.
Thanks this is very useful.
I found the ant download page and got apache-ant-1.9.3. I'm not sure if installing Ant means to extract the files only. There is no executable file to 'run' ant.
Edit: Fount it
Edit2: I got this error:
>C:\pdfsam\pdfsam-2.2.2-build-src\pdfsam-maine\ant>ant >Buildfile: C:\pdfsam\pdfsam-2.2.2-build-src\pdfsam-maine\ant\build.xml > >init: > >make-structure: > >compile: > [javac] C:\pdfsam\pdfsam-2.2.2-build-src\pdfsam-maine\ant\build.xml:113: warning: 'includeantruntime' >was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds > [javac] Compiling 157 source files to C:\media\LACIE\build-2\pdfsam-maine\build > >BUILD FAILED >C:\pdfsam\pdfsam-2.2.2-build-src\pdfsam-maine\ant\build.xml:113: C:\media\LACIE\ >pdfsam\workspace-enhanced\libraries-2 does not exist. > >Total time: 0 seconds
I played around by creating the folders tree. Then it gave another error with another missing folder. I think I need to edit the build.xml file in a way to fix this issue.
Ant is an external program that takes an XML description of what to build, and then spits out your project. You'll need to download it, extract it somewhere and add the path to ant to your environment variables. There's some brief instructions on how to do that here.
http://ant.apache.org/manual/install.html
Once you've done that, go to your project directory and generate a build description with
android update project -p . -t "android-10"
Where "android-10" is your api level of choice, (you can see which ones you have installed by running 'android list targets'). You should see it generate a few properties files and your build.xml project description. You should be able to run ant debug to generate your apk thereafter.
If that all works, you can use
ant debug install
as a shortcut to build and deploy straight to the device.
It is peculiar that eclipse doesn't want to build your project if adt is set up correctly and you have targets downloaded in the sdk.
would suggest looking into Apache Ant, takes a bit to get used to but is super beneficial to learn as you can set it up to build, jar and sign you jar file without having to do it manually.
Ant resources: http://ant.apache.org/manual/install.html http://ant.apache.org/manual/tutorial-HelloWorldWithAnt.html http://www.javaworld.com/jw-10-2000/jw-1020-ant.html
It's been a while since I did any Ant scripting but I think you could use the Echo task to write to an XML strings/values file which your program could then reference (assuming it was done early enough in the compile.)
I believe this is what you're looking for. Just include the 3rd party jar file and run it.
For real production use, learn Apache Ant . It's basically like C++'s make tool. In there, you can specify your dependencies etc and you can use it to create executable jar files too. Good luck!
It's not a language. It's a command line program with xml configuration(yes I know it sucks) to make java apps. Here's an example .
Basically Ant allows you to compile your sources, create an executable jar file etc without the need of an IDE. Why is this good? Portability. Most people in this industry uses Maven or Ant, though I have not use Maven before.