
commit 4727db2dc054f58ef756891f07719270e9cce616 Author: sisbell <shane.isbell@gmail.com> Date: Mon Aug 2 21:35:52 2021 -0700 Implements #509: Use Gradle Version Catalog --- app-mini/build.gradle | 30 ++++++------ app-tv/build.gradle | 27 +++++------ app/build.gradle | 34 +++++++------ appcore/build.gradle | 10 +--- .../android/core/ExampleInstrumentedTest.kt | 24 ---------- .../org/torproject/android/core/ExampleUnitTest.kt | 17 ------- build.gradle | 1 - commons-device.gradle | 1 - gradle/libs.versions.toml | 55 ++++++++++++++++++++++ gradle/wrapper/gradle-wrapper.properties | 4 +- intentintegrator/build.gradle | 2 +- orbotservice/build.gradle | 19 ++++---- settings.gradle | 9 ++++ 13 files changed, 123 insertions(+), 110 deletions(-) diff --git a/app-mini/build.gradle b/app-mini/build.gradle index 22067c39..e861fb41 100644 --- a/app-mini/build.gradle +++ b/app-mini/build.gradle @@ -28,19 +28,19 @@ android { exclude 'lib/armeabi-v7a/libgojni.so' exclude 'lib/armeabi/libgojni.so' } -} - -dependencies { - implementation( - project(path: ':appcore'), - project(path: ':intentintegrator'), - project(':orbotservice'), - 'androidx.constraintlayout:constraintlayout:2.1.0', - 'androidx.coordinatorlayout:coordinatorlayout:1.1.0', - 'androidx.recyclerview:recyclerview:1.2.1', - 'androidx.palette:palette:1.0.0', - 'com.github.apl-devs:appintro:v4.2.2', - 'com.google.android.material:material:1.4.0' - ) - androidTestImplementation "tools.fastlane:screengrab:1.2.0" + dependencies { + implementation( + project(path: ':appcore'), + project(path: ':intentintegrator'), + project(':orbotservice'), + libs.android.material, + libs.androidx.coordinator.layout, + libs.androidx.localbroadcast, + libs.androidx.palette, + libs.androidx.recyclerview, + libs.apl.appintro, + libs.guardian.jtorctl + ) + androidTestImplementation libs.fastlane.screengrab + } } diff --git a/app-tv/build.gradle b/app-tv/build.gradle index 36baec67..259ae0e5 100644 --- a/app-tv/build.gradle +++ b/app-tv/build.gradle @@ -36,21 +36,18 @@ android { dependencies { implementation( - project(path: ':appcore'), - project(path: ':intentintegrator'), + project(':appcore'), + project(':intentintegrator'), project(':orbotservice'), - 'androidx.constraintlayout:constraintlayout:2.1.0', - 'androidx.coordinatorlayout:coordinatorlayout:1.1.0', - "androidx.leanback:leanback:1.2.0-alpha01", - "androidx.leanback:leanback-paging:1.1.0-alpha08", - "androidx.leanback:leanback-preference:1.2.0-alpha01", - "androidx.leanback:leanback-tab:1.1.0-beta01", - 'androidx.palette:palette:1.0.0', - 'androidx.recyclerview:recyclerview:1.2.1', - 'com.github.apl-devs:appintro:v4.2.2', - 'com.github.jetradarmobile:android-snowfall:1.2.1', - 'com.google.android.material:material:1.4.0' + libs.android.material, + libs.android.snowfall, + libs.androidx.coordinator.layout, + libs.androidx.localbroadcast, + libs.androidx.palette, + libs.androidx.recyclerview, + libs.apl.appintro, + libs.guardian.jtorctl, + libs.bundles.leanback ) - androidTestImplementation "tools.fastlane:screengrab:1.2.0" - + androidTestImplementation libs.fastlane.screengrab } \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index aa9af8e9..a2d4345f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,20 +51,24 @@ android { universalApk true } } -} -dependencies { - implementation( - project(path: ':appcore'), - project(path: ':intentintegrator'), - project(':orbotservice'), - 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0', - 'com.android.volley:volley:1.2.0', - 'com.github.apl-devs:appintro:v4.2.2', - 'com.github.jetradarmobile:android-snowfall:1.2.1', - 'com.github.tladesignz:IPtProxy:1.0.0', - 'com.google.android.material:material:1.4.0', - 'pl.bclogic:pulsator4droid:1.0.3' - ) - androidTestImplementation "tools.fastlane:screengrab:1.2.0" + dependencies { + implementation( + project(':appcore'), + project(':intentintegrator'), + project(':orbotservice'), + libs.apl.appintro, + libs.android.snowfall, + libs.android.volley, + libs.androidx.core, + libs.androidx.localbroadcast, + libs.androidx.palette, + libs.android.material, + libs.bclogic.pulsator, + libs.guardian.jtorctl, + libs.ipt.proxy\ + + ) + androidTestImplementation libs.fastlane.screengrab + } } \ No newline at end of file diff --git a/appcore/build.gradle b/appcore/build.gradle index 5c424106..39950482 100644 --- a/appcore/build.gradle +++ b/appcore/build.gradle @@ -24,14 +24,8 @@ android { dependencies { implementation( - project(path: ':orbotservice'), + project(':orbotservice'), "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version", - 'androidx.core:core-ktx:1.6.0', - 'androidx.appcompat:appcompat:1.3.1' + libs.androidx.appcompat ) - androidTestImplementation ( - 'androidx.test.ext:junit:1.1.3', - 'androidx.test.espresso:espresso-core:3.4.0' - ) - testImplementation 'junit:junit:4.13.2' } \ No newline at end of file diff --git a/appcore/src/androidTest/java/org/torproject/android/core/ExampleInstrumentedTest.kt b/appcore/src/androidTest/java/org/torproject/android/core/ExampleInstrumentedTest.kt deleted file mode 100644 index b7e9cad1..00000000 --- a/appcore/src/androidTest/java/org/torproject/android/core/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.torproject.android.core - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("org.torproject.android.core.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/appcore/src/test/java/org/torproject/android/core/ExampleUnitTest.kt b/appcore/src/test/java/org/torproject/android/core/ExampleUnitTest.kt deleted file mode 100644 index 9b2de166..00000000 --- a/appcore/src/test/java/org/torproject/android/core/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.torproject.android.core - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file diff --git a/build.gradle b/build.gradle index b088404e..ecb8ab1f 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,6 @@ buildscript { ext { kotlin_version = '1.5.20' - palette_version = "1.0.0" } repositories { mavenCentral() diff --git a/commons-device.gradle b/commons-device.gradle index 3a9a0faa..0fd02b1a 100644 --- a/commons-device.gradle +++ b/commons-device.gradle @@ -67,4 +67,3 @@ repositories { } } - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..bcf9ea29 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,55 @@ +[versions] +android-material-version = "1.4.0" +android-shell-version = "1.0.0" +android-snowfall-version = "1.2.1" +android-volley-version = "1.2.0" + +androidx-appcompat-version = "1.3.1" +androidx-constraint-layout-version = "2.1.0" +androidx-coordinator-layout-version = "1.1.0" +androidx-core-version = "1.6.0" +androidx-leanback-version = "1.2.0-alpha01" +androidx-leanback-paging-version = "1.1.0-alpha08" +androidx-leanback-tab-version = "1.1.0-beta01" +androidx-localbroadcast-version = "1.0.0" +androidx-palette-version= "1.0.0" +androidx-recyclerview-version = "1.2.1" + +apl-appintro-version = "v4.2.2" +bclogic-pulsator-version = "1.0.3" +fastlane-screengrab-version = "1.2.0" +guardian-jsocks-version = "1.0.4" +guardian-jtorctl-version = "0.4.5.7" +ipt-proxy-version = "1.0.0" +portmapper-version = "2.0.5" +tor-android-version = "0.4.5.9" + +[libraries] +android-material = { module = "com.google.android.material:material", version.ref = "android-material-version" } +android-shell = { module = "com.jaredrummler:android-shell", version.ref = "android-shell-version" } +android-snowfall = { module = "com.github.jetradarmobile:android-snowfall", version.ref = "android-snowfall-version" } +android-volley = { module = "com.android.volley:volley", version.ref = "android-volley-version" } + +androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat-version" } +androidx-constraint-layout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "androidx-constraint-layout-version" } +androidx-coordinator-layout = { module = "androidx.coordinatorlayout:coordinatorlayout", version.ref = "androidx-coordinator-layout-version" } +androidx-core = { module = "androidx.core:core", version.ref = "androidx-core-version" } +androidx-leanback-core = { module = "androidx.leanback:leanback", version.ref = "androidx-leanback-version" } +androidx-leanback-paging = { module = "androidx.leanback:leanback-paging", version.ref = "androidx-leanback-paging-version" } +androidx-leanback-preferences = { module = "androidx.leanback:leanback-preference", version.ref = "androidx-leanback-version" } +androidx-leanback-tab = { module = "androidx.leanback:leanback-tab", version.ref = "androidx-leanback-tab-version" } +androidx-localbroadcast = { module = "androidx.localbroadcastmanager:localbroadcastmanager", version.ref = "androidx-localbroadcast-version" } +androidx-palette = { module = "androidx.palette:palette", version.ref = "androidx-palette-version" } +androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "androidx-recyclerview-version" } + +apl-appintro = { module = "com.github.apl-devs:appintro", version.ref = "apl-appintro-version" } +bclogic-pulsator = { module = "pl.bclogic:pulsator4droid", version.ref = "bclogic-pulsator-version" } +fastlane-screengrab = { module = "tools.fastlane:screengrab", version.ref = "fastlane-screengrab-version" } +guardian-jsocks = { module = "com.gitlab.guardianproject:jsocksandroid", version.ref = "guardian-jsocks-version" } +guardian-jtorctl = { module = "info.guardianproject:jtorctl", version.ref = "guardian-jtorctl-version" } +ipt-proxy = { module = "com.github.tladesignz:IPtProxy", version.ref = "ipt-proxy-version" } +portmapper = { module = "com.offbynull.portmapper:portmapper", version.ref = "portmapper-version" } +tor-android = { module = "info.guardianproject:tor-android", version.ref = "tor-android-version" } + +[bundles] +leanback= ["androidx-leanback-core", "androidx-leanback-paging", "androidx-leanback-preferences", "androidx-leanback-tab"] \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e1e2fd2c..6879d9ec 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=13bf8d3cf8eeeb5770d19741a59bde9bd966dd78d17f1bbad787a05ef19d1c2d -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionSha256Sum=9bb8bc05f562f2d42bdf1ba8db62f6b6fa1c3bf6c392228802cc7cb0578fe7e0 +distributionUrl=https://services.gradle.org/distributions/gradle-7.1.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/intentintegrator/build.gradle b/intentintegrator/build.gradle index 624b09e1..ad612112 100644 --- a/intentintegrator/build.gradle +++ b/intentintegrator/build.gradle @@ -18,5 +18,5 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) - implementation 'androidx.appcompat:appcompat:1.3.1' + libs.androidx.appcompat } \ No newline at end of file diff --git a/orbotservice/build.gradle b/orbotservice/build.gradle index 3543593b..2f7080c9 100644 --- a/orbotservice/build.gradle +++ b/orbotservice/build.gradle @@ -38,17 +38,14 @@ android { } dependencies { - api 'info.guardianproject:jtorctl:0.4.5.7' + api libs.guardian.jtorctl implementation( - 'androidx.core:core:1.6.0', - 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0', - 'com.github.tladesignz:IPtProxy:1.0.0', - 'com.gitlab.guardianproject:jsocksandroid:1.0.4', - 'com.jaredrummler:android-shell:1.0.0', - 'com.offbynull.portmapper:portmapper:2.0.5', - 'info.guardianproject:geoip:20191217', - 'info.guardianproject:tor-android:0.4.5.9', - + libs.android.shell, + libs.androidx.core, + libs.androidx.localbroadcast, + libs.ipt.proxy, + libs.guardian.jsocks, + libs.portmapper, + libs.tor.android ) - testImplementation 'junit:junit:4.13.2' } diff --git a/settings.gradle b/settings.gradle index 2decf04b..67697f75 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,3 +2,12 @@ include ':intentintegrator' include ':appcore' include ':orbotservice' include ':app',':app-mini', ':app-tv' + +enableFeaturePreview("VERSION_CATALOGS") +dependencyResolutionManagement { + versionCatalogs { + lib { + from(files("./gradle/libs.versions.toml")) + } + } +} \ No newline at end of file