2 Replies Latest reply on May 16, 2003 2:38 PM by user57

    build questions: buildmagic and "@JDK1.4END@" in source

    clamprecht

      I've just downloaded the JBoss 3.0.6 source and successfully built it using the standard build script. However, I can't figure out a few things.

      1. In the source (under the connectors directory), there are some files with tags like "@JDK1.4START@" and "@JDK1.4END@" in them. They don't compile in my IDE (IntelliJ), but they compile fine using ant. I can guess what the tags are doing (conditional compilation of some sort), but can someone explain what is doing this conditional compilation?

      2. What is buildmagic, and where can I read more about it (other than just the source itself).

      Thanks,
      Chris

        • 1. Re: build questions: buildmagic and "@JDK1.4END@" in source
          yanikc

          1. Have a look with the ant documentation.

          The copy task allow you to have "filters" that pick things like @AAA@ in the source file and replace these element with something more appropriate.

          For instance, you may have @COPYRIGHT@ somewhere in the source-code that will be replaced by the real copyright notice in the generated source-code.

          2. Source is everything. For that reason, programmers should always put good comments in their code ;-)

          • 2. Re: build questions: buildmagic and "@JDK1.4END@" in source
            user57

            As mentioned above these are filter tokens. There purpose here is to allow for JDK 1.3.x & 1.4.x support out of the same build system. Since the Java language does not provide a preprocessor we had to use Ant and the copy task w/filters to preprocess select sources.

            I think it is sorta funny, this preprocessor thing... the designers of Java deemed a preprocessor as uneeded due to Java's portability (across systems). Yet, it seems they have over looked the need for portability between versions of Java!

            Bah, silly designers.

            --jason