Skip to content

Commit b1d84f7

Browse files
authored
Merge pull request #1 from Commit451/feature/open-source-library-migration-v2
Migrate DriveAppFolderViewer with open-source-library-migration guide
2 parents c4ef90b + 3408ba1 commit b1d84f7

23 files changed

+459
-372
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
11
name: Build
2-
on: [pull_request, push]
2+
3+
on:
4+
push:
5+
pull_request:
6+
37
jobs:
48
build:
59
runs-on: ubuntu-latest
10+
611
steps:
7-
- name: Checkout the code
8-
uses: actions/checkout@v2
9-
- name: Build the app
10-
run: ./gradlew driveappfolderviewer:assemble
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Configure JDK
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: zulu
19+
java-version: '17'
20+
cache: gradle
21+
22+
- name: Validate Gradle Wrapper
23+
uses: gradle/actions/wrapper-validation@v4
24+
25+
- name: Build
26+
run: ./gradlew build
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
env:
9+
RELEASE_SIGNING_ENABLED: true
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
if: github.repository == 'Commit451/DriveAppFolderViewer'
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Install JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: zulu
24+
java-version: '17'
25+
cache: gradle
26+
27+
- name: Release to Maven Central
28+
run: ./gradlew publishAndReleaseToMavenCentral -PVERSION_NAME="${GITHUB_REF_NAME}" --no-configuration-cache
29+
env:
30+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
31+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
32+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}

.jitpack.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,16 @@ Allows easy visualization of files within an AppFolder in Google Drive
33

44
<img src="/art/screenshot-1.png?raw=true" width="200px">
55

6-
[![](https://jitpack.io/v/Commit451/DriveAppFolderViewer.svg)](https://jitpack.io/#Commit451/DriveAppFolderViewer)
6+
[![Build](https://github.com/Commit451/DriveAppFolderViewer/actions/workflows/ci.yml/badge.svg)](https://github.com/Commit451/DriveAppFolderViewer/actions/workflows/ci.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.commit451.driveappfolderviewer/driveappfolderviewer.svg?label=Maven%20Central)](https://central.sonatype.com/artifact/com.commit451.driveappfolderviewer/driveappfolderviewer)
77

88
## Dependency
9-
Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
10-
11-
```gradle
12-
allprojects {
13-
repositories {
14-
...
15-
maven { url "https://jitpack.io" }
16-
}
17-
}
18-
```
19-
20-
Then, add the library to your project `build.gradle`
21-
```gradle
9+
```kotlin
2210
dependencies {
23-
debugImplementation 'com.github.Commit451:DriveAppFolderViewer:latest.version.here'
24-
// or, just "implementation" if you want to use this in all your builds
11+
debugImplementation("com.commit451.driveappfolderviewer:driveappfolderviewer:<latest-version>")
12+
// or use implementation(...) if you want it in all builds
2513
}
2614
```
15+
2716
We recommend restricting access to this UI to just debug builds, since it is powerful and users could end up deleting important files without understanding what they do.
2817

2918
## Usage
@@ -39,7 +28,7 @@ Note: This library makes no attempt to resolve Google API connection issues, so
3928
To contribute to this project and test it with the sample within this repo, you will need to generate your own OAuth 2.0 Client ID following the steps [here](https://developers.google.com/drive/android/get-started)
4029

4130
## Note
42-
- This library is pretty hefty, bringing in Kotlin, Coroutines, okio, and [okyo](https://github.com/Commit451/okyo), as well as the Google Drive v3 Java APIs. Make sure you are aware of this.
31+
- This library is pretty hefty, bringing in Kotlin, Coroutines, and the Google Drive v3 Java APIs. Make sure you are aware of this.
4332
- There is a 1,000 page limit on results, therefore only the first 1,000 files/folders will be shown within a folder.
4433

4534
License

app/build.gradle

Lines changed: 0 additions & 87 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
plugins {
2+
id("com.android.application")
3+
id("org.jetbrains.kotlin.plugin.compose")
4+
}
5+
6+
android {
7+
namespace = "com.commit451.driveappfolderviewer.sample"
8+
compileSdk = 35
9+
10+
defaultConfig {
11+
applicationId = "com.commit451.driveappfolderviewer.sample"
12+
minSdk = 21
13+
targetSdk = 35
14+
versionCode = 1
15+
versionName = "1.0"
16+
}
17+
18+
buildFeatures {
19+
compose = true
20+
}
21+
22+
composeOptions {
23+
kotlinCompilerExtensionVersion = "1.5.15"
24+
}
25+
26+
compileOptions {
27+
sourceCompatibility = JavaVersion.VERSION_17
28+
targetCompatibility = JavaVersion.VERSION_17
29+
}
30+
31+
buildTypes {
32+
debug {
33+
isMinifyEnabled = false
34+
proguardFiles(
35+
getDefaultProguardFile("proguard-android-optimize.txt"),
36+
"proguard-rules.pro",
37+
)
38+
}
39+
release {
40+
isMinifyEnabled = false
41+
proguardFiles(
42+
getDefaultProguardFile("proguard-android-optimize.txt"),
43+
"proguard-rules.pro",
44+
)
45+
}
46+
}
47+
48+
packaging {
49+
resources {
50+
excludes += setOf(
51+
"META-INF/INDEX.LIST",
52+
"META-INF/DEPENDENCIES",
53+
"META-INF/LICENSE",
54+
"META-INF/LICENSE.txt",
55+
"META-INF/license.txt",
56+
"META-INF/NOTICE",
57+
"META-INF/NOTICE.txt",
58+
"META-INF/notice.txt",
59+
"META-INF/ASL2.0",
60+
)
61+
}
62+
}
63+
64+
lint {
65+
abortOnError = false
66+
}
67+
}
68+
69+
dependencies {
70+
implementation("androidx.core:core-ktx:1.16.0")
71+
implementation("androidx.activity:activity-compose:1.10.1")
72+
implementation("androidx.compose.material:material:1.6.8")
73+
implementation("androidx.compose.animation:animation:1.6.8")
74+
implementation("androidx.compose.ui:ui-tooling:1.6.8")
75+
implementation("androidx.compose.material:material-icons-extended:1.6.8")
76+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.1")
77+
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.1")
78+
implementation("androidx.compose.runtime:runtime-livedata:1.6.8")
79+
80+
implementation(project(":driveappfolderviewer"))
81+
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.commit451.driveappfolderviewer.sample">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43

54
<uses-permission android:name="android.permission.INTERNET" />
65

build.gradle

Lines changed: 0 additions & 29 deletions
This file was deleted.

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins {
2+
id("com.android.application") version "9.1.0" apply false
3+
id("com.android.library") version "9.1.0" apply false
4+
id("org.jetbrains.kotlin.plugin.compose") version "2.3.10" apply false
5+
id("com.vanniktech.maven.publish") version "0.30.0" apply false
6+
}
7+
8+
tasks.register<Delete>("clean") {
9+
delete(rootProject.layout.buildDirectory)
10+
}

driveappfolderviewer/build.gradle

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)