<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
    xmlns:android="http://schemas.android.com/apk/res/android"
    id="cordova-sqlite-storage"
    version="1.4.3">

    <name>Cordova sqlite storage plugin</name>

    <license>MIT</license>

    <keywords>sqlite</keywords>

    <description>Native interface to SQLite for PhoneGap/Cordova. Allows you to use more storage and provides more flexibility than the standard Web SQL database (window.openDatabase).</description>
    <author>Litehelpers/Various</author>

    <!-- No longer enforced in this version (branch):
    <engines>
        <engine name="cordova" version=">=6.0.0" />
        <engine name="cordova-android" version=">=5.0.0" />
        <engine name="cordova-ios" version=">=4.0.0" />
        <engine name="cordova-windows" version=">=4.0.0" />
    </engines>
     -->

    <!-- THANKS to AllJoyn-Cordova / cordova-plugin-alljoyn: -->
    <hook type="before_plugin_install" src="scripts/beforePluginInstall.js" />

    <js-module src="www/SQLitePlugin.js" name="SQLitePlugin">
        <clobbers target="SQLitePlugin" />
    </js-module>

    <!-- android -->
    <platform name="android">
        <!-- Cordova >= 3.0.0 -->
        <config-file target="res/xml/config.xml" parent="/*">
            <feature name="SQLitePlugin">
                <param name="android-package" value="io.sqlc.SQLitePlugin"/>
            </feature>
        </config-file>

        <source-file src="src/android/io/sqlc/SQLitePlugin.java" target-dir="src/io/sqlc"/>
        <source-file src="src/android/io/sqlc/SQLiteAndroidDatabase.java" target-dir="src/io/sqlc"/>
        <source-file src="src/android/io/sqlc/SQLiteConnectorDatabase.java" target-dir="src/io/sqlc"/>

        <!-- Android-sqlite-connector [jar]: -->
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/sqlite-connector.jar" target-dir="libs"/>
        <!-- Android-sqlite-connector native driver [native libs]: -->
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/arm64-v8a/libsqlc-native-driver.so" target-dir="libs/arm64-v8a"/>
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/armeabi/libsqlc-native-driver.so" target-dir="libs/armeabi"/>
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/armeabi-v7a/libsqlc-native-driver.so" target-dir="libs/armeabi-v7a"/>
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/x86/libsqlc-native-driver.so" target-dir="libs/x86"/>
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/libs/x86_64/libsqlc-native-driver.so" target-dir="libs/x86_64"/>

    </platform>

    <!-- ios -->
    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="SQLitePlugin">
                <param name="ios-package" value="SQLitePlugin" />
            </feature>
        </config-file>

        <!-- Note: the ios src is based off src/ios implicitly -->
        <header-file src="src/ios/SQLitePlugin.h" />
        <source-file src="src/ios/SQLitePlugin.m" />

        <header-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.h" />
        <source-file src="node_modules/cordova-sqlite-storage-dependencies/sqlite3.c"
                     compiler-flags="-DSQLITE_TEMP_STORE=2 -DSQLITE_THREADSAFE=2 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_RTREE -DSQLITE_LOCKING_STYLE=1 -DSQLITE_OMIT_BUILTIN_TEST -DSQLITE_OMIT_LOAD_EXTENSION" />

    </platform>

    <!-- windows -->
    <platform name="windows">
        <js-module src="src/windows/sqlite-proxy.js" name="SQLiteProxy">
            <merges target="" />
        </js-module>

        <!-- SQLite3 JS module from SQLite3-WinRT/SQLite3JS: -->
        <js-module src="src/windows/SQLite3-Win-RT/SQLite3JS/js/SQLite3.js" name="SQLite3">
            <merges target="" />
        </js-module>

        <!-- Thanks to AllJoyn-Cordova / cordova-plugin-alljoyn for guidance: -->
        <framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.UWP/SQLite3.UWP.vcxproj" custom="true" type="projectReference" versions="10.*" />
        <framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.Windows/SQLite3.Windows.vcxproj" custom="true" type="projectReference" target="windows" versions="8.1" />
        <framework src="src/windows/SQLite3-Win-RT/SQLite3/SQLite3.WindowsPhone/SQLite3.WindowsPhone.vcxproj" custom="true" type="projectReference" target="phone" versions="8.1" />

    </platform>

</plugin>

<!-- vim: set expandtab : -->
