blob: 03210fcdeddc9205b2d311e94744afdfb3ec7345 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
package org.eclipse.emf.codegen.ecore.templates.editor;
import org.eclipse.emf.codegen.ecore.genmodel.*;
import java.util.*;
public class BuildProperties
{
protected static String nl;
public static synchronized BuildProperties create(String lineSeparator)
{
nl = lineSeparator;
BuildProperties result = new BuildProperties();
nl = null;
return result;
}
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected final String TEXT_1 = "# ";
protected final String TEXT_2 = "#";
protected final String TEXT_3 = NL + NL + "bin.includes = ";
protected final String TEXT_4 = ",\\" + NL + " icons/,\\";
protected final String TEXT_5 = NL + " META-INF/,\\";
protected final String TEXT_6 = NL + " plugin.xml,\\";
protected final String TEXT_7 = NL + " plugin.properties" + NL + "jars.compile.order = ";
protected final String TEXT_8 = NL + "source.";
protected final String TEXT_9 = " = ";
protected final String TEXT_10 = NL + "output.";
protected final String TEXT_11 = " = ";
protected final String TEXT_12 = "bin";
protected final String TEXT_13 = "war/WEB-INF/classes";
protected final String TEXT_14 = NL;
public String generate(Object argument)
{
final StringBuffer stringBuffer = new StringBuffer();
/**
* Copyright (c) 2002-2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
*/
GenModel genModel = (GenModel)argument;
String pluginClassesLocation = genModel.isRuntimeJar() ? genModel.getEditorPluginID()+".jar" : ".";
List<String> sourceFolders = genModel.getEditorSourceFolders();
{GenBase copyrightHolder = argument instanceof GenBase ? (GenBase)argument : argument instanceof Object[] && ((Object[])argument)[0] instanceof GenBase ? (GenBase)((Object[])argument)[0] : null;
if (copyrightHolder != null && copyrightHolder.hasCopyright()) {
stringBuffer.append(TEXT_1);
stringBuffer.append(copyrightHolder.getCopyright(copyrightHolder.getGenModel().getIndentation(stringBuffer)));
} else {
stringBuffer.append(TEXT_2);
}}
stringBuffer.append(TEXT_3);
stringBuffer.append(pluginClassesLocation);
stringBuffer.append(TEXT_4);
if (genModel.isBundleManifest()) {
stringBuffer.append(TEXT_5);
}
if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {
stringBuffer.append(TEXT_6);
}
stringBuffer.append(TEXT_7);
stringBuffer.append(pluginClassesLocation);
boolean first=true; for (Iterator<String> i = sourceFolders.iterator(); i.hasNext();) { String sourceFolder = i.next(); if (i.hasNext()){sourceFolder +=",\\";} if (first) {
stringBuffer.append(TEXT_8);
stringBuffer.append(pluginClassesLocation);
stringBuffer.append(TEXT_9);
stringBuffer.append(sourceFolder);
first=false;} else {
stringBuffer.append(sourceFolder);
}}
stringBuffer.append(TEXT_10);
stringBuffer.append(pluginClassesLocation);
stringBuffer.append(TEXT_11);
if (genModel.getRuntimePlatform() != GenRuntimePlatform.GWT) {
stringBuffer.append(TEXT_12);
} else {
stringBuffer.append(TEXT_13);
}
stringBuffer.append(TEXT_14);
return stringBuffer.toString();
}
}
|