/**
 * 
 */
package jenkins.plugins.play;

/**
 * @author rafaelrezende
 * 
 */
public enum PlayTarget {

	// Default target
	NONE("", ""),

	// ERROR MESSAGES
	PLAY_1_X("play", "1."),
	PLAY_2_X("play", "2.2."),
	PLAY_2_3("activator", "2.2.3");

	/**
	 * Play executable. (i.e.: 'play' from first version until v2.2.3. Then 'activator')
	 */
	private String executable;
	/**
	 * Regular expression to identify the Play! version
	 */
	private String versionRegex;
	
	/**
	 * @return the executable
	 */
	public final String getExecutable() {
		return executable;
	}

	/**
	 * @return the versionRegex
	 */
	public final String getVersionRegex() {
		return versionRegex;
	}

	/**
	 * Private constructor. No external object can create targets.
	 * 
	 * @param code 
	 * @param message
	 */
	private PlayTarget(String code, String message) {
		this.executable = code;
		this.versionRegex = message;
	}

	@Override
	public String toString() {
		return executable + ": " + versionRegex;
	}
}

@@ -47,33 +47,464 @@
 %0A * 
-@author rafaelrezende%0A * 
+Play targets are used to identify which commands are available for a provided%0A * Play! installation in the job configuration of Jenkins. Every play target has%0A * a range of versions and a specific executable name.%0A * %0A * For instance, if the selected Play! installation is identified to be %222.2.1%22,%0A * it will fit in the range of 2-2.2 below and the 'play' executable will be%0A * used.%0A * A range %221-1%22 includes every version starting with 1 (i.e.: '1.2.3')
 %0A */
@@ -564,56 +564,164 @@
 %22, %22
-%22),%0A%0A%09// ERROR MESSA
+0.0.0%22, %220.0.0%22),%0A%0A%09// CUSTOM TAR
 GE
+T
 S%0A%09
-PLAY_1_X(%22play%22, %221.%22),
+// Any version started with %221.%22%0A%09PLAY_1_X(%22play%22, %221%22, %221%22),%0A%09// Any version started with %222.x.%22, with x from 0 to 2
 %0A%09PL
@@ -738,18 +738,79 @@
 ay%22,
+ %222%22,
  %222.2
-.
 %22),%0A
+%09// Any version started with %222.x.%22 with x from 3 to 99.%0A
 %09PLA
@@ -831,16 +831,21 @@
 or%22, %222.
+3%22, %22
 2.3%22);%0A%0A
@@ -921,16 +921,20 @@
 .3. Then
+%0A%09 *
  'activa
@@ -976,70 +976,43 @@
 le;%0A
-%09/**%0A%09 * Regular expression to identify the Play! version%0A%09 */
+%0A%09private String versionRangeMin;%0A%09
 %0A%09pr
@@ -1032,23 +1032,25 @@
 versionR
-ege
+angeMa
 x;%0A
-%09
 %0A%09/**%0A%09 
@@ -1172,19 +1172,138 @@
 versionR
-ege
+angeMin%0A%09 */%0A%09public final String getVersionRangeMin() %7B%0A%09%09return versionRangeMin;%0A%09%7D%0A%0A%09/**%0A%09 * @return the versionRangeMa
 x%0A%09 */%0A%09
@@ -1333,19 +1333,22 @@
 VersionR
-ege
+angeMa
 x() %7B%0A%09%09
@@ -1358,27 +1358,30 @@
 urn versionR
-ege
+angeMa
 x;%0A%09%7D%0A%0A%09/**%0A
@@ -1464,17 +1464,16 @@
 ram code
- 
 %0A%09 * @pa
@@ -1529,23 +1529,55 @@
  String 
-message
+versionRangeMin, String versionRangeMax
 ) %7B%0A%09%09th
@@ -1617,22 +1617,75 @@
 ionR
-egex = message
+angeMin = versionRangeMin;%0A%09%09this.versionRangeMax = versionRangeMax
 ;%0A%09%7D
@@ -1766,12 +1766,15 @@
 ionR
-egex
+angeMin
 ;%0A%09%7D

Version regex replaced by dotted-style ranges.