mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
Use new xtext gradle plugins. Added some javadoc
Signed-off-by: Dennis Huebner <dennis.huebner@gmail.com>
This commit is contained in:
parent
5d97b8661f
commit
47f58cec18
1 changed files with 53 additions and 35 deletions
|
@ -6,16 +6,62 @@ import java.net.URL
|
|||
import java.util.jar.Manifest
|
||||
import org.eclipse.emf.common.EMFPlugin
|
||||
import org.eclipse.xtend.lib.annotations.Data
|
||||
|
||||
/**
|
||||
* @since 2.9
|
||||
*/
|
||||
@Data
|
||||
class XtextVersion {
|
||||
|
||||
|
||||
String version
|
||||
|
||||
static def getCurrent() {
|
||||
new XtextVersion(readVersionFromManifest ?: 'unknown')
|
||||
}
|
||||
|
||||
def getXtextGradlePluginVersion() {
|
||||
'1.0.2'
|
||||
}
|
||||
|
||||
/**
|
||||
* @noreference
|
||||
*/
|
||||
def getMweVersion() {
|
||||
'2.8.3'
|
||||
}
|
||||
|
||||
def getXtendGradlePluginVersion() {
|
||||
xtextGradlePluginVersion
|
||||
}
|
||||
|
||||
/**
|
||||
* @noreference
|
||||
*/
|
||||
def getXtendAndroidGradlePluginVersion() {
|
||||
xtendGradlePluginVersion
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if the current version ends with '-SNAPSHOT'
|
||||
*/
|
||||
def isSnapshot() {
|
||||
version.endsWith("-SNAPSHOT")
|
||||
}
|
||||
|
||||
/**
|
||||
* @return <code>true</code> if the current version is not a snapshot and not a release<br>
|
||||
* Release builds must match a following pattern: N.N(.N)+<br>
|
||||
* (N is a digit)<br>
|
||||
* For example 2.9.2 is a release, 2.9.2.beta3 is stable.
|
||||
*/
|
||||
def isStable() {
|
||||
return !isSnapshot && !version.matches("\\d+\\.\\d+(\\.\\d+)+")
|
||||
}
|
||||
|
||||
override toString() {
|
||||
version
|
||||
}
|
||||
|
||||
private static def readVersionFromManifest() {
|
||||
var InputStream is
|
||||
try {
|
||||
|
@ -27,51 +73,23 @@ class XtextVersion {
|
|||
return null;
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try { is.close() }
|
||||
catch (IOException e) {}
|
||||
try {
|
||||
is.close()
|
||||
} catch (IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class Plugin extends EMFPlugin {
|
||||
public static final Plugin INSTANCE = new Plugin
|
||||
|
||||
private new() {
|
||||
super(#[]);
|
||||
}
|
||||
|
||||
override getPluginResourceLocator() {
|
||||
}
|
||||
}
|
||||
|
||||
String version
|
||||
|
||||
def isSnapshot() {
|
||||
version.endsWith("-SNAPSHOT")
|
||||
}
|
||||
|
||||
def isStable() {
|
||||
return !isSnapshot && !version.matches("\\d+\\.\\d+(\\.\\d+)+")
|
||||
}
|
||||
|
||||
def getXtendGradlePluginVersion() {
|
||||
xtextGradlePluginVersion
|
||||
}
|
||||
|
||||
def getXtendAndroidGradlePluginVersion() {
|
||||
'0.4.14'
|
||||
}
|
||||
|
||||
def getXtextGradlePluginVersion() {
|
||||
'1.0.1'
|
||||
}
|
||||
|
||||
/**
|
||||
* @noreference
|
||||
*/
|
||||
def getMweVersion() {
|
||||
'2.8.3'
|
||||
}
|
||||
|
||||
override toString() {
|
||||
version
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue