<?xml version="1.0" encoding="UTF-8"?>
<plugin
        xmlns="http://apache.org/cordova/ns/plugins/1.0"
        xmlns:android="http://schemas.android.com/apk/res/android"
        id="io-anyline-cordova-mx-scanner"
        version="20.0.0">

    <name>AnylineSDK</name>

    <!--Add Platform specific Files-->
    <platform name="ios">
	
		<js-module src="www/anyline.js" name="anyline">
			<clobbers target="window.Anyline" />
		</js-module>
	
        <plugins-plist key="AnylineSDK" string="AnylineSDKPlugin"/>
        <!-- feature tag in config.xml -->
        <config-file parent="/widget" target="config.xml">
            <feature name="AnylineSDK">
                <param name="ios-package" value="AnylineSDKPlugin"/>
            </feature>
        </config-file>
        <config-file target="*-Info.plist" parent="NSCameraUsageDescription">
            <string>Allow Anyline to access your camera?</string>
        </config-file>
        <config-file target="*-Info.plist" parent="NSPhotoLibraryAddUsageDescription">
            <string>Allow Anyline to access add PhotoLibrary?</string>
        </config-file>
        
        <config-file target="*-Info.plist" parent="UISupportedExternalAccessoryProtocols">
        <array>
            <string>com.cognex.dmcc</string>
            <string>com.demo.data</string>
        </array>
        </config-file>
        

        <!-- Anyline SDK Cordova Plugin Source for iOS -->
        <header-file src="src/ios/AnylineSDKPlugin.h"/>
        <source-file src="src/ios/AnylineSDKPlugin.m"/>
        <header-file src="src/ios/ALPluginHelper.h"/>
        <source-file src="src/ios/ALPluginHelper.m"/>
        <header-file src="src/ios/ALPluginScanViewController.h"/>
        <source-file src="src/ios/ALPluginScanViewController.m"/>
        <header-file src="src/ios/ALRoundedView.h"/>
        <source-file src="src/ios/ALRoundedView.m"/>
        <header-file src="src/ios/ALCordovaUIConfiguration.h"/>
        <source-file src="src/ios/ALCordovaUIConfiguration.m" />
                
        <header-file src="src/ios/MXScanner/ScannerController.h" />
        <source-file src="src/ios/MXScanner/ScannerController.mm" />
        
        <header-file src="src/ios/MXScanner/ALCognexMXConfiguration.h" />
        <source-file src="src/ios/MXScanner/ALCognexMXConfiguration.m" />

        <!-- Cognex Dataman Frameworks -->
        <framework src="src/ios/MXScanner/Frameworks/DataManFW.framework" embed="true" custom="true" />
        <source-file src="src/ios/MXScanner/Frameworks/libDataManSDK.a" target-dir="lib" framework="true" />
        
        <resource-file src="src/ios/MXScanner/Assets/BMW_det_class_6.any" />
        <resource-file src="src/ios/MXScanner/Assets/bmw.ale" />
        
        <resource-file src="src/ios/MXScanner/Frameworks/include" />
        <resource-file src="src/ios/MXScanner/MWBScannerImages.xcassets" />
        <resource-file src="src/ios/MXScanner/MXStoryBoard.storyboard"/>

        <!-- Anyline Framework & Resource Bundle locally -->
        <!-- <framework custom="true" src="src/ios/anyline_sdk/Anyline.framework"/>-->
        <!-- <resource-file src="src/ios/anyline_sdk/AnylineResources.bundle"/>-->

        <!-- Anyline Framework & Resource Bundle CocoaPods -->
        <framework src="Anyline" type="podspec" swift-version="4.2" spec="~> 20"/>
        <framework src="ZHPopupView" type="podspec" spec ="~> 0.1.1" />
        <framework src="CocoaAsyncSocket" type="podspec" spec ="~> 7.6.3" />
    
    
        <!-- <podspec>
            <config>
                <source url="https://github.com/Anyline/anyline-ocr-examples-ios.git" />
                <source url="https://github.com/CocoaPods/Specs.git"/>
            </config>
            <pods use-frameworks="true">
                <pod name="Anyline" type="podspec" spec="~> 17" />
                <pod name="ZHPopupView" type="podspec"/>
            </pods>
        </podspec> -->


        <!-- Frameworks needed by Anyline SDK for iOS -->
        <framework src="libz.tbd"/>
        <framework src="libc++.tbd"/>
        <framework src="AssetsLibrary.framework"/>
        <framework src="Accelerate.framework"/>
        
        <framework src="ExternalAccessory.framework"/>
        <framework src="WebKit.framework"/>
        <framework src="CoreLocation.framework"/>
        <framework src="CoreGraphics.framework"/>
        <framework src="AudioToolbox.framework"/>
        <framework src="SystemConfiguration.framework"/>
        <framework src="MediaPlayer.framework"/>
        <framework src="AVFoundation.framework"/>
        <framework src="CoreMedia.framework"/>
        <framework src="CoreVideo.framework"/>
        <framework src="Security.framework"/>
        <!-- framework src="Pods_MXSampleApp.framework"/ -->
        
        
    </platform>
    <platform name="android">
	
		<js-module src="www/anyline.js" name="anyline">
			<clobbers target="window.Anyline" />
		</js-module>
	
        <!-- register plugin -->
        <framework custom="true" src="src/android/anyline.gradle" type="gradleReference"/>

        <config-file parent="/*" target="config.xml">
            <feature name="AnylineSDK">
                <param name="android-package" value="io.anyline.cordova.AnylinePlugin"/>
                <param name="onload" value="true"/>
            </feature>
        </config-file>
        <!-- add permissions in AndroidManifest.xml file-->
        <config-file mode="merge" parent="/manifest" target="AndroidManifest.xml">
            <uses-permission android:name="android.permission.CAMERA"/>
            <uses-permission android:name="android.permission.VIBRATE"/>
        </config-file>
        <config-file mode="merge" parent="/manifest/application" target="AndroidManifest.xml">
            <meta-data
                    android:name="com.google.android.gms.vision.DEPENDENCIES"
                    android:value="barcode"/>
        </config-file>
        <config-file mode="merge" parent="/manifest/application" target="AndroidManifest.xml">
	    <activity android:name="io.anyline.cordova.Document4Activity"
                      android:theme="@android:style/Theme.Black.NoTitleBar" />
	    <activity android:name="io.anyline.cordova.Anyline4Activity"
                      android:theme="@android:style/Theme.Black.NoTitleBar" />
	    <activity android:name="io.anyline.cordova.CropViewUIActivity"
                      android:theme="@android:style/Theme.Black.NoTitleBar" />
	    <activity android:name="io.anyline.cordova.DocumentScanViewUIActivity"
                      android:theme="@android:style/Theme.Black.NoTitleBar" />
	    <activity android:name="io.anyline.cordova.DocScanUIMainActivity"
                      android:theme="@android:style/Theme.Black.NoTitleBar" />
        </config-file>

        <!-- add plugin source code -->
	    <source-file src="src/android/io/anyline/cordova/Anyline4Activity.java" target-dir="src/io/anyline/cordova"/>        
	    <source-file src="src/android/io/anyline/cordova/AnylineBaseActivity.java" target-dir="src/io/anyline/cordova"/>
        <source-file src="src/android/io/anyline/cordova/AnylinePlugin.java" target-dir="src/io/anyline/cordova"/>
	    <source-file src="src/android/io/anyline/cordova/AnylinePluginHelper.java" target-dir="src/io/anyline/cordova"/>
        <source-file src="src/android/io/anyline/cordova/Document4Activity.java" target-dir="src/io/anyline/cordova"/>
        <source-file src="src/android/io/anyline/cordova/CordovaUIConfig.java" target-dir="src/io/anyline/cordova"/>
        <source-file src="src/android/io/anyline/cordova/ResultReporter.java" target-dir="src/io/anyline/cordova"/>
        <source-file src="src/android/io/anyline/cordova/Resources.java" target-dir="src/io/anyline/cordova"/>


        <resource-file src="src/android/res/values/anyline_sdk_plugin_strings.xml"
                       target="res/values/anyline_sdk_plugin_strings.xml"/>
        <resource-file src="src/android/res/values/anyline_sdk_plugin_colors.xml"
                       target="res/values/anyline_sdk_plugin_colors.xml"/>
        <resource-file src="src/android/res/values-de/anyline_sdk_plugin_strings.xml"
                       target="res/values-de/anyline_sdk_plugin_strings.xml"/>
        <resource-file src="src/android/res/layout/activity_scan_document.xml"
                       target="res/layout/activity_scan_document.xml"/>
        <resource-file src="src/android/res/layout/activity_scan_scanview.xml"
                       target="res/layout/activity_scan_scanview.xml"/>

    </platform>


     <!-- windows -->
    <platform name="windows">
        <framework src="src/windows/lib/x86/Anyline.JS.winmd" target-dir="x86" arch="x86" custom="true" versions=">=10.0"/>
        <framework src="src/windows/lib/x86/Anyline.winmd" implementation="src/windows/lib/x86/Anyline.dll" target-dir="x86" arch="x86" custom="true" versions=">=10.0"/>
        <framework src="src/windows/lib/x86/Anyline.SDK.dll" target-dir="x86" arch="x86" />
		
		<framework src="src/windows/lib/arm/Anyline.JS.winmd" target-dir="arm" arch="arm" custom="true" versions=">=10.0"/>
        <framework src="src/windows/lib/arm/Anyline.winmd" implementation="src/windows/lib/arm/Anyline.dll" target-dir="arm" arch="arm" custom="true" versions=">=10.0"/>
        <framework src="src/windows/lib/arm/Anyline.SDK.dll" target-dir="arm" arch="arm" />
		
		<config-file target="package.appxmanifest" parent="/Package/Capabilities">
            <DeviceCapability Name="webcam"/>
        </config-file>
        <js-module src="src/windows/AnylineProxy.js" name="AnylineProxy" >
            <runs />
        </js-module>
        <js-module src="src/windows/scanview.js" name="ScanView">
            <clobbers target="anyline.sdk" />
        </js-module>
        <asset src="src/windows/assets" target="plugins/io-anyline-cordova/src/windows/assets" />
        <asset src="src/windows/css" target="css" />
        <asset src="src/windows/js" target="js" />
		<asset src="src/windows/img" target="img" />
    </platform>

</plugin>
