diff -r e61abb5095cb mobility.plugins.blackberry/manifest.mf --- a/mobility.plugins.blackberry/manifest.mf Sat Jul 19 05:56:16 2008 +0800 +++ b/mobility.plugins.blackberry/manifest.mf Tue Jul 22 16:28:26 2008 +0800 @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.mobility.plugins.blackberry +OpenIDE-Module-Implementation-Version: 1 OpenIDE-Module-Layer: org/netbeans/modules/mobility/plugins/blackberry/layer.xml OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/mobility/plugins/blackberry/Bundle.properties -OpenIDE-Module-Specification-Version: 1.0 diff -r e61abb5095cb mobility.plugins.blackberry/nbproject/project.properties --- a/mobility.plugins.blackberry/nbproject/project.properties Sat Jul 19 05:56:16 2008 +0800 +++ b/mobility.plugins.blackberry/nbproject/project.properties Tue Jul 22 16:28:26 2008 +0800 @@ -3,3 +3,4 @@ license.file=../cddl.txt nbm.module.author=Sun Microsystems nbm.homepage=http://mobility.netbeans.org/ +spec.version.base=1.0 diff -r e61abb5095cb mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/BlackBerryPlatformConfigurator.java --- a/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/BlackBerryPlatformConfigurator.java Sat Jul 19 05:56:16 2008 +0800 +++ b/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/BlackBerryPlatformConfigurator.java Tue Jul 22 16:28:26 2008 +0800 @@ -50,6 +50,7 @@ import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; +import java.util.jar.JarFile; import org.netbeans.spi.mobility.cldcplatform.CLDCPlatformDescriptor; import org.netbeans.spi.mobility.cldcplatform.CustomCLDCPlatformConfigurator; import org.openide.ErrorManager; @@ -66,10 +67,9 @@ } private static final String keyFiles[] = new String[] { - "simulator/handhelds.manifest.txt", "bin/rapc.exe", //NOI18N + "bin/rapc.exe", //NOI18N "bin/preverify.exe", "bin/JavaLoader.exe", "lib/net_rim_api.jar"}; //NOI18N - - private static final String BB_PLATFORM_NAME = "BlackBerry Device Simulator 2.3"; //NOI18N + //"simulator/handhelds.manifest.txt", private static final String CLASSPATH= "${platform.home}/lib/net_rim_api.jar"; //NOI18N @@ -88,10 +88,52 @@ if (!isPossiblePlatform(f)) return null; f = FileUtil.normalizeFile(f); File docs = FileUtil.normalizeFile(new File(f, "docs/api")); //NOI18N + String platformName = "BlackBerry JDE"; //NOI18N + BufferedReader br = null; try { - br = new BufferedReader(new FileReader(new File(f, "simulator/handhelds.manifest.txt"))); //NOI18N - String devNames[] = br.readLine().split(" ");//NOI18N + File manifest = new File(f, "simulator/handhelds.manifest.txt"); //NOI18N + String devNames[] = null; + if (manifest.exists()) + { + br = new BufferedReader(new FileReader(manifest)); + devNames = br.readLine().split(" ");//NOI18N + } + else + { + devNames = new String[]{"BlackBerry Device"};//NOI18N + platformName = "BlackBerry JDE Component Package"; + } + + File rim = new File(f, "lib/net_rim_api.jar"); + JarFile rimJar=null; + try { + rimJar = new JarFile(rim); + String version = rimJar.getManifest().getMainAttributes().getValue("MIDlet-Version"); + if (version==null || version.length()==0) + { + if (f.getName().toLowerCase().contains(platformName.toLowerCase())) + platformName = f.getName(); + else + platformName = platformName + " " + f.getName(); + } + else + { + version = removeBuildVersion(version); + platformName = platformName + " " + version; + } + } catch (IOException ex) { + //Exceptions.printStackTrace(ex); + } + finally + { + if (rimJar!=null) + try { + rimJar.close(); + } catch (IOException ex) { + } + } + ArrayList devices = new ArrayList(); ArrayList profiles = new ArrayList(); profiles.add(new CLDCPlatformDescriptor.Profile("CLDC", "1.1", "Connected Limited Device Configuration", CLDCPlatformDescriptor.ProfileType.Configuration, null, CLASSPATH, true)); //NOI18N @@ -103,10 +145,27 @@ for (int i=0; i3) + { + return version.substring(0,version.lastIndexOf(".")); + } + return version; + } } diff -r e61abb5095cb mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/blackberry-init --- a/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/blackberry-init Sat Jul 19 05:56:16 2008 +0800 +++ b/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/blackberry-init Tue Jul 22 16:28:26 2008 +0800 @@ -1,5 +1,5 @@ blackberry-init - + diff -r e61abb5095cb mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/create-cod --- a/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/create-cod Sat Jul 19 05:56:16 2008 +0800 +++ b/mobility.plugins.blackberry/src/org/netbeans/modules/mobility/plugins/blackberry/create-cod Tue Jul 22 16:28:26 2008 +0800 @@ -1,10 +1,40 @@ create-cod - + + + + + + +<loader version="1.0"> + <application id="${name}"> + <name> + ${MIDlet-Name} + </name> + <description> + ${MIDlet-Description} + </description> + <version> + ${MIDlet-Version} + </version> + <vendor> + ${MIDlet-Vendor} + </vendor> + <copyright> + ${MIDlet-Copyright} + </copyright> + <fileset Java="1.0"> + <directory/> + <files>${name}.cod</files> + </fileset> + </application> +</loader> + +