mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-20 23:56:20 +08:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cordova-android
This commit is contained in:
commit
09b753d09e
@ -1,2 +0,0 @@
|
||||
#! /usr/bin/env node
|
||||
require('nodeunit').reporters.default.run(['bin/tests'])
|
47
bin/bench
47
bin/bench
@ -1,47 +0,0 @@
|
||||
#! /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.
|
||||
#
|
||||
#
|
||||
#
|
||||
# Creates an app in `./bench` that posts results to http://cordova-bench.heroku.com with current cordova/Android sha.
|
||||
#
|
||||
# USAGE
|
||||
# ./bin/bench
|
||||
#
|
||||
|
||||
# clobber any existing bench
|
||||
if [ -e ./bench ]
|
||||
then
|
||||
rm -rf ./bench
|
||||
fi
|
||||
|
||||
# create a benching app
|
||||
./bin/create ./bench org.apache.cordova.bench cordovaBench
|
||||
|
||||
# grab the latest bench www code
|
||||
git clone git@github.com:brianleroux/cordova-bench.git
|
||||
|
||||
# copy it into the app
|
||||
cat ./cordova-bench/www/index.html > ./bench/assets/www/index.html
|
||||
#cat ~/Desktop/cordova-bench/www/index.html > ./bench/assets/www/index.html
|
||||
|
||||
# clean up
|
||||
rm -rf ./cordova-bench
|
||||
|
||||
# launch to the first device found
|
||||
./bin/debug ./bench
|
@ -47,8 +47,8 @@ fi
|
||||
# cleanup after exit and/or on error
|
||||
function on_exit {
|
||||
echo "Cleaning up ..."
|
||||
[ -f $BUILD_PATH/framework/libs/commons-codec-1.6.jar ] && rm $BUILD_PATH/framework/libs/commons-codec-1.6.jar
|
||||
[ -d $BUILD_PATH/framework/libs ] && rmdir $BUILD_PATH/framework/libs
|
||||
# [ -f $BUILD_PATH/framework/libs/commons-codec-1.6.jar ] && rm $BUILD_PATH/framework/libs/commons-codec-1.6.jar
|
||||
# [ -d $BUILD_PATH/framework/libs ] && rmdir $BUILD_PATH/framework/libs
|
||||
[ -f $BUILD_PATH/framework/assets/www/cordova-$VERSION.js ] && rm $BUILD_PATH/framework/assets/www/cordova-$VERSION.js
|
||||
[ -f $BUILD_PATH/framework/cordova-$VERSION.jar ] && rm $BUILD_PATH/framework/cordova-$VERSION.jar
|
||||
}
|
||||
|
@ -52,10 +52,10 @@ function exec(s, output) {
|
||||
|
||||
function cleanup() {
|
||||
// Cleanup
|
||||
if(fso.FileExists(ROOT + '\\framework\\libs\\commons-codec-1.6.jar')) {
|
||||
fso.DeleteFile(ROOT + '\\framework\\libs\\commons-codec-1.6.jar');
|
||||
fso.DeleteFolder(ROOT + '\\framework\\libs', true);
|
||||
}
|
||||
// if(fso.FileExists(ROOT + '\\framework\\libs\\commons-codec-1.6.jar')) {
|
||||
// fso.DeleteFile(ROOT + '\\framework\\libs\\commons-codec-1.6.jar');
|
||||
// fso.DeleteFolder(ROOT + '\\framework\\libs', true);
|
||||
// }
|
||||
if(fso.FileExists(ROOT + '\\framework\\cordova-'+VERSION+'.jar')) {
|
||||
fso.DeleteFile(ROOT + '\\framework\\cordova-'+VERSION+'.jar');
|
||||
}
|
||||
|
@ -18,9 +18,5 @@
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://git-wip-us.apache.org/repos/asf/incubator-cordova-android.git"
|
||||
},
|
||||
"dependencies":{
|
||||
"coffee-script":"1.1.2",
|
||||
"nodeunit":"0.5.3"
|
||||
}
|
||||
}
|
||||
|
44
bin/test
44
bin/test
@ -1,44 +0,0 @@
|
||||
#! /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.
|
||||
#
|
||||
#
|
||||
set -e
|
||||
|
||||
VERSION=$(cat ./VERSION)
|
||||
|
||||
# get the latest mobile-spec
|
||||
git clone git@github.com:callback/callback-test.git
|
||||
|
||||
# clobber test if it exists
|
||||
if [ -e ./test ]
|
||||
then
|
||||
rm -rf ./test
|
||||
fi
|
||||
|
||||
# generate a working proj
|
||||
./bin/create ./test org.apache.cordova.test CordovaTest
|
||||
|
||||
# kill the default app and replace it w/ mobile-spec
|
||||
rm -rf ./test/assets/www
|
||||
mv ./callback-test ./test/assets/www
|
||||
|
||||
# copy in cordova.js since www dir was replaced above
|
||||
cp ./framework/assets/www/cordova-$VERSION.js ./test/assets/www/cordova-$VERSION.js
|
||||
|
||||
# build it, launch it and start logging on stdout
|
||||
cd ./test && ./cordova/debug && ./cordova/log
|
@ -1,24 +0,0 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
|
||||
exports['you are sane'] = (test) ->
|
||||
test.expect 1
|
||||
test.ok true, "this assertion should always pass"
|
||||
test.done()
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
||||
|
||||
util = require 'util'
|
||||
exec = require('child_process').exec
|
||||
path = require 'path'
|
||||
|
||||
exports['default example project is generated'] = (test) ->
|
||||
test.expect 1
|
||||
exec './bin/create', (error, stdout, stderr) ->
|
||||
test.ok true, "this assertion should pass" unless error?
|
||||
test.done()
|
||||
|
||||
exports['default example project has a ./.cordova folder'] = (test) ->
|
||||
test.expect 1
|
||||
path.exists './example/.cordova', (exists) ->
|
||||
test.ok exists, 'the cordova folder exists'
|
||||
test.done()
|
||||
|
||||
exports['default example project has a /cordova folder'] = (test) ->
|
||||
test.expect 1
|
||||
path.exists './example/cordova', (exists) ->
|
||||
test.ok exists, 'the other cordova folder exists'
|
||||
test.done()
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
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.
|
||||
*/
|
@ -1,4 +1,5 @@
|
||||
var project_path = '/tmp/example',
|
||||
var build_path = __dirname + '/../..',
|
||||
project_path = '/tmp/example',
|
||||
package_name = 'org.apache.cordova.example',
|
||||
package_as_path = 'org/apache/cordova/example',
|
||||
project_name = 'cordovaExample';
|
||||
@ -9,16 +10,25 @@ var path = require('path'),
|
||||
assert = require('assert'),
|
||||
spawn = require('child_process').spawn;
|
||||
|
||||
var version = fs.readFileSync(__dirname + '/../VERSION').toString().replace('\n', '');
|
||||
var version = fs.readFileSync(build_path + '/VERSION').toString().replace('\n', '');
|
||||
|
||||
assert(version !== undefined);
|
||||
assert(version !== '');
|
||||
|
||||
var create_project = spawn(__dirname + '/create',
|
||||
var create_project = spawn(build_path + '/bin/create',
|
||||
[project_path,
|
||||
package_name,
|
||||
project_name]);
|
||||
|
||||
process.on('uncaughtException', function (err) {
|
||||
console.log('Caught exception: ' + err);
|
||||
spawn('rm', ['-rf', project_path], function(code) {
|
||||
if(code != 0) {
|
||||
console.log("Could not delete project directory");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
create_project.on('exit', function(code) {
|
||||
|
||||
assert.equal(code, 0, 'Project did not get created');
|
||||
@ -29,13 +39,13 @@ create_project.on('exit', function(code) {
|
||||
});
|
||||
|
||||
// make sure the build directory was cleaned up
|
||||
path.exists(__dirname + '/framework/libs', function(exists) {
|
||||
assert(!exists, 'libs directory did not get cleaned up');
|
||||
});
|
||||
path.exists(__dirname + util.format('/framework/assets/cordova-%s.js', version), function(exists) {
|
||||
// path.exists(build_path + '/framework/libs', function(exists) {
|
||||
// assert(!exists, 'libs directory did not get cleaned up');
|
||||
// });
|
||||
path.exists(build_path + util.format('/framework/assets/cordova-%s.js', version), function(exists) {
|
||||
assert(!exists, 'javascript file did not get cleaned up');
|
||||
});
|
||||
path.exists(__dirname + util.format('/framework/cordova-%s.jar', version), function(exists) {
|
||||
path.exists(build_path + util.format('/framework/cordova-%s.jar', version), function(exists) {
|
||||
assert(!exists, 'jar file did not get cleaned up');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user