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

Commit

Permalink
New architecture based on Okio and separated utility libraries (#59)
Browse files Browse the repository at this point in the history
* Rename sample folder

* Update Kotlin plugin & AGP

* Add storage artefact

* Remove views sample

* Add Compose sample generated files

* Add asset files for storage tests

* Upgrade to Okio 3.0.0-alpha11

Rename AndroidFileSystem to SharedFileSystem

* Create MediaStoreUtils for storage tests

* Add instrument test boilerplate

* Upgrade dependencies

* Implement source method in SharedFileSystem

Add extensions functions around Path and Uri conversions
Instrument tests are still in progress

* Update to Okio 3.0.0 stable

Implement sink method
Throw UnsupportedOperationException on unsupported methods

* Apply spotless

* Rename sample folder

* Remove IDE config files

* Implement metadataOrNull method in SharedFileSystem

Update spotlessApply run configuration

* Add manifest for tests

* Apply spotless

* Implement list method in SharedFileSystem

* Add first Storage Access Framework test

* Ignore Android Studio IDE files (not needed anymore)

* Add draft of permissions library

* Add initial experiments of photo picker API

* Add Photo Picker to SAF

* Add PhotoPicker ActivityResultContract

Apply spotless

* Merge permissions library

* Remove unused tests

* Add draft of a more generic method to check permissions

* Fix permissions check logic

* Add POM artifact metadata for new modules

* Rename Ownership parameter in StoragePermissions to CreatedBy

* Upgrading to AGP 7.0.4

Set test dependency precise version

* Remove TODO (type parameter is required for multiple mime types)

* Check storage permissions until Android 12 (S)

Update comments

* Add Permissions guide

* Add storage guide

Update storage metadata related classes
Update permissions guide
Change PhotoPicker type constants to Kotlin enum

* Generate API metadata for new libraries

Add metalava run configurations
Update dependencies

* Update API metadata to reflect @JvmInline annotations

Upgrade metalava Gradle plugin

* Add run sample configuration

* Add photo picker demo

Fix file metadata fetching for photo picker entries
Add MediaPreviewCard composable
Update storage guide

* Update Select Document File demo

* Simplify demo names

* Add scanUri and createMediaStoreUri methods in SharedFileSystem

Add AddMedia demo
Update API metadata

* Move demo logic to view model

Add placeholder for permissions demo

* Refactor demos

Remove unused code & string resources

* Simplify storage permissions parameters

Finish permissions demo
Simplify layout structure in SelectDocumentFileScreen
Update API metadata

* Simplify demo layouts structure

* Simplify demo layouts structure

Add sample text file

* Add AddFileToDownloads demo

Add audio in the list of options in AddMedia demo

* Add MediaStore tests

Update SAF tests

* Update createMediaStoreUri method

Fix compatibility issue on devices < API 29

* Apply Spotless

* Add tests in Github Actions

* Fix sample by updating SharedFilesystem API usage

* Implement delete method in SharedFileSystem

Enable legacyExternalStorage flag in test app

* Disable running instrumented tests on GitHub Actions

I need further tuning to get the right infrastructure and that will delay this release (which is already late)

* Update README.md

* Simplify root README.md file

* Bring back mediastore and filesystem packages to deprecate them

* Deprecate filesystem & storage modules

* Add deprecation notice in the fileystem & mediastore guides

* Add deprecation notice in the API metadata

* Upgrade modules version

Apply Dokka & Maven Publish plugins to the new modules
Upgrade dependencies

* Update API metadata
  • Loading branch information
yrezgui authored Jan 11, 2022
1 parent a11c1cc commit e62cda5
Show file tree
Hide file tree
Showing 148 changed files with 3,767 additions and 2,003 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
Expand All @@ -23,3 +29,37 @@ jobs:

- name: Build root project
run: ./gradlew clean && ./gradlew build

- name: Run local tests
run: ./gradlew testDebug --stacktrace

# TODO: Fix running instrumented tests on GitHub Actions
# test:
# needs: build
# runs-on: macOS-latest # enables hardware acceleration in the virtual machine
# timeout-minutes: 30
# strategy:
# matrix:
# api-level: [ 21, 23, 24, 26, 28, 29, 30, 31 ]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v2
#
# - name: Copy CI gradle.properties
# run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
#
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# distribution: 'zulu'
# java-version: 11
# java-package: jdk
#
# - name: Run instrumentation tests
# uses: reactivecircus/android-emulator-runner@v2
# with:
# api-level: ${{ matrix.api-level }}
# arch: x86
# disable-animations: true
# script: ./gradlew connectedCheck --stacktrace
11 changes: 1 addition & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ captures/

# IntelliJ
*.iml
**/.idea/**
!**/.idea/codeStyleSettings.xml
!**/.idea/copyright
!**/.idea/codeStyles
!.idea/codeStyles/Project.xml
!.idea/codeStyles/codeStyleConfig.xml
!.idea/copyright/AndroidCopyright.xml
!.idea/copyright/profiles_settings.xml
!.idea/inspectionProfiles/Project_Default.xml
!.idea/vcs.xml
.idea

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
Expand Down
267 changes: 0 additions & 267 deletions .idea/codeStyles/Project.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .run/sample.run.xml → .run/Run sample.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="sample" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<configuration default="false" name="Run sample" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
<module name="ModernStorage.sample" />
<option name="DEPLOY" value="true" />
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
Expand Down
23 changes: 23 additions & 0 deletions .run/modernstorage [metalavaCheckCompatibility].run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="modernstorage [metalavaCheckCompatibility]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="metalavaCheckCompatibility" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
Loading

0 comments on commit e62cda5

Please sign in to comment.