cronapp-cordova-plugin-barcodescanner 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,16 @@
1
+ # This file is for unifying the coding style of different editors and IDEs.
2
+ # editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ end_of_line = lf
9
+ indent_size = 4
10
+ indent_style = space
11
+ insert_final_newline = true
12
+ trim_trailing_whitespace = true
13
+
14
+ [*.json]
15
+ indent_size = 2
16
+
package/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright 2010 Matt Kane
2
+ Copyright 2011 IBM Corporation
3
+ Copyright 2012-2017 Adobe Systems
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+
2
+
3
+
4
+ # Cronapp Cordova Plugin BarcodeScanner
5
+
6
+
7
+
8
+ ================================
9
+
10
+
11
+
12
+ Cross-platform BarcodeScanner for Cordova / PhoneGap.
13
+
14
+
15
+
16
+
17
+ Follows the [Cordova Plugin spec](https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html), so that it works with [Plugman](https://github.com/apache/cordova-plugman).
18
+
19
+
20
+
21
+ This plugin is a fork from https://github.com/phonegap/phonegap-plugin-barcodescanner
22
+
23
+
24
+
25
+ This plugin has minor changes for building on enviroment with Gradle 7.4+
26
+
27
+
28
+
29
+ ## Requirements
30
+
31
+ - `cordova-android@^11.0.0`
32
+
33
+ ## Licence ##
34
+
35
+ The MIT License
36
+
37
+ Copyright (c) 2010 Matt Kane
38
+
39
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal
40
+ in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in
43
+ all copies or substantial portions of the Software.
44
+
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52
+ THE SOFTWARE.
@@ -0,0 +1,52 @@
1
+ module.exports = function(ctx) {
2
+ if (ctx.opts && ctx.opts.platforms && ctx.opts.platforms.indexOf('windows') > -1
3
+ && ctx.opts.options) {
4
+ var path = require('path');
5
+ var shell = require('shelljs');
6
+ var nopt = require('nopt');
7
+
8
+ // parse and validate args
9
+ var args = nopt({
10
+ 'archs': [String],
11
+ 'appx': String,
12
+ 'phone': Boolean,
13
+ 'win': Boolean,
14
+ 'bundle': Boolean,
15
+ 'packageCertificateKeyFile': String,
16
+ 'packageThumbprint': String,
17
+ 'publisherId': String,
18
+ 'buildConfig': String
19
+ }, {}, ctx.opts.options.argv, 0);
20
+
21
+ // Check if --appx flag is passed so that we have a project build version override:
22
+ var isWin10 = args.appx && args.appx.toLowerCase() === 'uap';
23
+
24
+ // Else check "windows-target-version" preference:
25
+ if (!isWin10) {
26
+ var configXml = shell.ls(path.join(ctx.opts.projectRoot, 'config.xml'))[0];
27
+
28
+ var reTargetVersion = /<preference\s+name="windows-target-version"\s+value="(.+)"\s*\/>/i;
29
+ var targetVersion = shell.grep(reTargetVersion, configXml);
30
+
31
+ var result = reTargetVersion.exec(targetVersion);
32
+ if (result !== null) {
33
+ var match = result[1];
34
+ isWin10 = parseInt(match.split('.'), 10) > 8;
35
+ }
36
+ }
37
+
38
+ // Non-AnyCPU arch is required for Windows 10 (UWP) projects only:
39
+ if (isWin10) {
40
+ var rawArchs = ctx.opts.options.archs || args.archs;
41
+ var archs = rawArchs ? rawArchs.split(' ') : [];
42
+
43
+ // Avoid "anycpu" arch:
44
+ if (archs.length === 0 || archs.some(function (item) {
45
+ return item.toLowerCase() === 'anycpu';
46
+ })) {
47
+ throw new Error('You must specify an architecture to include the proper ZXing library version.'
48
+ + '\nUse \'cordova run windows -- --arch="x64"\' or \'cordova run windows -- --arch="arm" --phone --device\' for example.');
49
+ }
50
+ }
51
+ }
52
+ }