Skip to content

Instantly share code, notes, and snippets.

@ran488
Created May 24, 2011 20:54
Show Gist options
  • Save ran488/989664 to your computer and use it in GitHub Desktop.
Save ran488/989664 to your computer and use it in GitHub Desktop.
SCM Version Annotation
package com.ran488.samples.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Documented;
/**
* Custom annotation type used to annotate classes with the SCM version id
* string, instead of putting the value in a String field or comment.
* Since this is a runtime annotation, the version string can be extracted
* out of compiled classes with a decompiler.
* Example of usage (ClearCase):
* <CODE>
* @VersionId("@(#) SomeClass.java [@@/main/some_branch/2]>")
* public class SomeClass {
* ...
* </CODE>
*/
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface VersionId {
String value();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment