Repository navigation
Expand file tree
/
Copy pathCShellGen.java
More file actions
91 lines (79 loc) · 2.13 KB
/
Copy pathCShellGen.java
File metadata and controls
91 lines (79 loc) · 2.13 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
package shellScriptGen.shells;
/**
* This is the concrete UNIX shell base that generates C-Shell
* scripts to export a java project.
* @author Amit Nithian ([email protected])
*
*/
public class CShellGen extends UNIXShellBase
{
public String getScriptLine()
{
// TODO Auto-generated method stub
return "#!/bin/csh";
}
public String createVariableDeclaration(String pName, String pValue)
{
// TODO Auto-generated method stub
return "set " + pName + "=\"" + pValue + "\"";
}
public String getFileExtension()
{
// TODO Auto-generated method stub
return ".csh";
}
/*
@Override
protected void buildPreLaunchScript()
{
// TODO Auto-generated method stub
File fPost = getFile("preLaunch.csh");
if(!fPost.exists())
createBlankScript(fPost);
}
@Override
protected void buildMainShellScript(ILaunchConfiguration pConfig)
{
// 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() + ".csh");
PrintWriter pWriter = new PrintWriter(new FileWriter(fScript));
pWriter.println("#!/bin/tcsh");
pWriter.println("#Automatically Generated");
pWriter.println("source preLaunch.csh");
pWriter.println("setenv CP " + getClassPath());
sJavaLine.append("java -cp ${CP} ");
sJavaLine.append(getJavaCommand(pConfig));
pWriter.println(sJavaLine.toString());
pWriter.println("source postLaunch.csh");
pWriter.flush();
pWriter.close();
super.addFileToFinishMessage(fScript);
}
catch(IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch(CoreException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
protected void buildPostLaunchScript()
{
// TODO Auto-generated method stub
File fPost = getFile("postLaunch.csh");
if(!fPost.exists())
createBlankScript(fPost);
}
*/
}