JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.45k stars 1.12k forks source link

Would you consider automatically including a license listing for the default third party dependencies? #532

Open brancoliticus opened 3 years ago

brancoliticus commented 3 years ago

One of the problems of actually distributing jetpack compose desktop software is making sure that you are abiding by the licensing terms of third party dependencies. There is churn in the dependencies as the project receives updates and each update might bring new libraries among the default third party dependencies, so everyone actually needing to distribute a final piece of software made with jetpack compose desktop has to keep up.

Please consider making some sort of automation that would make available in each final executable bundle a listing of the default third party runtime dependencies. That would certainly help this project's adoption rate.

Kind regards.

kirill-grouchnikov commented 3 years ago

Not sure why this should fall under this project. Is https://github.com/mojohaus/license-maven-plugin or other similar libraries that already provide this functionality not working for you?

olonho commented 3 years ago

Indeed, looks like something that could be fully handled by existing Gradle plugins.

brancoliticus commented 3 years ago

I am just going to use flutter instead because they care about developer time when confronted with software license issues, see: https://flutter.dev/docs/resources/faq#which-software-licenses-apply-to-flutter-and-its-dependencies. A decision I have not taken lightly considering that I have been messing around with code samples for jetpack compose for some time. Wasted time.

olonho commented 3 years ago

That's unfortunate that you decided to not use Compose for Desktop. However, please note, that with this plugin https://github.com/jk1/Gradle-License-Report and following change in build.gradle.kts

--- a/examples/codeviewer/desktop/build.gradle.kts
+++ b/examples/codeviewer/desktop/build.gradle.kts
@@ -1,9 +1,12 @@
 +import com.github.jk1.license.render.*
+import com.github.jk1.license.filter.*

 plugins {
     kotlin("multiplatform") // kotlin("jvm") doesn't work well in IDEA/AndroidStudio (https://github.com/JetBrains/compose-jb/issues/22)
     id("org.jetbrains.compose")
+    id("com.github.jk1.dependency-license-report") version "1.16"
 }

 kotlin {
@@ -18,6 +21,12 @@ kotlin {
     }
 }

+licenseReport {
+    configurations = arrayOf("jvmRuntimeClasspath")
+    renderers = arrayOf<ReportRenderer>(InventoryMarkdownReportRenderer("report.md","Backend"))
+    filters = arrayOf<DependencyFilter>(LicenseBundleNormalizer())
+}
+
 compose.desktop {
     application {
         mainClass = "org.jetbrains.codeviewer.MainKt"

one could obtain rather verbose license report for all dependencies, as can be seen in attached file.

olonho commented 3 years ago

report.txt

brancoliticus commented 3 years ago

> report.txt

Even your basic simple example has issues: half the packages have missing license information.

> + configurations = arrayOf("jvmRuntimeClasspath")

How should I know to enter jvmRuntimeClasspath coming from zero knowledge of the jvm ecosystem? Also is jvmRuntimeClasspath going to give me all the default runtime dependencies? Don't even get me started on the gradle dependencies command I have been toying with for a while in Intellij IDEA Community: it reports 10 different trees of dependencies under different names, none of them jvmRuntimeClasspath, plus other options or how should I call them that have nothing in the tree of dependencies.

That is why I proposed above that you might want to consider doing this bit yourselves and making sure people that want to build end user applications with your framework don't need to understand the entire jvm ecosystem to start deploying an app to production while respecting the license requirements. This is where flutter has a clear advantage. They do provide the license information for the default runtime in a way that is easily accessible to programmers making end user applications.

AlexeyTsvetkov commented 3 years ago

We discussed the issue and decided to provide intergration with a third party plugin (like https://github.com/jk1/Gradle-License-Report).

okushnikov commented 5 days ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.