Alternate open source licenses plugin
(cherry picked from commit ac2df8795459ad625883849a53647f90e86fbe61) # Conflicts: # build.gradle.kts
This commit is contained in:
parent
1d71dfdff3
commit
22f26f8288
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@
|
||||
/build
|
||||
*.apk
|
||||
app/**/output.json
|
||||
open_source_licenses.html
|
||||
|
||||
# Hebrew assets are copied on build
|
||||
app/src/main/res/values-iw/
|
||||
|
@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
|
||||
apply plugin: 'com.jaredsburrows.license'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'kotlin-android-extensions'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
@ -33,6 +33,13 @@ ext {
|
||||
}
|
||||
}
|
||||
|
||||
licenseReport {
|
||||
generateHtmlReport = true
|
||||
generateJsonReport = false
|
||||
|
||||
copyHtmlReportToAssets = true
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.3'
|
||||
@ -90,6 +97,9 @@ android {
|
||||
buildConfigField "boolean", "INCLUDE_UPDATER", "true"
|
||||
dimension "default"
|
||||
}
|
||||
fdroid {
|
||||
dimension "default"
|
||||
}
|
||||
dev {
|
||||
resConfigs "en", "xxhdpi"
|
||||
dimension "default"
|
||||
@ -368,7 +378,22 @@ task copyResources(type: Copy) {
|
||||
include '**/*'
|
||||
}
|
||||
|
||||
preBuild.dependsOn(ktlintFormat, copyResources)
|
||||
// See https://github.com/jaredsburrows/gradle-license-plugin/issues/113
|
||||
task licenseReportPreBuild(type: Exec) {
|
||||
switch (getGradle().getStartParameter().getTaskRequests().toString()) {
|
||||
case ~/.*Standard.*/:
|
||||
commandLine '../gradlew', 'licenseStandardReleaseReport'
|
||||
break
|
||||
case ~/.*Fdroid.*/:
|
||||
commandLine '../gradlew', 'licenseFdroidReleaseReport'
|
||||
break
|
||||
case ~/.*Dev.*/:
|
||||
commandLine '../gradlew', 'licenseDevReleaseReport'
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
preBuild.dependsOn(ktlintFormat, copyResources, licenseReportPreBuild)
|
||||
|
||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Standard")) {
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
|
@ -133,13 +133,6 @@
|
||||
android:name=".extension.util.ExtensionInstallActivity"
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
|
||||
|
||||
<activity
|
||||
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
<activity
|
||||
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
|
@ -5,9 +5,10 @@ import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.webkit.WebView
|
||||
import androidx.preference.PreferenceScreen
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity
|
||||
import com.afollestad.materialdialogs.customview.customView
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.updater.UpdateChecker
|
||||
@ -125,7 +126,7 @@ class AboutController : SettingsController() {
|
||||
titleRes = R.string.licenses
|
||||
|
||||
onClick {
|
||||
startActivity(Intent(activity, OssLicensesMenuActivity::class.java))
|
||||
LicensesDialogController().showDialog(router)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -160,6 +161,19 @@ class AboutController : SettingsController() {
|
||||
}
|
||||
}
|
||||
|
||||
class LicensesDialogController(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
val webView = WebView(activity!!)
|
||||
webView.loadUrl("file:///android_asset/open_source_licenses.html")
|
||||
|
||||
return MaterialDialog(activity!!)
|
||||
.title(res = R.string.licenses)
|
||||
.customView(view = webView)
|
||||
.positiveButton(res = android.R.string.ok)
|
||||
}
|
||||
}
|
||||
|
||||
class NewUpdateDialogController(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
|
||||
constructor(body: String, url: String) : this(
|
||||
|
@ -42,7 +42,7 @@ buildscript {
|
||||
classpath("com.github.ben-manes:gradle-versions-plugin:0.28.0")
|
||||
classpath("com.github.zellius:android-shortcut-gradle-plugin:0.1.2")
|
||||
classpath("com.google.gms:google-services:4.3.3")
|
||||
classpath("com.google.android.gms:oss-licenses-plugin:0.10.2")
|
||||
classpath("com.jaredsburrows:gradle-license-plugin:0.8.80")
|
||||
// Realm (EH)
|
||||
classpath("io.realm:realm-gradle-plugin:6.0.2")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user