Skip to content

Commit

Permalink
Switch to gradle-license-plugin (#4160)
Browse files Browse the repository at this point in the history
* switch to gradle-license-plugin

* generate licenseReleaseReport
UjuiUjuMandan authored Dec 21, 2024

Verified

This commit was signed with the committer’s verified signature.
jovandeginste Jo Vandeginste
1 parent 54d5207 commit 70f1743
Showing 6 changed files with 1,297 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@ jobs:
run: |
cd ${{ github.workspace }}/V2rayNG
chmod 755 gradlew
./gradlew licenseReleaseReport
./gradlew assembleRelease -Pandroid.injected.signing.store.file=${{ steps.android_keystore.outputs.filePath }} -Pandroid.injected.signing.store.password=${{ secrets.APP_KEYSTORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.APP_KEYSTORE_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.APP_KEY_PASSWORD }}
- name: Upload arm64-v8a APK
@@ -82,4 +83,4 @@ jobs:
if: ${{ success() }}
with:
name: x86-apk
path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/*x86*.apk
path: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/release/*x86*.apk
4 changes: 1 addition & 3 deletions V2rayNG/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
id("com.google.android.gms.oss-licenses-plugin")
id("com.jaredsburrows.license")
}

android {
@@ -146,6 +146,4 @@ dependencies {
androidTestImplementation(libs.androidx.espresso.core)
testImplementation(libs.org.mockito.mockito.inline)
testImplementation(libs.mockito.kotlin)
// Oss Licenses
implementation(libs.play.services.oss.licenses)
}
1,285 changes: 1,285 additions & 0 deletions V2rayNG/app/src/main/assets/open_source_licenses.html

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions V2rayNG/app/src/main/java/com/v2ray/ang/ui/AboutActivity.kt
Original file line number Diff line number Diff line change
@@ -20,7 +20,6 @@ import com.v2ray.ang.util.ZipUtil
import java.io.File
import java.text.SimpleDateFormat
import java.util.Locale
import com.google.android.gms.oss.licenses.OssLicensesMenuActivity


class AboutActivity : BaseActivity() {
@@ -90,7 +89,12 @@ class AboutActivity : BaseActivity() {
Utils.openUri(this, AppConfig.v2rayNGIssues)
}
binding.layoutOssLicenses.setOnClickListener{
startActivity(Intent(this, OssLicensesMenuActivity::class.java))
val webView = android.webkit.WebView(this);
webView.loadUrl("file:///android_asset/open_source_licenses.html");
android.app.AlertDialog.Builder(this)
.setTitle("Open source licenses")
.setView(webView)
.setPositiveButton("OK", android.content.DialogInterface.OnClickListener { dialog, whichButton -> dialog.dismiss() }).show()
}

binding.layoutTgChannel.setOnClickListener {
2 changes: 1 addition & 1 deletion V2rayNG/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ plugins {

buildscript {
dependencies {
classpath(libs.oss.licenses.plugin)
classpath(libs.gradle.license.plugin)
}
}

6 changes: 2 additions & 4 deletions V2rayNG/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[versions]
agp = "8.7.2"
gradleLicensePlugin = "0.9.8"
kotlin = "2.1.0"
coreKtx = "1.15.0"
junit = "4.13.2"
@@ -11,8 +12,6 @@ activity = "1.9.3"
constraintlayout = "2.2.0"
mmkvStatic = "1.3.11"
gson = "2.11.0"
ossLicensesPlugin = "0.10.6"
playServicesOssLicenses = "17.1.0"
rxjava = "3.1.9"
rxandroid = "3.0.2"
rxpermissions = "0.12"
@@ -29,6 +28,7 @@ preferenceKtx = "1.2.1"
recyclerview = "1.3.2"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
gradle-license-plugin = { module = "com.jaredsburrows:gradle-license-plugin", version.ref = "gradleLicensePlugin" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
@@ -38,8 +38,6 @@ androidx-activity = { group = "androidx.activity", name = "activity", version.re
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
mmkv-static = { module = "com.tencent:mmkv-static", version.ref = "mmkvStatic" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
oss-licenses-plugin = { module = "com.google.android.gms:oss-licenses-plugin", version.ref = "ossLicensesPlugin" }
play-services-oss-licenses = { module = "com.google.android.gms:play-services-oss-licenses", version.ref = "playServicesOssLicenses" }
rxjava = { module = "io.reactivex.rxjava3:rxjava", version.ref = "rxjava" }
rxandroid = { module = "io.reactivex.rxjava3:rxandroid", version.ref = "rxandroid" }
rxpermissions = { module = "com.github.tbruyelle:rxpermissions", version.ref = "rxpermissions" }

0 comments on commit 70f1743

Please sign in to comment.