Skip to content

Commit 4e9494b

Browse files
authored
Add third_party_licenses for libraries that vendor Dagger. (#1897)
Additionally, clean up unused code.
1 parent 2843bea commit 4e9494b

File tree

9 files changed

+222
-1347
lines changed

9 files changed

+222
-1347
lines changed

buildSrc/build.gradle

-8
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ repositories {
2929
}
3030
}
3131

32-
sourceSets {
33-
main {
34-
java {
35-
srcDir '../third_party/jsoup/src/main/java'
36-
}
37-
}
38-
}
39-
4032
dependencies {
4133
implementation 'org.jsoup:jsoup:1.11.2'
4234
implementation 'digital.wup:android-maven-publish:3.6.2'

buildSrc/src/main/java/com/google/firebase/gradle/plugins/VendorPlugin.kt

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import org.gradle.api.Plugin
3333
import org.gradle.api.Project
3434
import org.gradle.api.artifacts.Configuration
3535
import org.gradle.api.logging.Logger
36+
import org.gradle.kotlin.dsl.apply
3637

3738
class VendorPlugin : Plugin<Project> {
3839
override fun apply(project: Project) {
@@ -44,6 +45,7 @@ class VendorPlugin : Plugin<Project> {
4445
}
4546

4647
fun configureAndroid(project: Project) {
48+
project.apply(plugin = "LicenseResolverPlugin")
4749

4850
val vendor = project.configurations.create("vendor")
4951
project.configurations.all {

buildSrc/src/main/java/com/google/firebase/gradle/plugins/license/ThirdPartyLicensesExtension.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,16 @@
1818
import java.util.ArrayList;
1919
import java.util.List;
2020

21-
class ThirdPartyLicensesExtension {
21+
public class ThirdPartyLicensesExtension {
2222
private final ArrayList<CustomLicense> customLicenses = new ArrayList<>();
2323

24-
public ThirdPartyLicensesExtension() {
25-
}
26-
2724
/** Add a library with its licenses in passed-in files(relative to rootDir). Only file URIs are supported*/
28-
void add(String name, String... licenseUris) {
25+
public void add(String name, String... licenseUris) {
2926
customLicenses.add(new CustomLicense(name, licenseUris));
3027
}
3128

32-
public static class CustomLicense implements Serializable {
33-
public final String name;
29+
static class CustomLicense implements Serializable {
30+
final String name;
3431
final List<URI> licenseUris = new ArrayList<>();
3532

3633
CustomLicense(String name, String[] licenseUris) {

firebase-inappmessaging-display/firebase-inappmessaging-display.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ android {
6060
}
6161
}
6262

63+
64+
thirdPartyLicenses {
65+
add 'Dagger', "file://${rootDir}/third_party/licenses/apache-2.0.txt"
66+
}
67+
6368
dependencies {
6469
implementation project(':firebase-common')
6570
implementation project(':firebase-components')

firebase-inappmessaging/firebase-inappmessaging.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ configurations.all {
103103
}
104104
}
105105

106+
107+
thirdPartyLicenses {
108+
add 'Dagger', "file://${rootDir}/third_party/licenses/apache-2.0.txt"
109+
}
110+
106111
dependencies {
107112
implementation project(':firebase-abt')
108113
implementation project(':firebase-common')

third_party/jsoup/LICENSE

-1,213
This file was deleted.

third_party/jsoup/src/main/java/org/jsoup/examples/HtmlToPlainText.java

-119
This file was deleted.

0 commit comments

Comments
 (0)