All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.danilopianini.gradle.latex.LatexDSL.kt Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package org.danilopianini.gradle.latex

import org.gradle.api.Project
import org.gradle.internal.file.DefaultFileMetadata.file
import java.io.File

data class LatexArtifactBuilder(private val project: Project, val name: String) {
    var bib: String? = with(project) {
        file(fromName("bib"))
            .takeIf { it.exists() }
            ?.absolutePath
    }
    var dependsOn: Iterable = emptyList()
    var images: Iterable = emptyList()
    var extraArguments: Iterable = listOf("-shell-escape", "-synctex=1", "-interaction=nonstopmode", "-halt-on-error")
    var quiet: Boolean? = null
    private fun fromName(extension: String) = when {
        name.endsWith(".tex") -> name.substring(0, endIndex = name.length - 4) + ".$extension"
        else -> "$name.$extension"
    }
    fun fileFromName(extension: String) = project.file(fromName(extension))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy