Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Migrate dependencies system (#92)
Browse files Browse the repository at this point in the history
* doc: correct usage of `ActivityResultContract` `launch` method (#86)

* Rename MediaStore tests

* Upgrade to Android Studio BumbleBee & AGP 7.1

* Update run configuration

* Apply spotless

* Fix closing resources when file copy is done

* Add support for file paths (#87)

* Deprecate SharedFileSystem in favor of AndroidFileSystem

Add support for Photo Picker metadata fetching

* Add appendingSink implementation

* Add support for file paths (makes interactions with Internal Storage possible)

* Implement delete for physical files

Add more internal storage tests

* Enable (temporarily) tests on GitHub Actions

* Apply spotless

* Update sample to use AndroidFileSystem

Disable tests (they're getting cancelled on GitHub Actions for no reason...)

* Improve greatly platform testing coverage

Deprecate Uri.toPath in favor of Uri.toOkioPath
Add scanFile method

* Upgrade version number

Update storage guide

* Fix type selection in photo picker

* Fix metadata fetchinf for photo picker URIs

* Updating storage guide

* Fix deprecation issue for the old createMediaStoreUri method

Update sample to use new createMediaStoreUri method

* Upgrade AGP to 7.1.1

* Fix a few mistakes in permission.md (#89)

* Update Android 13 notice for the photo picker

* Add refreshVersions Gradle plugin

* Migrate dependencies management to refreshVersions plugin

* Remove version catalog feature preview

* Upgrade dependencies

Remove unused dependencies
Fix code imports

* Get kotlinCompilerExtensionVersion from versions.properties

* Remove completely versions catalog

* Revert code change

Co-authored-by: tobianoapps <[email protected]>
Co-authored-by: Andreas <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2022
1 parent 74ffdae commit eabe87d
Show file tree
Hide file tree
Showing 14 changed files with 145 additions and 101 deletions.
2 changes: 1 addition & 1 deletion bom/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies {
api(project(":permissions"))
api(project(":photopicker"))
api(project(":storage"))
api(libs.okio)
api(Square.okio)
}
}

Expand Down
14 changes: 7 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.1.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
classpath(Android.tools.build.gradlePlugin)
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:_")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

plugins {
id("com.diffplug.spotless") version "5.12.5"
id("org.jetbrains.dokka") version "1.4.32"
id("me.tylerbwong.gradle.metalava") version "0.1.9" apply false
id("com.vanniktech.maven.publish") version "0.18.0" apply false
id("org.jetbrains.kotlin.plugin.parcelize") version "1.4.32" apply false
id("com.diffplug.spotless")
id("org.jetbrains.dokka")
id("me.tylerbwong.gradle.metalava") apply false
id("com.vanniktech.maven.publish") apply false
id("org.jetbrains.kotlin.plugin.parcelize") apply false
}

allprojects {
Expand Down
11 changes: 0 additions & 11 deletions gradle/androidx.versions.toml

This file was deleted.

12 changes: 0 additions & 12 deletions gradle/compose.versions.toml

This file was deleted.

12 changes: 0 additions & 12 deletions gradle/libs.versions.toml

This file was deleted.

6 changes: 6 additions & 0 deletions lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Generated by `./gradlew refreshVersions` to avoid errors when using _ as a version. -->
<issue id="GradlePluginVersion" severity="ignore" />
<issue id="GradleDependency" severity="ignore" />
</lint>
14 changes: 6 additions & 8 deletions permissions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ android {
}

dependencies {

implementation(androidx.corektx)
implementation(androidx.appcompat)
implementation(androidx.material)
testImplementation(libs.junit)
testImplementation(libs.robolectric)
androidTestImplementation(androidx.junit)
androidTestImplementation(androidx.junitktx)
implementation(AndroidX.core.ktx)
implementation(AndroidX.activity.ktx)
testImplementation(Testing.junit4)
testImplementation(Testing.robolectric)
androidTestImplementation(AndroidX.test.ext.junit)
androidTestImplementation(AndroidX.test.ext.junitKtx)
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import android.content.Intent
import android.content.pm.PackageManager
import androidx.activity.result.contract.ActivityResultContract
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions.EXTRA_PERMISSION_GRANT_RESULTS
import androidx.activity.result.contract.ActivityResultContracts.RequestMultiplePermissions.Companion.EXTRA_PERMISSION_GRANT_RESULTS
import androidx.core.content.ContextCompat

class RequestAccess : ActivityResultContract<RequestAccess.Args, Boolean>() {
Expand Down
10 changes: 5 additions & 5 deletions photopicker/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ android {

dependencies {

implementation(androidx.corektx)
implementation(androidx.appcompat)
testImplementation(libs.junit)
androidTestImplementation(androidx.junit)
androidTestImplementation(androidx.junitktx)
implementation(AndroidX.core.ktx)
implementation(AndroidX.activity.ktx)
testImplementation(Testing.junit4)
androidTestImplementation(AndroidX.test.ext.junit)
androidTestImplementation(AndroidX.test.ext.junitKtx)
}
38 changes: 20 additions & 18 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import de.fayard.refreshVersions.core.versionFor

/*
* Copyright 2021 Google LLC
*
Expand Down Expand Up @@ -58,7 +60,7 @@ android {
}

composeOptions {
kotlinCompilerExtensionVersion = compose.versions.current.get()
kotlinCompilerExtensionVersion = versionFor(AndroidX.compose.compiler)
}

packagingOptions {
Expand All @@ -70,16 +72,16 @@ android {

dependencies {

implementation(androidx.corektx)
implementation(androidx.appcompat)
implementation(androidx.material)
implementation(compose.ui)
implementation(compose.material)
implementation(compose.icons)
implementation(compose.uitoolingpreview)
implementation(androidx.lifecycleruntimektx)
implementation(compose.activity)
implementation(compose.navigation)
implementation(AndroidX.core.ktx)
implementation(AndroidX.appCompat)
implementation(Google.android.material)
implementation(AndroidX.compose.ui)
implementation(AndroidX.compose.material)
implementation(AndroidX.compose.material.icons.extended)
implementation(AndroidX.compose.ui.toolingPreview)
implementation(AndroidX.lifecycle.runtimeKtx)
implementation(AndroidX.activity.compose)
implementation(AndroidX.navigation.compose)

/*
* In a real world project you can use the BOM to import the different dependencies without needing
Expand All @@ -92,14 +94,14 @@ dependencies {
*/
implementation(project(":permissions"))
implementation(project(":photopicker"))
implementation(libs.okio)
implementation(Square.okio)
implementation(project(":storage"))

implementation(libs.glide)
implementation("com.github.skydoves:landscapist-glide:_")

testImplementation(libs.junit)
androidTestImplementation(androidx.junit)
androidTestImplementation(androidx.espresso)
androidTestImplementation(compose.junit)
debugImplementation(compose.uitooling)
testImplementation(Testing.junit4)
androidTestImplementation(AndroidX.test.ext.junit)
androidTestImplementation(AndroidX.test.espresso.core)
androidTestImplementation(AndroidX.compose.ui.testJunit4)
debugImplementation(AndroidX.compose.ui.tooling)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ import com.google.modernstorage.sample.saf.SelectDocumentFileScreen
import com.google.modernstorage.sample.ui.theme.ModernStorageTheme

class MainActivity : ComponentActivity() {
@ExperimentalFoundationApi
@ExperimentalMaterialApi
@OptIn(ExperimentalMaterialApi::class, ExperimentalFoundationApi::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Expand Down
14 changes: 3 additions & 11 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
enableFeaturePreview("VERSION_CATALOGS")

dependencyResolutionManagement {
versionCatalogs {
create("compose") {
from(files("gradle/compose.versions.toml"))
}
create("androidx") {
from(files("gradle/androidx.versions.toml"))
}
}
plugins {
// See https://jmfayard.github.io/refreshVersions
id("de.fayard.refreshVersions") version "0.40.1"
}

rootProject.name = "ModernStorage"
Expand Down
26 changes: 13 additions & 13 deletions storage/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ android {
}

dependencies {
implementation(libs.stdlib.jdk7)
implementation(libs.coroutines.android)
androidTestImplementation(libs.coroutines.android)
implementation(Kotlin.stdlib.jdk7)
implementation(KotlinX.coroutines.android)
androidTestImplementation(KotlinX.coroutines.android)

implementation(androidx.corektx)
implementation(androidx.appcompat)
implementation(libs.okio)
implementation(AndroidX.core.ktx)
implementation(AndroidX.appCompat)
implementation(Square.okio)

testImplementation(libs.junit)
androidTestImplementation(androidx.junit)
androidTestImplementation(androidx.junitktx)
androidTestImplementation(androidx.espresso)
androidTestImplementation(androidx.rules)
androidTestImplementation(androidx.uiautomator)
androidTestImplementation(androidx.runner)
testImplementation(Testing.junit4)
androidTestImplementation(AndroidX.test.ext.junit)
androidTestImplementation(AndroidX.test.ext.junitKtx)
androidTestImplementation(AndroidX.test.espresso.core)
androidTestImplementation(AndroidX.test.rules)
androidTestImplementation(AndroidX.test.uiAutomator)
androidTestImplementation(AndroidX.test.runner)
}
repositories {
mavenCentral()
Expand Down
82 changes: 82 additions & 0 deletions versions.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#### Dependencies and Plugin versions with their available updates.
#### Generated by `./gradlew refreshVersions` version 0.40.1
####
#### Don't manually edit or split the comments that start with four hashtags (####),
#### they will be overwritten by refreshVersions.
####
#### suppress inspection "SpellCheckingInspection" for whole file
#### suppress inspection "UnusedProperty" for whole file

## unused
version.org.jetbrains.dokka..jekyll-template-processing-plugin=1.6.10

## unused
version.org.jetbrains.dokka..gfm-template-processing-plugin=1.6.10

## unused
version.org.jetbrains.dokka..dokka-base=1.6.10

## unused
version.org.jetbrains.dokka..all-modules-page-plugin=1.6.10

version.robolectric=4.7.3

## unused
version.org.jetbrains.dokka..jekyll-plugin=1.4.32

## unused
version.org.jetbrains.dokka..javadoc-plugin=1.4.32

## unused
version.org.jetbrains.dokka..gfm-plugin=1.4.32

## unused
version.org.jacoco..org.jacoco.ant=0.8.3

version.okio=3.0.0

version.kotlinx.coroutines=1.6.0

version.kotlin=1.6.10

version.junit.junit=4.13.2

version.google.android.material=1.5.0

version.com.github.skydoves..landscapist-glide=1.5.0

version.androidx.test.uiautomator=2.2.0

version.androidx.test.runner=1.4.0

version.androidx.test.rules=1.4.0

version.androidx.test.ext.junit=1.1.3

version.androidx.test.espresso=3.4.0

version.androidx.navigation-compose=2.4.1

version.androidx.lifecycle=2.4.1

version.androidx.core=1.7.0

version.androidx.compose.ui=1.1.1

version.androidx.compose.material=1.1.1

version.androidx.compose.compiler=1.1.1

version.androidx.appcompat=1.4.1

version.androidx.activity=1.4.0

plugin.org.jetbrains.dokka=1.6.10

plugin.me.tylerbwong.gradle.metalava=0.2.1

plugin.com.vanniktech.maven.publish=0.19.0

plugin.com.diffplug.spotless=6.3.0

plugin.android=7.1.2

0 comments on commit eabe87d

Please sign in to comment.