Repository navigation
Expand file tree
/
Copy pathBashGen.java
More file actions
101 lines (84 loc) · 2.32 KB
/
Copy pathBashGen.java
File metadata and controls
101 lines (84 loc) · 2.32 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
package shellScriptGen.shells;
/**
* This is a concrete implementation that generates BASH scripts to
* export the project.
*
* @author Amit Nithian ([email protected])
*
*/
public class BashGen extends UNIXShellBase
{
public String getComment()
{
// TODO Auto-generated method stub
return "#";
}
public String getFileExtension()
{
// TODO Auto-generated method stub
return ".sh";
}
public String createVariableDeclaration(String pName, String pValue)
{
// TODO Auto-generated method stub
return pName + "=\"" + pValue + "\"";
}
public String getScriptLine()
{
// TODO Auto-generated method stub
return "#!/bin/bash";
}
/*
protected void buildMainShellScript(ILaunchConfiguration pConfig)
{
// TODO Auto-generated method stub
// TODO Auto-generated method stub
// Create a shell script that will
//1) Source the preLaunch file
//2) Execute the code
//3) Source the post-launch file.
try
{
StringBuffer sJavaLine = new StringBuffer();
File fScript= getFile(pConfig.getName() + ".sh");
PrintWriter pWriter = new PrintWriter(new FileWriter(fScript));
pWriter.println("#!/bin/bash");
pWriter.println("#Automatically Generated");
pWriter.println("source preLaunch.sh");
String sClassPath = "export CP=" + getClassPath();
pWriter.println(sClassPath);
sJavaLine.append("java -cp ${CP} ");
sJavaLine.append(getJavaCommand(pConfig));
pWriter.println(sJavaLine.toString());
pWriter.println("source postLaunch.sh");
pWriter.flush();
pWriter.close();
addFileToFinishMessage(fScript);
}
catch(IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(CoreException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
protected void buildPostLaunchScript()
{
// TODO Auto-generated method stub
File fPost = getFile("postLaunch.sh");
if(!fPost.exists())
createBlankScript(fPost);
}
protected void buildPreLaunchScript()
{
// TODO Auto-generated method stub
File fPreFile = getFile("preLaunch.sh");
if(!fPreFile.exists())
createBlankScript(fPreFile);
}
*/
}