mikepenz/AboutLibraries

Can't move plugin to another file.

Kolyall opened this issue · 4 comments

I moved plugin and settings for it to another gradle file. Now plugin sync error occurs.

MyProject/app/build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: rootProject.file('gradle-tasks/licenseReport.gradle')

android{
...
}

MyProject/gradle-tasks/licenseReport.gradle

apply plugin: 'com.mikepenz.aboutlibraries.plugin'



aboutLibraries {
// - If the automatic registered android tasks are disabled, a similar thing can be achieved manually
    // - `./gradlew app:exportLibraryDefinitions -PaboutLibraries.exportPath=src/main/res/raw`
    // - the resulting file can for example be added as part of the SCM
    registerAndroidTasks = false
    // Define the output file name. Modifying this will disable the automatic meta data discovery for supported platforms.
    outputFileName = "aboutlibraries.json"
    // Define the path configuration files are located in. E.g. additional libraries, licenses to add to the target .json
    configPath = "licenses"
    // Allow to enable "offline mode", will disable any network check of the plugin (including [fetchRemoteLicense] or pulling spdx license texts)
    offlineMode = false
    // Enable fetching of "remote" licenses.  Uses the API of supported source hosts
    // See https://github.com/mikepenz/AboutLibraries#special-repository-support
    fetchRemoteLicense = true
    // Enables fetching of "remote" funding information. Uses the API of supported source hosts
    // See https://github.com/mikepenz/AboutLibraries#special-repository-support
    fetchRemoteFunding = true
   // Enable the duplication mode, allows to merge, or link dependencies which relate
    duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.LINK
}

Sync Error:

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred evaluating script.
> Could not get unknown property 'com' for extension 'aboutLibraries' of type com.mikepenz.aboutlibraries.plugin.AboutLibrariesExtension.

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

BUT if I remove line:
duplicationMode = com.mikepenz.aboutlibraries.plugin.DuplicateMode.LINK
Then all works fine

Thank you for the report @Kolyall

Marked this ticket as help wanted as I am not certain what the problem may be in this case. I had similar with other plugins in the past, so I suppose this may be some special gradle behaviour I am not aware off.