move to SNAPSHOT suffix for dev builds, when an actual release will take place, then change the version

This commit is contained in:
kimchy 2010-03-01 16:30:07 +02:00
parent 234a5abda0
commit bd8d52f3f8
4 changed files with 9 additions and 23 deletions

View File

@ -1,6 +1,6 @@
import java.text.SimpleDateFormat
defaultTasks "clean", "devRelease"
defaultTasks "clean", "release"
usePlugin BasePlugin
@ -11,8 +11,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
buildTimeStr = sdf.format(buildTime)
versionNumber = '0.5.0'
devBuild = true
versionNumber = '0.5.0-SNAPSHOT'
explodedDistDir = new File(distsDir, 'exploded')
explodedDistLibDir = new File(explodedDistDir, 'lib')
@ -20,12 +19,6 @@ explodedDistBinDir = new File(explodedDistDir, 'bin')
explodedDistConfigDir = new File(explodedDistDir, 'config')
gradle.taskGraph.whenReady {graph ->
if (graph.hasTask(':release')) {
devBuild = false
}
}
allprojects {
group = 'org.elasticsearch'
version = versionNumber
@ -97,12 +90,7 @@ zip.doFirst {task ->
}
}
task devRelease(dependsOn: [zip]) {
}
task release(dependsOn: [zip]) {
}
task wrapper(type: Wrapper) {

View File

@ -10,7 +10,6 @@ processResources.doLast {
Properties versionProps = new Properties();
versionProps.setProperty("number", rootProject.version)
versionProps.setProperty("date", buildTimeStr)
versionProps.setProperty("devBuild", rootProject.devBuild.toString())
File versionFile = new File(sourceSets.main.classesDir, "/org/elasticsearch/version.properties")
versionFile.parentFile.mkdirs()

View File

@ -26,13 +26,13 @@ import java.util.Properties;
import java.util.TimeZone;
/**
* @author kimchy (Shay Banon)
* @author kimchy (shay.banon)
*/
public class Version {
private static final String number;
private static final String date;
private static final boolean devBuild;
private static final boolean snapshotBuild;
static {
@ -46,10 +46,10 @@ public class Version {
}
number = props.getProperty("number", "0.0.0");
snapshotBuild = number.contains("-SNAPSHOT");
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
date = props.getProperty("date", sdf.format(new Date()));
devBuild = Boolean.parseBoolean(props.getProperty("devBuild", "false"));
}
public static String number() {
@ -60,16 +60,15 @@ public class Version {
return date;
}
public static boolean devBuild() {
return devBuild;
public static boolean snapshotBuild() {
return snapshotBuild;
}
public static String full() {
StringBuilder sb = new StringBuilder("ElasticSearch/");
sb.append(number);
if (devBuild) {
if (snapshotBuild) {
sb.append("/").append(date);
sb.append("/dev");
}
return sb.toString();
}

View File

@ -72,7 +72,7 @@ public class RestMainAction extends BaseRestHandler {
if (settings.get("name") != null) {
builder.field("name", settings.get("name"));
}
builder.startObject("version").field("number", Version.number()).field("date", Version.date()).field("devBuild", Version.devBuild()).endObject();
builder.startObject("version").field("number", Version.number()).field("date", Version.date()).field("snapshotBuild", Version.snapshotBuild()).endObject();
builder.field("version", Version.number());
builder.field("tagline", "You Know, for Search");
builder.field("cover", "DON'T PANIC");