apply from: '../config/gradle/static_analysis_java.gradle'

// java plugin that knows about `api` and `implementation dependencies. See
// https://docs.gradle.org/current/userguide/java_library_plugin.html for more.
apply plugin: 'java-library'

repositories {
    maven {
        url "http://dl.bintray.com/android/android-tools"
    }
}

jar {
    manifest {
        attributes("Lint-Registry": "com.example.lint.registry.LintRegistry")
    }
}

configurations {
    lintChecks
}

/**
 * A small task to copy the generated jar to a location that is searched by the lint tool so that our custom rules can be used.
 */
task install(type: Copy) {
    from(configurations.lintChecks) {
        rename { 'lint.jar' }
    }
    into System.getProperty('user.home') + '/.android/lint/'
}

dependencies {
    // MODULE DEPENDENCIES *****************************************************************************************************************
    // Import the common module into this module
    implementation project(':common')
    lintChecks files(jar)

    // MAIN DEPENDENCIES *******************************************************************************************************************
    implementation projectDependencies.customLintRules
    implementation projectDependencies.existingLintRules

    // TEST DEPENDENCIES *******************************************************************************************************************
    testImplementation projectDependencies.jUnit
    testImplementation projectDependencies.assertJJava8
    testImplementation projectDependencies.lintTestHelpers
}
