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

io.github.pixee.maven.operator.VersionByProperty.kt Maven / Gradle / Ivy

package io.github.pixee.maven.operator

import java.util.*

class VersionByProperty : AbstractVersionCommand() {
    override fun execute(pm: ProjectModel): Boolean {
        val definedProperties: MutableSet =
            TreeSet(VERSION_KIND_COMPARATOR)

        pm.propertiesDefinedByFile.entries.filter { PROPERTY_TO_KIND.containsKey(it.key) }
            .forEach { entry ->
                val kind = PROPERTY_TO_KIND[entry.key]!!

                definedProperties.add(VersionDefinition(kind, entry.value.first().first))
            }

        this.result.addAll(definedProperties)

        return definedProperties.isNotEmpty()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy