/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * 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.
 */

/**
 * This file was created using the `create_project.py` script located in the
 * `<AndroidX root>/development/project-creator` directory.
 *
 * Please use that script when creating a new project, rather than copying an existing project and
 * modifying its settings.
 */

import androidx.build.BuildOnServerKt
import androidx.build.KotlinTarget
import androidx.build.LibraryType
import androidx.build.SdkHelperKt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

import java.util.regex.Matcher
import java.util.regex.Pattern

plugins {
    id("AndroidXPlugin")
    id("AndroidXRepackagePlugin")
    id("kotlin")
}

repackage {
    // Must match what is in room/room-external-antlr/build.gradle
    addRelocation {
        sourcePackage = "org.antlr"
        targetPackage = "androidx.room.jarjarred.org.antlr"
    }
    // Must match what is in room/room-external-antlr/build.gradle
    addRelocation {
        sourcePackage = "org.stringtemplate"
        targetPackage =  "androidx.room.jarjarred.org.stringtemplate"
    }
}

androidx.configureAarAsJarForConfiguration("testImplementation")

dependencies {
    implementation(project(":room:room-common"))
    implementation(project(":room:room-external-antlr"))
    implementation(project(":room:room-migration"))
    implementation(project(":room:room-compiler-processing"))
    implementation(libs.kotlinStdlib)
    implementation(libs.autoCommon)
    implementation(libs.autoValueAnnotations)
    implementation(libs.javapoet)
    implementation(libs.kotlinPoet)
    implementation(libs.kotlinPoetJavaPoet)
    implementation(libs.kspApi)
    // Must be compileOnly to not bring in antlr4 in runtime
    // Repackaged antlr4 brought in by
    // project(":room:room-external-antlr") and used at runtime
    compileOnly(libs.antlr4) {
        // antlr has dependencies on unrelated projects for its gui stuff, do not include them
        exclude group: "org.abego.treelayout"
        exclude group: "com.ibm.icu"
        exclude group: "org.glassfish"
    }
    implementation(libs.sqliteJdbc)
    implementation(libs.apacheCommonsCodec)
    implementation(libs.intellijAnnotations)
    testImplementation(libs.truth)
    testImplementation(project(":kruth:kruth"))
    testImplementation(libs.testParameterInjector)
    testImplementation(libs.autoValue) // to access the processor in tests
    testImplementation(libs.autoServiceAnnotations)
    testImplementation(libs.autoService) // to access the processor in tests
    testImplementation(project(":paging:paging-common"))
    testImplementation(project(":room:room-compiler-processing-testing"))
    testImplementation(libs.junit)
    testImplementation(libs.jsr250)
    testImplementation(libs.mockitoCore4)
    testImplementation(libs.antlr4)
    testImplementation(SdkHelperKt.getSdkDependency(project))
    testImplementationAarAsJar(project(":room:room-runtime"))
    testImplementationAarAsJar(project(":sqlite:sqlite"))
    testImplementation(project(":internal-testutils-common"))
}

def generateAntlrTask = tasks.register("generateAntlrGrammar", GenerateAntlrGrammar) { task ->
    def sourceFiles = [
            "SQLiteLexer.g4",
            "SQLiteParser.g4"
    ]
    task.getSourceFiles().set(sourceFiles.collect { layout.projectDirectory.file(it) })
    task.getAntlrClasspath().from(configurations.compileClasspath)
    task.getOutputDirectory().set(layout.buildDirectory.dir("generated/antlr/grammar-gen/"))
}

sourceSets {
    main.java.srcDirs += generateAntlrTask.map { it.outputDirectory }
}

@CacheableTask
abstract class GenerateAntlrGrammar extends DefaultTask {
    @PathSensitive(PathSensitivity.NONE)
    @InputFiles
    abstract ListProperty<RegularFile> getSourceFiles()

    @Classpath
    abstract ConfigurableFileCollection getAntlrClasspath()

    @OutputDirectory
    abstract DirectoryProperty getOutputDirectory()

    @Inject
    abstract ExecOperations getExecOperations()

    @Inject
    public GenerateAntlrGrammar() {
        description = "Generates ANTLR Grammar used by Room"
        group = "build"
    }

    @TaskAction
    void generateAntlrGrammar() {
        File outputDirectoryFile = getOutputDirectory().asFile.get()
        outputDirectoryFile.deleteDir()
        execOperations.javaexec {
            mainClass.set("org.antlr.v4.Tool")
            classpath = getAntlrClasspath()
            args(
                 *getSourceFiles().get().collect { it.getAsFile().absolutePath },
                 "-visitor",
                 "-o", new File(outputDirectoryFile, "androidx/room/parser").path,
                 "-package", "androidx.room.parser"
            )
        }
    }
}

/**
 * This task validates the published artifacts of room compiler to ensure dependencies are properly
 * specified.
 */
abstract class CheckArtifactTask extends DefaultTask {
    @InputFiles
    abstract ConfigurableFileCollection getArtifactInputs()
    @InputFile
    abstract RegularFileProperty getPomFile()
    @OutputFile
    abstract RegularFileProperty getResult()

    /**
     * Checks the generated pom file to ensure it does not depend on any jarjarred dependencies
     * but still depends on others.
     */
    void validatePomTaskOutputs() {
        File pom = getPomFile().asFile.get()
        if (!pom.canRead()) {
            throw new GradleException("Cannot find the pom file for room-compiler")
        }
        def pomContents = pom.newReader().text
        Pattern antlrDep = Pattern.compile("<dependency>\\s.*antlr(.*\\s)*</dependency>")
        Matcher matcher = antlrDep.matcher(pomContents)
        if (matcher.find()) {
            throw new GradleException("Room-compiler pom file should not depend on antlr.\n" +
                    "Pom Contents:\n $pomContents")
        }
        if(!pomContents.contains("<artifactId>kotlin-stdlib</artifactId>")) {
            throw new GradleException("room-compiler should depend on kotlin stdlib.\n" +
                    "Pom Contents:\n $pomContents")
        }
    }

    @TaskAction
    void validate() {
        getResult().asFile.get().write("fail\n")
        validatePomTaskOutputs()
        // have a no-op output to make gradle happy w/ input/output checking.
        getResult().asFile.get().write("ok\n")
    }
}

def checkArtifactContentsTask = tasks.register("checkArtifact", CheckArtifactTask) { task ->
    task.getResult().set(layout.buildDirectory.file("checkArtifactOutput.txt"))
    def pomTask = (TaskProvider<GenerateMavenPom>) project.tasks.named("generatePomFileForMavenPublication")
    task.getPomFile().set(
            project.objects.fileProperty().fileProvider(
                    pomTask.map {  it.destination }
            )
    )
}

afterEvaluate {
    def publishTaskProvider = project.tasks.named("publishMavenPublicationToMavenRepository")
    checkArtifactContentsTask.configure { checkArtifactTask ->
        checkArtifactTask.getArtifactInputs().from {
            publishTaskProvider.map {
                ((PublishToMavenRepository) it).getPublication().artifacts.matching {
                    it.classifier == null
                }.collect {
                    it.file
                }
            }
        }
    }
}

// make sure we validate published artifacts on the build server.
BuildOnServerKt.addToBuildOnServer(project, checkArtifactContentsTask)

tasks.withType(KotlinCompile).configureEach {
    kotlinOptions {
        freeCompilerArgs += [
                "-opt-in=kotlin.contracts.ExperimentalContracts",
                "-opt-in=androidx.room.compiler.processing.ExperimentalProcessingApi",
                "-opt-in=com.squareup.kotlinpoet.javapoet.KotlinPoetJavaPoetPreview"
        ]
    }
}

tasks.withType(Test).configureEach {
    it.systemProperty("androidx.room.compiler.processing.strict", "true")
    it.maxParallelForks = 8
    if (project.providers.environmentVariable("GITHUB_ACTIONS").present) {
        // limit memory usage to avoid running out of memory in the docker container.
        it.maxHeapSize = "512m"
    }
}

androidx {
    name = "Room Compiler"
    type = LibraryType.ANNOTATION_PROCESSOR
    inceptionYear = "2017"
    description = "Android Room annotation processor"
    kotlinTarget = KotlinTarget.KOTLIN_2_0
}
