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

com.netflix.nebula.lint.rule.dependency.JarContents.groovy Maven / Gradle / Ivy

Go to download

Pluggable and configurable linter tool for identifying and reporting on patterns of misuse or deprecations in Gradle scripts

There is a newer version: 20.2.2
Show newest version
package com.netflix.nebula.lint.rule.dependency

import groovy.transform.CompileDynamic

class JarContents {
    Set entryNames

    /**
     * Fully qualified class names with '/' package separators
     */
    @Lazy Set classes = entryNames
            // classes like org/hornetq/utils/HornetQUtilLogger_$logger are generated by references to interface fields, skip these
            .findAll { it.endsWith('.class') && !(it =~ /_\$\w+\.class$/)  }
            .collect { it.replaceAll(/\.class$/, '') }
            .toSet()

    @Lazy boolean isServiceProvider = entryNames.any { it == 'META-INF/services/' }
    @Lazy boolean nothingButMetaInf = !entryNames.any { !it.startsWith('META-INF') }
    @Lazy boolean isWebjar = entryNames.any { it == 'META-INF/resources/webjars/' }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy