首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >为什么Play Services OSS插件显示的是maven工件而不是友好的名称?

为什么Play Services OSS插件显示的是maven工件而不是友好的名称?
EN

Stack Overflow用户
提问于 2018-07-11 20:58:14
回答 1查看 773关注 0票数 3

我决定尝试一下Play Services OSS许可证插件,遇到了一些我不太理解的东西。

插件的连接似乎是正确的,因为我在查看OssLicensesMenuActivity时看到了。

我的应用程序

但看看安卓上的股票拨号应用程序,他们的OssLicensesMenuActivity就像这样。

谷歌手机应用程序

为什么我的应用程序显示maven工件名称,而google的应用程序却显示了开放源码库依赖项的格式良好的信息?

下面是gradle脚本的相关部分:

项目级别:

代码语言:javascript
运行
复制
buildscript {
    ext.kotlin_version = '1.2.51'
    ext.kotlin_coroutines_version = '0.22.4'
    ext.support_lib_version = '27.1.1'

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.2.0'
        classpath 'com.google.gms:oss-licenses:0.9.2'
        classpath 'io.fabric.tools:gradle:1.25.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

模块级别(删除一些特定于项目的详细信息):

代码语言:javascript
运行
复制
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.oss.licenses.plugin'

android {
    compileSdkVersion 27
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "4.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
}

dependencies {
    implementation project(':repository')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.android.gms:play-services-oss-licenses:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.1.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
    implementation "com.android.support:appcompat-v7:$support_lib_version"
    implementation "com.android.support:preference-v7:$support_lib_version"
    implementation "com.android.support:design:$support_lib_version"
    implementation "com.android.support:support-v4:$support_lib_version"
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlin_coroutines_version"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlin_coroutines_version"
    implementation 'com.google.dagger:dagger:2.11'
    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
    kapt 'com.google.dagger:dagger-compiler:2.11'
    implementation 'androidx.core:core-ktx:0.3'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation('com.jsibbold:zoomage:1.1.0') {
        exclude group: "com.android.support", module: "appcompat-v7"
    }
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    kapt 'com.github.bumptech.glide:compiler:4.7.1'
    implementation 'com.jakewharton.timber:timber:4.7.0'
    implementation 'com.amplitude:android-sdk:2.14.1'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'

任何洞察力都是值得欣赏的!

EN

回答 1

Stack Overflow用户

发布于 2018-07-12 14:48:04

play-services-oss-licenses库的许可证显示功能(您的应用程序使用)和内部使用的Dialer应用程序(我认为您的第二个屏幕截图所指的)是微妙不同的。用于显示许可证的插件+ play-services-oss-licenses方法还考虑到应用程序的直接依赖关系(例如org.jetbrains.kotlinx.*),以及Google服务库组件(例如com.google.firebase:firebase-core:16.0.1)使用的任何OSS库。

对于应用程序与OSS库的直接依赖关系,我们选择显示完全限定的Maven工件ID,因为这样可以更清楚地说明所使用的库。

Dialer应用程序显示更友好的名称,因为Google使用的构建系统与外部构建系统的地址和名称不同。

另外,我们计划在不久的将来使oss许可插件开源,这样您就可以了解我们正在做的事情。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51294071

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档