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

ru.astrainteractive.gradleplugin.property.mapping.DeveloperMapper.kt Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package ru.astrainteractive.gradleplugin.property.mapping

import org.gradle.api.GradleException
import ru.astrainteractive.gradleplugin.model.Developer

object DeveloperMapper {
    fun parseDeveloper(value: String): Developer {
        val items: List = value.split("|").map(String::trim)
        if (items.size != 3) {
            throw GradleException(
                "Developer profile should have 3 parts with | delimiter. " +
                    "For example: makeevrserg|Makeev Roman|[email protected]"
            )
        }
        return Developer(
            id = items[0],
            name = items[1],
            email = items[2]
        )
    }

    fun parseDevelopers(value: String): List {
        return value.split(",").map(::parseDeveloper)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy