plugins {
    id 'org.jetbrains.kotlin.jvm'
    id "com.vanniktech.maven.publish"
}

group 'jmp0.appdbg'
version '1.0-SNAPSHOT'

//copy libs to resource
copy {
    from(rootDir.canonicalPath+File.separator+'libs'+File.separator+android_lib_name)
    into(rootDir.canonicalPath+File.separator+'core'+File.separator+'src'+File.separator+'main'+File.separator+'resources')
    rename {fileName->
        fileName.replace(".jar","")
    }
}
plugins.withId("com.vanniktech.maven.publish") {
    mavenPublish {
    }
}

jar.enabled(true)
repositories {
    mavenCentral()
}

test{
    if (file("agent/$agent_jar_name").exists() && file("agent/$bootstrap_jar_name").exists()){
        jvmArgs("-Xverify:none","-javaagent:agent/$agent_jar_name")
    }
    else System.err.println("core/agent/$agent_jar_name or core/agent/$bootstrap_jar_name not exists, please run task [agentJar] in agent/build.gradle file first.")
    useJUnitPlatform()
}
dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib"
    implementation project(":thirdparty:dex-reader")
    implementation project(":thirdparty:dex-translator")
    implementation project(":thirdparty:fernflower")
    api project(':thirdparty:arsc-decoder')
    implementation project(":patch-jvm")
    implementation 'org.dom4j:dom4j:2.1.3'
    implementation "log4j:log4j:$log4j_version"
    testImplementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.24.3'
    api "org.javassist:javassist:$javassist_version"
    implementation 'io.github.classgraph:classgraph:4.8.150'
    api 'com.github.zhkl0228:unidbg-api:0.9.8'
    implementation 'com.github.zhkl0228:unicorn:1.0.14'
    api 'com.github.zhkl0228:unidbg-android:0.9.8'
    implementation 'net.lingala.zip4j:zip4j:2.10.0'
    implementation 'io.github.qsy7.java.dependencies:slf4j-simple:0.1.0'
    implementation 'org.ow2.asm:asm-debug-all:5.0.3'
    implementation 'net.dongliu:apk-parser:2.6.10'
    compileOnly files('../libs/'+android_lib_name)

    testImplementation('org.junit.jupiter:junit-jupiter:5.9.2')
    testCompileOnly fileTree(dir:'../libs/tempLibs',includes:['*jar'])
    testCompileOnly files('../libs/'+android_lib_name)

}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
