3

I decided to try out the Play Services OSS License Plugin and have run into something I don't quite understand.

The plugin seems to be hooked up correctly because I see then when viewing the OssLicensesMenuActivity.

My App

But looking at the stock dialer app on android, their OssLicensesMenuActivity looks like this.

Google's Phone App

Why is my app showing maven artifact names where google's app is showing nicely formatted disclosures of open source library dependencies?

Here are the relevant bits of the gradle scripts:

Project Level:

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
    }
}

Module level (with some project-specific details removed):

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'

Any insight is appreciated!

Justin Brooks
  • 99
  • 2
  • 6

1 Answers1

1

The license display functionality for the play-services-oss-licenses library (used by your app) and the internally used one for the Dialer app (which I think your second screenshot is referring to) are subtlety different. The plugin + play-services-oss-licenses method for displaying licenses also takes into account your app's direct dependencies (e.g. org.jetbrains.kotlinx.*), as well as whatever OSS libraries are used by the Google Play services library components (e.g. com.google.firebase:firebase-core:16.0.1).

For your app's direct dependencies onto OSS libraries, we choose to display the fully qualified Maven artifact ID since this gives more clarity as to the library being used.

The Dialer app is displaying the more friendly names because the build system used by Google addresses the OSS library notices and names differently than external build systems would.

On a separate note, we plan to make the oss-license plugin open source in the near future so you can have a look yourself as to what we are doing.

zfromg
  • 170
  • 9
  • Sweet. Thanks! It might be cool to have the option of what to show. Perhaps use the artifact ID as the default, but let consumers opt-in to showing the nicer name. Maybe that is more difficult that I'm assuming. – Justin Brooks Jul 13 '18 at 02:28
  • Oh interesting. Thanks for the link. – Justin Brooks Aug 02 '18 at 05:35