33.4. Compatibility Framework

Internally to abuild's implementation, there is an object called CompatLevel that encapsulates the compatibility level for any given run of abuild. The code itself is careful to wrap deprecated or backward compatibility code in checks to compat_level.allow_1_0() (or whatever version is appropriate). This helps to keep backward compatibility code isolated and makes it easy to remove at some future time. It also makes it relatively straightforward to implement being able to run abuild at a newer compatibility level.

Many of abuild's test suites run the same tests at different compatibility levels to ensure that, when compatibility code is not required, it doesn't get in the way.

If one were to remove compatibility code from abuild, it would be necessary to check for variables that are no longer used because of the removal of compatibility support. The intent is that all such variables are commented with something that contains the string compat. Searching for compat should be an excellent starting point for locating all backward compatibility code.

As of version 1.1, there is no backward compatibility code in the Groovy backend (since it is new in 1.1) or the old ant backend (since it is deprecated in 1.1). When abuild invokes the make backend, it passes the compatibility level in a make variable. This makes it possible for various make code to be conditional upon whether a particular version is supported. In versions after 1.1, if the need arises, a similar capability could easily be added to the Groovy backend by using the BuildArgs object to hold into this information.