Commit 6dcf5842 authored by Matthias Rütten's avatar Matthias Rütten

cleanup code

parent becdff73
# Contributing
We love pull requests from everyone.
[Fork](https://help.github.com/articles/fork-a-repo/), then [clone](https://help.github.com/articles/cloning-a-repository/) the repo:
```
git clone git@github.com:your-username/phonegap-plugin-barcodescanner.git
```
Set up a branch for your feature or bugfix with a link to the original repo:
```
git checkout -b my-awesome-new-feature
git push --set-upstream origin my-awesome-new-feature
git remote add upstream https://github.com/phonegap/phonegap-plugin-barcodescanner.git
```
Set up the project:
```
npm install
```
Make sure the tests pass before changing anything:
```
npm test
```
Make your change. Add tests for your change. Make the tests pass:
```
npm test
```
Commit changes:
```
git commit -m "Cool stuff"
```
Make sure your branch is up to date with the original repo:
```
git fetch upstream
git merge upstream/master
```
Review your changes and any possible conflicts and push to your fork:
```
git push origin
```
[Submit a pull request](https://help.github.com/articles/creating-a-pull-request/).
At this point you're waiting on us. We do our best to keep on top of all the pull requests. We may suggest some changes, improvements or alternatives.
Some things that will increase the chance that your pull request is accepted:
- Write tests.
- Write a [good commit message](http://chris.beams.io/posts/git-commit/).
- Make sure the PR merges cleanly with the latest master.
- Describe your feature/bugfix and why it's needed/important in the pull request description.
## Editor Config
The project uses [.editorconfig](http://editorconfig.org/) to define the coding
style of each file. We recommend that you install the Editor Config extension
for your preferred IDE. Consistency is key.
### Expected Behaviour
### Actual Behaviour
### Reproduce Scenario (including but not limited to)
#### Steps to Reproduce
#### Platform and Version (eg. Android 5.0 or iOS 9.2.1)
#### (Android) What device vendor (e.g. Samsung, HTC, Sony...)
#### Cordova CLI version and cordova platform version
cordova --version
cordova platforms
#### Plugin version
cordova plugin version | grep phonegap-plugin-barcodescanner
#### Sample Code that illustrates the problem
#### Logs taken while reproducing problem
language: objective-c
git:
depth: 2
node_js:
- "0.10"
install:
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- cd ..
- npm install -g cordova-paramedic
- npm install -g cordova
- npm install -g ios-sim
script:
- cordova-paramedic --platform ios --plugin ${TRAVIS_BUILD_DIR}
\ No newline at end of file
module.exports = function(ctx) {
if (ctx.opts && ctx.opts.platforms && ctx.opts.platforms.indexOf('windows') > -1
&& ctx.opts.options) {
var path = require('path');
var shell = ctx.requireCordovaModule('shelljs');
var nopt = ctx.requireCordovaModule('nopt');
// parse and validate args
var args = nopt({
'archs': [String],
'appx': String,
'phone': Boolean,
'win': Boolean,
'bundle': Boolean,
'packageCertificateKeyFile': String,
'packageThumbprint': String,
'publisherId': String,
'buildConfig': String
}, {}, ctx.opts.options.argv, 0);
// Check if --appx flag is passed so that we have a project build version override:
var isWin10 = args.appx && args.appx.toLowerCase() === 'uap';
// Else check "windows-target-version" preference:
if (!isWin10) {
var configXml = shell.ls(path.join(ctx.opts.projectRoot, 'config.xml'))[0];
var reTargetVersion = /<preference\s+name="windows-target-version"\s+value="(.+)"\s*\/>/i;
var targetVersion = shell.grep(reTargetVersion, configXml);
var result = reTargetVersion.exec(targetVersion);
if (result !== null) {
var match = result[1];
isWin10 = parseInt(match.split('.'), 10) > 8;
}
}
// Non-AnyCPU arch is required for Windows 10 (UWP) projects only:
if (isWin10) {
var rawArchs = ctx.opts.options.archs || args.archs;
var archs = rawArchs ? rawArchs.split(' ') : [];
// Avoid "anycpu" arch:
if (archs.length === 0 || archs.some(function (item) {
return item.toLowerCase() === 'anycpu';
})) {
throw new Error('You must specify an architecture to include the proper ZXing library version.'
+ '\nUse \'cordova run windows -- --arch="x64"\' or \'cordova run windows -- --arch="arm" --phone --device\' for example.');
}
}
}
}
{
"name": "phonegap-plugin-barcodescanner",
"version": "6.0.6",
"description": "You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera) and get the metadata encoded in them for processing within your application.",
"version": "7.0.0",
"description": "You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera).",
"cordova": {
"id": "phonegap-plugin-barcodescanner",
"platforms": [
"ios",
"android",
"windows",
"wp8",
"blackberry10",
"browser"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git"
"url": "https://gitlab.codecentric.de/open-source/phonegap-plugin-barcodescanner.git"
},
"keywords": [
"ecosystem:cordova",
"ecosystem:phonegap",
"cordova-ios",
"cordova-android",
"cordova-windows",
"cordova-wp8",
"cordova-blackberry10",
"cordova-browser",
"cordova:plugin"
],
......@@ -34,12 +28,12 @@
"version": ">=3.0.0"
}
],
"author": "Adobe PhoneGap Team",
"author": "Matthias Rütten",
"license": "MIT",
"bugs": {
"url": "https://github.com/phonegap/phonegap-plugin-barcodescanner/issues"
"url": "https://gitlab.codecentric.de/open-source/phonegap-plugin-barcodescanner/issues"
},
"homepage": "https://github.com/phonegap/phonegap-plugin-barcodescanner#readme",
"homepage": "https://gitlab.codecentric.de/open-source/phonegap-plugin-barcodescanner",
"scripts": {
"test": "jasmine-node --color spec"
},
......
......@@ -53,37 +53,6 @@
<resource-file src="src/android/barcodescanner-release.aar" target="libs/barcodescanner.aar"/>
<dependency id="cordova-plugin-compat" version="^1.0.0"/>
</platform>
<platform name="windows">
<js-module src="src/windows/BarcodeScannerProxy.js" name="BarcodeScannerProxy">
<merges target=""/>
</js-module>
<config-file target="package.appxmanifest" parent="/Package/Capabilities">
<DeviceCapability Name="webcam"/>
</config-file>
<framework src="src/windows/lib.UW/x86/ZXing.winmd" target-dir="x86" arch="x86" custom="true" versions=">8.1"/>
<framework src="src/windows/lib.UW/x64/ZXing.winmd" target-dir="x64" arch="x64" custom="true" versions=">8.1"/>
<framework src="src/windows/lib.UW/ARM/ZXing.winmd" target-dir="ARM" arch="ARM" custom="true" versions=">8.1"/>
<framework src="src/windows/lib/WinRTBarcodeReader.csproj" custom="true" type="projectReference" versions="&lt;=8.1"/>
<asset src="src/windows/assets/plugin-barcodeScanner.css" target="css/plugin-barcodeScanner.css"/>
<hook src="hooks/windows/check-arch.js" type="before_compile"/>
<hook src="hooks/windows/check-arch.js" type="before_run"/>
</platform>
<platform name="wp8">
<config-file target="config.xml" parent="/*">
<feature name="BarcodeScanner">
<param name="wp-package" value="BarcodeScanner"/>
</feature>
</config-file>
<config-file target="Properties/WMAppManifest.xml" parent="/Deployment/App/Capabilities">
<Capability Name="ID_CAP_ISV_CAMERA"/>
</config-file>
<framework src="src/wp8/lib/zxing.wp8.0.dll" custom="true"/>
<asset src="src/wp8/assets/cancel.png" target="Images/appbar.cancel.png"/>
<source-file src="src/wp8/BarcodeScanner.cs"/>
<source-file src="src/wp8/BarcodeScannerTask.cs"/>
<source-file src="src/wp8/BarcodeScannerUI.xaml"/>
<source-file src="src/wp8/BarcodeScannerUI.xaml.cs"/>
</platform>
<platform name="browser">
<config-file target="config.xml" parent="/*">
<feature name="BarcodeScanner">
......@@ -94,19 +63,4 @@
<runs/>
</js-module>
</platform>
<platform name="blackberry10">
<source-file src="src/blackberry10/index.js" target-dir="BarcodeScanner"/>
<source-file src="src/blackberry10/qrcode.js" target-dir="BarcodeScanner"/>
<lib-file src="src/blackberry10/native/device/libBarcodeScanner.so" arch="device"/>
<lib-file src="src/blackberry10/native/simulator/libBarcodeScanner.so" arch="simulator"/>
<config-file target="www/config.xml" parent="/widget">
<feature name="BarcodeScanner">
<param name="blackberry-package" value="phonegap-plugin-barcodescanner"/>
</feature>
</config-file>
<config-file target="www/config.xml" parent="/widget/rim:permissions">
<rim:permit>use_camera</rim:permit>
</config-file>
<dependency id="cordova-plugin-bb-app"/>
</platform>
</plugin>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment