Skip to content

Commit

Permalink
Merge pull request #7 from UbiqueInnovation/feature/depedency-update
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
M-Wong authored Oct 9, 2024
2 parents cb2a5cf + 81ef39b commit c5f28cc
Show file tree
Hide file tree
Showing 25 changed files with 268 additions and 197 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/alpaka_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and upload to Alpaka

on: [ push, workflow_dispatch ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
fail-fast: false
max-parallel: 4
matrix:
flavor: [ 'prod' ]
uses: UbiqueInnovation/actions-android/.github/workflows/[email protected]
with:
flavor: '${{ matrix.flavor }}'
appModule: 'example'
concurrencyGroup: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.flavor }}
runs-on: '["ubuntu-latest"]'
secrets:
ANDROID_JENKINS_PAT: ${{ secrets.GITHUB_TOKEN }}
UB_ARTIFACTORY_URL_ANDROID: ${{ secrets.UB_ARTIFACTORY_URL_ANDROID }}
UB_ARTIFACTORY_USER: ${{ secrets.UB_ARTIFACTORY_USER }}
UB_ARTIFACTORY_PASSWORD: ${{ secrets.UB_ARTIFACTORY_PASSWORD }}
ALPAKA_UPLOAD_KEY: ${{ secrets.ALPAKA_UPLOAD_KEY }}
ADDITIONAL_GRADLE_PROPS: "-PstorePassword=${{ secrets.KEYSTORE_PASSWORD }} -PkeyAlias=${{ secrets.KEY_ALIAS }} -PkeyPassword=${{ secrets.KEY_PASSWORD }}"
39 changes: 0 additions & 39 deletions .github/workflows/maven-central-dev.yml

This file was deleted.

28 changes: 15 additions & 13 deletions .github/workflows/maven-central-tags.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
name: Publish release artifacts to Maven Central
name: Publish tagged artifacts to Maven Central

on:
push:
tags:
- 'v*'
- 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
name: "Publish release artifacts to Maven Central"
name: "Publish tagged artifacts to Maven Central"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v4.2.1
- name: set up JDK 17
uses: actions/setup-java@v4.4.0
with:
java-version: 11
distribution: 'zulu'
java-version: '17'
- name: Publish artifact
env:
SIGNING_KEY_ARMOR: ${{ secrets.MAVEN_SIGNING_KEY_ARMOR_BASE64 }}
SIGNING_KEY_ID: ${{ secrets.MAVEN_SIGNING_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.MAVEN_SIGNING_KEY_PASSPHRASE }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
echo "Create .gpg key from secret"
echo $SIGNING_KEY_ARMOR | base64 --decode > ./signingkey.asc
gpg --quiet --output $GITHUB_WORKSPACE/signingkey.gpg --dearmor ./signingkey.asc
./gradlew publish -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID -PmavenCentralUsername=$MAVEN_CENTRAL_USERNAME -PmavenCentralPassword=$MAVEN_CENTRAL_PASSWORD
./gradlew publish -Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/signingkey.gpg -Psigning.password=$SIGNING_KEY_PASSWORD -Psigning.keyId=$SIGNING_KEY_ID -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD
- name: Close and release Sonatype repository
if: ${{ success() }}
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
run: ./gradlew closeAndReleaseRepository -PmavenCentralUsername=$MAVEN_CENTRAL_USERNAME -PmavenCentralPassword=$MAVEN_CENTRAL_PASSWORD
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./gradlew closeAndReleaseRepository -PossrhUsername=$OSSRH_USERNAME -PossrhPassword=$OSSRH_PASSWORD
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,6 @@ captures/
*~
*.swp

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
# google-services.json

Expand Down
9 changes: 6 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
alias libs.plugins.android.application apply false
alias libs.plugins.android.library apply false
alias libs.plugins.kotlinAndroid apply false
alias libs.plugins.mavenPublish apply false
alias libs.plugins.ubique.alpaka apply false
alias libs.plugins.ubique.preset apply false
}

