Skip to content

Commit

Permalink
Restructure ark-android repository: #55
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancoltech committed Feb 27, 2024
1 parent 2be7202 commit 7b1299a
Show file tree
Hide file tree
Showing 142 changed files with 1,059 additions and 64 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Build the components
on:
push:
branches: [ main ]
paths:
- 'filepicker/**'
pull_request:
branches: [ main ]
paths:
- 'filepicker/**'


jobs:
Expand All @@ -31,8 +35,8 @@ jobs:
echo "${{ secrets.KEYSTORE_ENCRYPTED }}" > keystore.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.asc > keystore.jks
- name: Build components
run: ./gradlew assembleRelease
- name: Build filepicker module
run: ./gradlew filepicker:assembleRelease

- name: Build release sample APK
run: ./gradlew sample:assembleRelease
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/build_utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build the components

on:
push:
branches: [ main ]
paths: ['./utils/**']
pull_request:
branches: [ main ]
paths: ['./utils/**']


jobs:
build:
if: ${{ ! startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Build utils module
run: ./gradlew utils:assembleRelease
28 changes: 28 additions & 0 deletions .github/workflows/release_utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release the components

on:
push:
tags:
- 'utils*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Validate Gradle wrapper
uses: gradle/[email protected]

- name: Publish components to Github
uses: gradle/gradle-build-action@v2
with:
arguments: utils:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 6 additions & 0 deletions filepicker/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
44 changes: 44 additions & 0 deletions filepicker/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build the components

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:
build:
if: ${{ ! startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/[email protected]


- name: Decrypt the keystore for signing
run: |
echo "${{ secrets.KEYSTORE_ENCRYPTED }}" > keystore.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.asc > keystore.jks
- name: Build components
run: ./gradlew filepicker:assembleRelease

- name: Build release sample APK
run: ./gradlew sample:assembleRelease

- name: Upload release APK
uses: actions/upload-artifact@v3
with:
name: release-universal-apk
path: ./sample/build/outputs/apk/release/sample-release.apk
File renamed without changes.
File renamed without changes.
100 changes: 100 additions & 0 deletions filepicker/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import java.net.URI

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
id("pl.allegro.tech.build.axion-release")
`maven-publish`
}

android {
namespace = "dev.arkbuilders.components.filepicker"
compileSdk = 34

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
viewBinding = true
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}

dependencies {
implementation(libraries.ark.component.utils)
implementation(libraries.ark.component.folderstree)
implementation(libraries.ark.component.tagselector)
implementation(libraries.ark.component.scorewidget)

implementation(libraries.androidx.core.ktx)
implementation(libraries.androidx.appcompat)
implementation(libraries.android.material)
testImplementation(libraries.junit)
androidTestImplementation(libraries.androidx.test.junit)
androidTestImplementation(libraries.androidx.test.espresso)

implementation(libraries.coil)
implementation(libraries.coil.gif)
implementation(libraries.coil.svg)
implementation(libraries.coil.video)

implementation(libraries.androidx.fragment.ktx)

implementation(libraries.fastadapter)
implementation(libraries.fastadapter.extensions.binding)
implementation(libraries.fastadapter.extensions.diff)
implementation(libraries.arklib)
implementation(libraries.orbit.mvi.viewmodel)
implementation(libraries.viewbinding.property.delegate)
}

val libVersion: String = scmVersion.version

publishing {
publications {
create<MavenPublication>("release") {
groupId = "dev.arkbuilders.components"
artifactId = "filepicker"
version = libVersion
afterEvaluate {
from(components["release"])
}
}
}
repositories {
mavenLocal()
maven {
name = "GithubPackages"
url = URI("https://maven.pkg.github.com/ARK-Builders/ark-components-android")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class ExampleInstrumentedTest {
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("dev.arkbuilders.scorewidget.test", appContext.packageName)
assertEquals("dev.arkbuilders.components.test", appContext.packageName)
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dev.arkbuilders.components.filepicker
import androidx.annotation.PluralsRes
import androidx.annotation.StringRes
import androidx.annotation.StyleRes
import dev.arkbuilders.components.R
import dev.arkbuilders.components.filepicker.R
import java.nio.file.Path

class ArkFilePickerConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ import com.mikepenz.fastadapter.binding.AbstractBindingItem
import dev.arkbuilders.arklib.utils.DeviceStorageUtils
import dev.arkbuilders.arklib.utils.INTERNAL_STORAGE
import org.orbitmvi.orbit.viewmodel.observe
import dev.arkbuilders.components.R
import dev.arkbuilders.components.databinding.ArkFilePickerDialogNewFolderBinding
import dev.arkbuilders.components.databinding.ArkFilePickerHostFragmentBinding
import dev.arkbuilders.components.databinding.ArkFilePickerItemFileBinding
import dev.arkbuilders.components.databinding.ArkFilePickerItemFilesRootsPageBinding
import dev.arkbuilders.components.filepicker.R
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerDialogNewFolderBinding
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerHostFragmentBinding
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerItemFileBinding
import dev.arkbuilders.components.filepicker.databinding.ArkFilePickerItemFilesRootsPageBinding
import dev.arkbuilders.components.filepicker.callback.OnFileItemLongClick
import dev.arkbuilders.components.folderstree.FolderTreeView
import dev.arkbuilders.components.utils.args
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import android.widget.PopupWindow
import android.widget.TextView
import androidx.core.content.res.ResourcesCompat
import dev.arkbuilders.arklib.utils.INTERNAL_STORAGE
import dev.arkbuilders.components.R
import dev.arkbuilders.components.filepicker.R
import dev.arkbuilders.components.utils.dpToPx
import java.nio.file.Path

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="resources_tags_selector_hint">Label some resources with tags to enable tags selector</string>
<string name="resources_filter_hint">Filter</string>
<string name="invert">Invert</string>
<string name="ark_file_picker_internal_storage">Internal</string>
<string name="ark_file_picker_cancel">Cancel</string>
<string name="ark_file_picker_pick">Pick</string>
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions folderstree/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
83 changes: 83 additions & 0 deletions folderstree/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import java.net.URI

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
`maven-publish`
}

android {
namespace = "dev.arkbuilders.components.folderstree"
compileSdk = 34

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
viewBinding = true
}
}

dependencies {

implementation(project(":utils"))

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("com.mikepenz:fastadapter:5.7.0")
implementation("com.mikepenz:fastadapter-extensions-binding:5.7.0")
implementation("com.mikepenz:fastadapter-extensions-diff:5.7.0")
implementation("com.github.skydoves:balloon:1.6.4")
implementation("dev.arkbuilders:arklib:0.3.5")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
}

val libVersion: String = /*scmVersion.version*/"0.0.9-SNAPSHOT-01"

publishing {
publications {
create<MavenPublication>("release") {
groupId = "dev.arkbuilders.components"
artifactId = "folderstree"
version = libVersion
afterEvaluate {
from(components["release"])
}
}
}
repositories {
maven {
name = "GithubPackages"
url = URI("https://maven.pkg.github.com/ARK-Builders/ark-components-android")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
mavenLocal()
}
}
Empty file added folderstree/consumer-rules.pro
Empty file.
Loading

0 comments on commit 7b1299a

Please sign in to comment.