mikepenz / AboutLibraries

AboutLibraries automatically collects all dependencies and licenses of any gradle project (Kotlin MultiPlatform), and provides easy to integrate UI components for Android and Compose-jb environments
http://mikepenz.github.io/AboutLibraries/
Apache License 2.0
3.66k stars 423 forks source link

Exclusionpatterns not working after updating from 8.9.4 to 10.4.0 #795

Closed Berki2021 closed 2 years ago

Berki2021 commented 2 years ago

About this issue

Build Gradle

    aboutLibraries {
        exclusionPatterns = [
                ~"androidx_.*",
                ~"org_jetbrains_.*",
                ~"com_google_firebase__.*",
                ~"com_google_android_gms__.*",
                ~"com_google_android_datatransport__.*",
                ~"com_google_guava__listenablefuture",
                ~"com_google_guava__failureaccess",
                ~"com_google_code_findbugs__jsr305",
                ~"com_android_installreferrer__.*",
                ~"com_squareup_okhttp__okhttp",
                ~"io_coil_kt__coil_svg",
                ~"javax_inject_.*"
        ]

        includePlatform = true
        duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.LINK

    }

Fragment

    private fun buildComposeList() {
        binding.rvOpenSource.setContent {
            LibrariesContainer(
                showAuthor = false,
            )
        }
    }

Details

Checklist

mikepenz commented 2 years ago

Looks this may be due to the change of the exclusion patterns being now on the real package identifier. And no more on the legacy format with . replaced by _ (which was necessary for the strings.xml file) - The id is now package name and artifactId: https://github.com/mikepenz/AboutLibraries/blob/f5f95a439920bbb39dea4f7b98c7dd41cea85336/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/util/LibrariesProcessor.kt#L149

See here: https://github.com/mikepenz/AboutLibraries/blob/af37f4bbf80872d36733199141120df46f41b055/plugin-build/plugin/src/main/kotlin/com/mikepenz/aboutlibraries/plugin/AboutLibrariesExtension.kt#L64-L75

Berki2021 commented 2 years ago

What about the dependencies with two "__" like ~"com_google_android_datatransport__.*"?

Would this be ~"com.google.android.datatransport...*"?

mikepenz commented 2 years ago

@Berki2021 this pattern is a regex. which means the . actually means any character. theoretically in this case we could escape it as we are actually asking for a literal ..

so at the end the .* means . - any character - * repeated one or more times.