Skip to content

Commit

Permalink
BlackBerry10
Browse files Browse the repository at this point in the history
  • Loading branch information
don committed Nov 6, 2013
1 parent 0a14dd4 commit f53b824
Show file tree
Hide file tree
Showing 1,432 changed files with 283,724 additions and 436 deletions.
6 changes: 3 additions & 3 deletions platforms/android/res/xml/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<feature name="App">
<param name="android-package" value="org.apache.cordova.App" />
</feature>
<feature name="NfcPlugin">
<param name="android-package" value="com.chariotsolutions.nfc.plugin.NfcPlugin" />
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device" />
</feature>
Expand All @@ -24,4 +21,7 @@
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<content src="index.html" />
<feature name="NfcPlugin">
<param name="android-package" value="com.chariotsolutions.nfc.plugin.NfcPlugin" />
</feature>
</widget>
Binary file added platforms/blackberry10/build/device/bb10app.bar
Binary file not shown.
Binary file not shown.
7 changes: 7 additions & 0 deletions platforms/blackberry10/cordova/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
CORDOVA_DIR=$(dirname "$0")
source "$CORDOVA_DIR/init"

#package app
"$CORDOVA_NODE/node" "$CORDOVA_DIR/lib/build" "$@"

21 changes: 21 additions & 0 deletions platforms/blackberry10/cordova/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ECHO OFF
goto comment
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
:comment
call "%~dps0init"
"%CORDOVA_NODE%\node.exe" "%~dps0\lib\build" %*
5 changes: 5 additions & 0 deletions platforms/blackberry10/cordova/clean
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
CORDOVA_DIR=$(dirname "$0")
source "$CORDOVA_DIR/init"

"$CORDOVA_NODE/node" "$CORDOVA_DIR/lib/clean"
21 changes: 21 additions & 0 deletions platforms/blackberry10/cordova/clean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ECHO OFF
goto comment
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
:comment
call "%~dps0init"
"%CORDOVA_NODE%\node.exe" "%~dps0\lib\clean" %*
Binary file added platforms/blackberry10/cordova/default-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions platforms/blackberry10/cordova/defaults.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!--
Widget Configuration Reference:
http://docs.blackberry.com/en/developers/deliverables/15274/
-->

<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:rim="http://www.blackberry.com/ns/widgets"
version="1.0.0.1" id="com.megster.nfc.reader">

<name>Webworks Application</name>

<author>Your Name Here</author>

<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>

<license href="http://opensource.org/licenses/alphabetical">
</license>

<!-- Expose access to all URIs, including the file and http protocols -->
<access subdomains="true" uri="file:///store/home" />
<access subdomains="true" uri="file:///SDCard" />
<access subdomains="true" uri="*" />

<icon src="res/icon/blackberry10/icon-80.png" />
<rim:splash src="res/screen/blackberry10/splash-1280x768.png" />
<rim:splash src="res/screen/blackberry10/splash-720x720.png" />
<rim:splash src="res/screen/blackberry10/splash-768x1280.png" />

<content src="index.html" />

<rim:permissions>
<rim:permit>access_shared</rim:permit>
</rim:permissions>

</widget>
53 changes: 53 additions & 0 deletions platforms/blackberry10/cordova/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#! /bin/sh
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#!/bin/sh
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
LOCAL_NODE_BIN=$CURRENT_DIR/dependencies/node/bin
LOCAL_BBTOOLS=$CURRENT_DIR/dependencies/bb-tools/bin

if [ -z "$CORDOVA_NODE" ]; then
if [ -x "$LOCAL_NODE_BIN" ]; then
#set CORDOVA_NODE to local node version, if exists
CORDOVA_NODE=$LOCAL_NODE_BIN
else
#set CORDOVA_NODE to whichever node is on path, if exists
NODE_PATH=$(command -v node)
if [ ! -z "$NODE_PATH" ]; then
CORDOVA_NODE=$(dirname $NODE_PATH)
fi
fi

export CORDOVA_NODE=$CORDOVA_NODE
fi

if [ -z "$CORDOVA_BBTOOLS" ]; then
if [ -x "$LOCAL_BBTOOLS" ]; then
#set CORDOVA_BBTOOLS to local bbtools, if exists
CORDOVA_BBTOOLS=$LOCAL_BBTOOLS
else
#set CORDOVA_BBTOOLS to whichever bbtools is on path, if exists
BBTOOLS_PATH=$(command -v blackberry-nativepackager)
if [ ! -z "$BBTOOLS_PATH" ]; then
CORDOVA_BBTOOLS=$(dirname $BBTOOLS_PATH)
fi
fi

export CORDOVA_BBTOOLS=$CORDOVA_BBTOOLS
fi

103 changes: 103 additions & 0 deletions platforms/blackberry10/cordova/lib/bar-builder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/*
* Copyright 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var jWorkflow = require("jWorkflow"),
wrench = require("wrench"),
nativePkgr = require("./native-packager"),
fileManager = require("./file-manager"),
localize = require("./localize"),
logger = require("./logger"),
signingHelper = require("./signing-helper"),
targetIdx = 0;

function buildTarget(previous, baton) {
baton.take();

var target = this.session.targets[targetIdx++],
session = this.session,
config = this.config;

//Create output folder
wrench.mkdirSyncRecursive(session.outputDir + "/" + target);

//Copy resources (could be lost if copying assets from other project)
fileManager.copyNative(this.session, target);
//Generate user config here to overwrite default
fileManager.generateUserConfig(session, config);

if (config.packageCordovaJs) {
//Package cordova.js to chrome folder
fileManager.copyWebworks(this.session);
}

//Generate frameworkModules.js (this needs to be done AFTER all files have been copied)
fileManager.generateFrameworkModulesJS(session);

//Call native-packager module for target
nativePkgr.exec(session, target, config, function (code) {
if (code !== 0) {
logger.error(localize.translate("EXCEPTION_NATIVEPACKAGER"));
baton.pass(code);
} else {
if (target === "device" && session.isSigningRequired(config)) {
signingHelper.execSigner(session, target, function (error) {
if (error && error.code) {
baton.pass(error.code);
} else {
//Pass 0 to signify success
baton.pass(0);
}
});
} else {
baton.pass(code);
}
}
});
}

function buildWorkflow(session, context) {
if (session.targets && session.targets.length > 0) {
var order;

session.targets.forEach(function (target, idx) {
if (idx === 0) {
order = jWorkflow.order(buildTarget, context);
} else {
order = order.andThen(buildTarget, context);
}
});

return order;
} else {
logger.debug("NOTHING TO BUILD, NO TARGETS");
}
}

module.exports = {
build: function (session, config, callback) {
var context = {
session: session,
config: config
},
workflow = buildWorkflow(session, context);

if (workflow) {
workflow.start({
"callback": callback
});
}
}
};
27 changes: 27 additions & 0 deletions platforms/blackberry10/cordova/lib/bar-conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2012 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

var self = {};

self.ROOT = "";
self.CHROME = self.ROOT + "/chrome";
self.LIB = self.CHROME + "/lib";
self.EXT = self.CHROME + "/plugin";
self.UI = self.ROOT + "/ui-resources";
self.PLUGINS = self.ROOT + "/plugins";
self.JNEXT_PLUGINS = self.ROOT + "/plugins/jnext";

module.exports = self;
Loading

0 comments on commit f53b824

Please sign in to comment.