// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

subprojects {
    group 'cn.m4399.sdk'
}

task adtArchive(type: Copy) {
    group '4399Single'
    dependsOn ':single:adtArchive', ':demo:adtArchive'

    delete "${buildDir}/adt"
    from("single/build/intermediates/adt") {
        include '*/**'
        into 'm4399Single'
    }
    from("demo/build/intermediates/adt") {
        include '*/**'
        into 'm4399SingleDemo'
    }
    rootProject.childProjects.single.with {
        from "demo/build/outputs/apk/landscape/release/single.demo-sdk-${POM_VERSION}+${POM_BUILD_ID}-landscape-release.apk"
        from "demo/build/outputs/apk/portrait/release/single.demo-sdk-${POM_VERSION}+${POM_BUILD_ID}-portrait-release.apk"
    }

    into "${buildDir}/adt"
}

