mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-15 16:28:56 +00:00
Merge pull request #316 from eclipse/cd_bug481287
[481287] Fixed bug in plugin.xml content comparison of xtext generator
This commit is contained in:
commit
b7801f175a
4 changed files with 32 additions and 2 deletions
|
@ -338,7 +338,7 @@ class XtextGenerator extends AbstractWorkflowComponent2 {
|
|||
if (root.isFile(pluginXml.path)) {
|
||||
// only write plugin.xml_gen if entries exist and content differs
|
||||
if (!pluginXml.entries.isEmpty
|
||||
&& root.readTextFile(pluginXml.path) != pluginXml.getContent
|
||||
&& root.readTextFile(pluginXml.path)?.toString != pluginXml.getContentString
|
||||
&& pluginXml.path.endsWith('.xml')) {
|
||||
pluginXml.path = pluginXml.path + '_gen'
|
||||
pluginXml.writeTo(root)
|
||||
|
|
|
@ -32,6 +32,10 @@ class TextFileAccess {
|
|||
return internalContents.toString
|
||||
}
|
||||
|
||||
def String getContentString() {
|
||||
return getContent.toString
|
||||
}
|
||||
|
||||
def void writeTo(IFileSystemAccess2 fileSystemAccess) {
|
||||
if (fileSystemAccess !== null) {
|
||||
fileSystemAccess.generateFile(path, content)
|
||||
|
|
|
@ -447,7 +447,29 @@ public class XtextGenerator extends AbstractWorkflowComponent2 {
|
|||
final IXtextGeneratorFileSystemAccess root = entry.getValue();
|
||||
boolean _isFile = root.isFile(pluginXml.getPath());
|
||||
if (_isFile) {
|
||||
if ((((!pluginXml.getEntries().isEmpty()) && (!Objects.equal(root.readTextFile(pluginXml.getPath()), pluginXml.getContent()))) && pluginXml.getPath().endsWith(".xml"))) {
|
||||
boolean _and = false;
|
||||
boolean _and_1 = false;
|
||||
boolean _isEmpty = pluginXml.getEntries().isEmpty();
|
||||
boolean _not = (!_isEmpty);
|
||||
if (!_not) {
|
||||
_and_1 = false;
|
||||
} else {
|
||||
CharSequence _readTextFile = root.readTextFile(pluginXml.getPath());
|
||||
String _string = null;
|
||||
if (_readTextFile!=null) {
|
||||
_string=_readTextFile.toString();
|
||||
}
|
||||
String _contentString = pluginXml.getContentString();
|
||||
boolean _notEquals = (!Objects.equal(_string, _contentString));
|
||||
_and_1 = _notEquals;
|
||||
}
|
||||
if (!_and_1) {
|
||||
_and = false;
|
||||
} else {
|
||||
boolean _endsWith = pluginXml.getPath().endsWith(".xml");
|
||||
_and = _endsWith;
|
||||
}
|
||||
if (_and) {
|
||||
String _path = pluginXml.getPath();
|
||||
String _plus = (_path + "_gen");
|
||||
pluginXml.setPath(_plus);
|
||||
|
|
|
@ -38,6 +38,10 @@ public class TextFileAccess {
|
|||
return this.internalContents.toString();
|
||||
}
|
||||
|
||||
public String getContentString() {
|
||||
return this.getContent().toString();
|
||||
}
|
||||
|
||||
public void writeTo(final IFileSystemAccess2 fileSystemAccess) {
|
||||
if ((fileSystemAccess != null)) {
|
||||
fileSystemAccess.generateFile(this.path, this.getContent());
|
||||
|
|
Loading…
Reference in a new issue