Получил пустые отчеты о лицензиях с плагином Gradle License от Hierynomus - PullRequest
1 голос
/ 28 марта 2019

Я создаю два приложения для Android в проекте Gradle и управляю лицензиями на зависимости с помощью подключаемого модуля Gradle для лицензии Hierynomus .Затем я выполнил следующие команды:

$ ./gradlew downloadLicenses
$ cat ./build/reports/license/dependency-license.json

Но сгенерированные отчеты о лицензиях пусты.

{"dependencies":[]}

Я попытался устранить проблему с помощью следующих документов:

, но я не смог решить проблему.

Далее я попытался выполнить задачу с опциями --refresh-dependencies и --rerun-tasks.К сожалению, проблема не устранилась.

Это мои сценарии сборки:

// build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.kotlin_version = '1.3.21'
    ext.kotlin_coroutine_version = '1.1.1'
    repositories {
        google()
        jcenter()
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.2'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.12.1'
        classpath 'com.github.ben-manes:gradle-versions-plugin:0.21.0'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url "http://dl.bintray.com/jetbrains/spek" }
    }

    apply plugin: 'com.github.ben-manes.versions'
    apply plugin: 'com.github.hierynomus.license'

    downloadLicenses {
        includeProjectDependencies = true
        dependencyConfiguration = 'implementation'
        ext.apacheTwo = license('Apache License, Version 2.0', 'https://opensource.org/licenses/Apache-2.0')
        ext.bsd = license('BSD License', 'https://opensource.org/licenses/bsd-license')
        aliases = [
            (apacheTwo): [
                'The Apache Software License, Version 2.0',
                'Apache 2',
                'Apache License Version 2.0',
                'Apache License, Version 2.0',
                'Apache License 2.0',
                license('Apache License', 'https://www.apache.org/licenses/LICENSE-2.0')
            ],
            (bsd): [
                'BSD',
                license('New BSD License', 'https://opensource.org/licenses/bsd-license')
            ]
        ]
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
// app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "xyz.tech-frodo.testFirebaseApp.console"
        minSdkVersion 26
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    lintOptions {
        lintConfig file("lint.xml")
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-firestore:18.1.0'
    implementation 'com.github.kittinunf.fuel:fuel:1.12.0'
    implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.4'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutine_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlin_coroutine_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version"
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-annotations:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
apply plugin: 'com.google.gms.google-services'
// client/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 28

    defaultConfig {
        applicationId "xyz.tech-frodo.testFirebaseApp.client"
        minSdkVersion 27
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-firestore:18.1.0'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutine_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$kotlin_coroutine_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutine_version"
    implementation 'com.github.kittinunf.fuel:fuel:1.12.0'
    implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.9.4'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.maps:google-maps-services:0.9.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'org.jetbrains.spek:spek-api:1.1.5'
    testImplementation 'org.jetbrains.spek:spek-junit-platform-engine:1.1.5'
    testImplementation 'org.mockito:mockito-core:+'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.junit.platform:junit-platform-runner:1.1.0'
    testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
    testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

Нет сомнений, что я ожидал, что отчеты о лицензиях на зависимости моего проекта были сгенерированы в ${PROJECT_ROOT}/build/reports/license/.Я обнаружил, что отчеты генерируются, однако они были пустыми.

Спасибо!

...