task clean(type: Delete) {
Expand Down
73 changes: 40 additions & 33 deletions example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,66 +1,73 @@
import ch.ubique.gradle.preset.utils.PropertyUtilsKt

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
alias libs.plugins.android.application
alias libs.plugins.kotlinAndroid
alias libs.plugins.compose.compiler
alias libs.plugins.ubique.alpaka
alias libs.plugins.ubique.preset
}

android {
compileSdk 31
namespace "ch.ubique.qrscanner.example"
compileSdk 34

defaultConfig {
applicationId "ch.ubique.qrscanner.example"
minSdk 23
targetSdk 31
targetSdk 34
versionCode 1
versionName "1.0"
versionName "1.0.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

alpakaUploadKey = System.getenv("ALPAKA_UPLOAD_KEY") ?: ""
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
productFlavors {
prod {
// Required for the Alpaka upload
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
signingConfigs {
ubique {
storeFile file("keystore.jks")
storePassword System.getenv("KEYSTORE_PASSWORD") ?: PropertyUtilsKt.readProperty(project, "storePassword")
keyAlias System.getenv("KEY_ALIAS") ?: PropertyUtilsKt.readProperty(project, "keyAlias")
keyPassword System.getenv("KEY_PASSWORD") ?: PropertyUtilsKt.readProperty(project, "keyPassword")
}
}

kotlinOptions {
jvmTarget = '1.8'
buildTypes {
release {
signingConfig = signingConfigs.ubique
}
}

buildFeatures {
viewBinding true
compose true
}

composeOptions {
kotlinCompilerExtensionVersion '1.1.0'
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

implementation project(':qrscanner-zxing')
implementation project(':qrscanner-mlkit')
implementation project(':qrscanner-compose')

def compose_version = '1.1.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation "androidx.compose.ui:ui-unit:$compose_version"
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation libs.core.ktx
implementation libs.material
implementation libs.androidx.constraintlayout

implementation platform(libs.compose.bom)
implementation libs.compose.ui
implementation libs.compose.ui.tooling
implementation libs.compose.ui.unit
implementation libs.compose.foundation
implementation libs.compose.material

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
testImplementation libs.junit
androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.espresso.core
}
Binary file added example/keystore.jks
Binary file not shown.
4 changes: 2 additions & 2 deletions example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:theme="@style/Theme.QRScanner">
<activity
android:name=".ViewActivity"
android:label="XML"
android:label="UB Scanner XML"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -33,7 +33,7 @@
</activity>
<activity
android:name=".ComposeActivity"
android:label="Compose"
android:label="UB Scanner Compose"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Binary file added example/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.enableR8.fullMode=false

###########################
# Library wide POM metadata
Expand Down
52 changes: 52 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[versions]
agp = "8.7.0"
androidx-camera = "1.3.4"
androidx-core = "1.13.1"
androidx-fragment = "1.8.4"
androidx-test-ext-junit = "1.2.1"
compose = "2024.09.03"
constraintlayout = "2.1.4"
espresso-core = "3.6.1"
junit = "4.13.2"
kotlin = "2.0.20"
kotlinx-coroutines = "1.9.0"
material = "1.12.0"
maven-publish = "0.27.0"
mlkit = "17.3.0"
ubique-alpaka = "8.7.0"
ubique-preset = "8.7.0"
zxing = "3.5.3"

[bundles]

[libraries]
androidx-camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "androidx-camera" }
androidx-camera-view = { module = "androidx.camera:camera-view", version.ref = "androidx-camera" }
androidx-camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "androidx-camera" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-fragmentKtx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
compose-ui-unit = { group = "androidx.compose.ui", name = "ui-unit" }
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
compose-material = { group = "androidx.compose.material", name = "material" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidx-core" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
junit = { group = "junit", name = "junit", version.ref = "junit" }
kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
mlkit-barcode = { module = "com.google.mlkit:barcode-scanning", version.ref = "mlkit" }
zxing-core = { module = "com.google.zxing:core", version.ref = "zxing" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
ubique-alpaka = { id = "ch.ubique.gradle.alpaka", version.ref = "ubique-alpaka" }
ubique-preset = { id = "ch.ubique.gradle.preset", version.ref = "ubique-preset" }


6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 14 13:55:22 CET 2022
#Tue Oct 08 13:27:36 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c5f28cc

Please sign in to comment.