File tree Expand file tree Collapse file tree 4 files changed +22
-5
lines changed
src/com/oracle/appbundler Expand file tree Collapse file tree 4 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ <h3>Parameters</h3>
93
93
file.</ td >
94
94
< td align ="center " valign ="top "> No</ td >
95
95
</ tr >
96
+ < tr >
97
+ < td valign ="top "> applicationCategory</ td >
98
+ < td valign ="top "> The application category.
99
+ Corresponds to the < code > LSApplicationCategoryType</ code > key in the < tt > Info.plist</ tt >
100
+ file.</ td >
101
+ < td align ="center " valign ="top "> No</ td >
102
+ </ tr >
96
103
< tr >
97
104
< td valign ="top "> mainclassname</ td >
98
105
< td valign ="top "> The name of the bundled application's main class.</ td >
Original file line number Diff line number Diff line change @@ -72,11 +72,8 @@ int launch(char *commandName) {
72
72
// Get the main bundle
73
73
NSBundle *mainBundle = [NSBundle mainBundle ];
74
74
75
- // Set the working directory to the main bundle root
76
- NSString *mainBundlePath = [mainBundle bundlePath ];
77
- if (chdir ([mainBundlePath UTF8String ]) == -1 ) {
78
- [NSException raise: @JAVA_LAUNCH_ERROR format: @" Could not set initial working directory." ];
79
- }
75
+ // Set the working directory to the user's home directory
76
+ chdir ([NSHomeDirectory () UTF8String ]);
80
77
81
78
// Get the main bundle's info dictionary
82
79
NSDictionary *infoDictionary = [mainBundle infoDictionary ];
@@ -114,6 +111,7 @@ int launch(char *commandName) {
114
111
}
115
112
116
113
// Set the class path
114
+ NSString *mainBundlePath = [mainBundle bundlePath ];
117
115
NSString *javaPath = [mainBundlePath stringByAppendingString: @" /Contents/Java" ];
118
116
NSMutableString *classPath = [NSMutableString stringWithFormat: @" -Djava.class.path=%@ /Classes" , javaPath];
119
117
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ public class AppBundlerTask extends Task {
65
65
private String signature = "????" ;
66
66
private String copyright = "" ;
67
67
68
+ private String applicationCategory = null ;
69
+
68
70
// JVM info properties
69
71
private String mainClassName = null ;
70
72
private FileSet runtime = null ;
@@ -117,6 +119,10 @@ public void setCopyright(String copyright) {
117
119
this .copyright = copyright ;
118
120
}
119
121
122
+ public void setApplicationCategory (String applicationCategory ) {
123
+ this .applicationCategory = applicationCategory ;
124
+ }
125
+
120
126
public void setMainClassName (String mainClassName ) {
121
127
this .mainClassName = mainClassName ;
122
128
}
@@ -390,6 +396,10 @@ private void writeInfoPlist(File file) throws IOException {
390
396
writeProperty (xout , "CFBundleVersion" , "1" );
391
397
writeProperty (xout , "NSHumanReadableCopyright" , copyright );
392
398
399
+ if (applicationCategory != null ) {
400
+ writeProperty (xout , "LSApplicationCategoryType" , applicationCategory );
401
+ }
402
+
393
403
// Write runtime
394
404
if (runtime != null ) {
395
405
writeProperty (xout , "JVMRuntime" , runtime .getDir ().getParentFile ().getParentFile ().getName ());
Original file line number Diff line number Diff line change @@ -115,6 +115,7 @@ questions.
115
115
displayname =" SwingSet 2"
116
116
identifier =" com.oracle.javax.swing.SwingSet2"
117
117
shortversion =" 1.0"
118
+ applicationCategory =" public.app-category.developer-tools"
118
119
mainclassname =" SwingSet2" >
119
120
<runtime dir =" ${ env.JAVA_HOME } " >
120
121
<exclude name =" db/" />
@@ -135,6 +136,7 @@ questions.
135
136
displayname =" SwingSet 2 (Plugin)"
136
137
identifier =" com.oracle.javax.swing.SwingSet2Plugin"
137
138
shortversion =" 1.0"
139
+ applicationCategory =" public.app-category.developer-tools"
138
140
mainclassname =" SwingSet2" >
139
141
<classpath file =" /Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar" />
140
142
<option value =" -Dapple.laf.useScreenMenuBar=true" />
You can’t perform that action at this time.
0 commit comments