/*
 *  Copyright (C) 2017-present Albie Liang. All rights reserved.
 *
 *  Licensed 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.
 *
 */

apply plugin: 'com.android.application'

apply plugin: 'ipc-invoker-ag-extension'
apply plugin: 'arbitrarygen'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.3"
    defaultConfig {
        applicationId "cc.suitalk.ipcinvoker.sample"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    sourceSets {
        main {
            java {
                srcDirs = ['src/main/java/', 'build/generated/source/ag-gen']
            }
        }
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    api 'com.android.support:appcompat-v7:28.0.0'
    testImplementation 'junit:junit:4.12'
//    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
//    compile 'io.reactivex.rxjava2:rxjava:2.1.0'

//    compile libsDependencies.ipcinvoker
    api project(":ipc-invoker")
    api libsDependencies.ipcinvokerExtension
}

arbitraryGen {
    templateDir "${project.rootDir.getAbsolutePath()}/ag-template"
    srcDir "${project.projectDir.absolutePath}/ag-datasrc"
    destDir "$buildDir/generated/source/ag-gen"

    logger {
        debug true
        toFile true
        printTag true
        path "$buildDir/outputs/logs/ag.log"
    }

    javaCodeEngine {
        enable true
        rule "${project.projectDir.absolutePath}/src/main/java/cc/suitalk/ipcinvoker/sample/extension/*.java"
//        ruleFile "${project.projectDir.absolutePath}/ag-datasrc/parse-project.rule"
    }
}