Max Did It
Coding
,Sun
2 Comments
Tagged , ,

Hitting a Dead End with Facebook and Flash

I have made good progress the last couple of days. I learned a lot, and I got a lot of classes and neat features done. Too bad I won't be able to use any of them in my upcoming game.

I managed to create a working implementation of the Facebook Connect button in Flash. And I would have gotten away with it, too, if it wasn't for Flash's meddling security features.

Dead End

©2004-2012 ~NoxxStock

The work I got done will not go to waste. I'm sure I will be able to reuse most parts of it in the future. But for now, I have to admit that I've hit a dead end. This is what happened:

Read more...

Coding
,Fri
Post the First Comment
Tagged ,

Inheriting From Ivy XML Files

I have now talked about how you can publish artifacts to your local repository and how Ivy resolves dependencies for your project.

As mentioned, Ivy uses the ivy.xml to know what files and libraries your project depends on. Ivy tries to retrieve these and will copy them into your project folder.

In another post, I have described how I keep my Ant build.xml files small and clean by putting targets I use often into central files. But not only build.xml files can contain information you need time and time again. Certain dependencies or Ivy settings might be used in many projects, and I don't want to copy them around, either.

Matryoshka Dolls

© 2012 Max Knoblich


Maven has parent POM files, which are pom.xml files you can inherit from. All settings, dependencies, plugins etc. from the parent POM are used and can be extended or overwritten. With this, you can create a hierarchy of build files that you can combine as needed.

Ivy has a similar mechanism, though it is not as refined as Maven's. Still, you can use it to put often used dependencies in "parent Ivy XMLs".

Read more...

Coding
,Sat
1 Comment
Tagged ,

Resolve Dependencies With Ivy

In my last post, I wrote about how you can use Apache Ivy to automatically store your compiled components and libraries in a local repository. Now, why should you even do that? What's the point?

The point is, that now you can use Ivy to

  • automatically copy the libraries you need into your project's folder structure,
  • always retrieve the latest version of a library,
  • download libraries from remote repositories, provided you have access and
  • get dependencies that aren't even in any of your repositories.
Ivy: Work, Work

"Work, Work". Apache Ivy can take a bunch of manual tasks off your hands. © 2012 Max Knoblich

This is how I use Ivy to make working with libraries easier:
Read more...

Coding
,Thu
2 Comments
Tagged ,

Committing Artifacts with Ivy

In my last post, I talked about the build automatisation tool Apache Ant. Ant originated as a tool for Java developers and has been succeeded by Maven, which provides many nice features like dependency management.

Imagine you wouldn't have to download and copy any libraries into your project path and configure the classpath every time you start a new project or a new version of a library comes out. What if you had a tool that did that automatically for you? Maven does that, and more.

The Trouble With Flash And Maven

I guess for a Java developer there is currently no good reason to use Ant instead of Maven, but if you work with Actionscript or Flex, things are a little more complicated. Right now, FlexMojos is the only current plugin for Maven that allows you to compile SWF or SWC files.

Now, when FlexMojos happens to do what you want it to do, it's great! It's convenient and you can set up projects with unit tests and code coverage very quickly. However, if FlexMojos doesn't do what you expect it to, and that still happens quite often, you will have a very hard time figuring out what the problem is and how to fix it.

Because of this, I decided to keep using Ant to build my Actionscript projects for the moment. However, you can use Maven's automatic dependency management feature in Ant build scripts as well.

Read more...

Coding
,Tue
Post the First Comment
Tagged ,

How To Tidy Up Your Ant build.xml Files

Before I worked at Bigpoint, I built and published my Flash projects the naive way: Just press the right Button in the IDE, and then copy the result from the respective folder. As I learned there, using build scripts like Ant has many advantages over that method though. You can automatize many tasks like

  • deleting unnecessary files from previous builds,
  • copying assets to the target folder or
  • automatically providing libraries your project depends on.

What Annoyed Me About Ant So Far

Now, what bothered me a little bit about the way I used Ant was:

  • When I started a new project that I wanted to build with Ant, one of the first steps for me was: Open another, already working build.xml and copy all the stuff that already works and that I need. Which can be annoying and also means that you will have a lot of duplicate XML markup across a lot of different files.

  • Also, I have made the experience that build.xml files in bigger, complex projects using many different features can become very convoluted and confusing. Once your Ant build script spreads over several screens it can easily give you headaches.

What If I Told You...
Well, I dug a little through Ant's documentation (RTFM). What if I told you that you can make your project specific build.xml only a couple of lines long?
Read more...