Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ISSUE#97-improve-reader-class
Browse files Browse the repository at this point in the history
  • Loading branch information
Irineu333 authored Nov 29, 2023
2 parents f60d1c1 + a54a3c4 commit 9c9774b
Show file tree
Hide file tree
Showing 6 changed files with 3,156 additions and 14 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build application

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
cache: gradle
- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Upload results
uses: actions/upload-artifact@v3
with:
name: SpeakTouch-APKs
path: |
app/build/outputs/apk/debug/SpeakTouch-debug.apk
app/build/outputs/apk/release/SpeakTouch-release-unsigned.apk
34 changes: 26 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ plugins {
alias(libs.plugins.dagger)
}

val keystorePropertiesFile = rootProject.file("keystore.properties")

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
Expand All @@ -43,13 +45,15 @@ android {
compileSdk = 34
buildToolsVersion = "34.0.0"

signingConfigs {
create("release") {
properties(name = "keystore.properties") { properties ->
storeFile = rootProject.file(properties.getProperty("storeFile"))
storePassword = properties.getProperty("storePassword")
keyAlias = properties.getProperty("keyAlias")
keyPassword = properties.getProperty("keyPassword")
if (keystorePropertiesFile.canRead()) {
signingConfigs {
create("release") {
properties(keystorePropertiesFile) { properties ->
storeFile = rootProject.file(properties.getProperty("storeFile"))
storePassword = properties.getProperty("storePassword")
keyAlias = properties.getProperty("keyAlias")
keyPassword = properties.getProperty("keyPassword")
}
}
}
}
Expand All @@ -75,7 +79,9 @@ android {
release {
isMinifyEnabled = false

signingConfig = signingConfigs.getByName("release")
if (keystorePropertiesFile.canRead()) {
signingConfig = signingConfigs.getByName("release")
}
}

debug {
Expand All @@ -87,6 +93,18 @@ android {
}
}

applicationVariants.all {
val variant = this
variant.outputs
.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
.forEach { output ->
output.outputFileName = "${rootProject.name}-${buildType.name}.apk"
if (buildType.name == "release" && variant.signingConfig == null) {
output.outputFileName = "${rootProject.name}-${buildType.name}-unsigned.apk"
}
}
}

buildFeatures {
buildConfig = true
}
Expand Down
5 changes: 2 additions & 3 deletions buildSrc/src/main/kotlin/Project.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@

import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import org.gradle.api.Project
import java.io.File
import java.io.FileInputStream
import java.util.Properties

fun Project.properties(
name: String,
file: File,
onSuccess: (Properties) -> Unit
) {
val file = rootProject.file(name)

if (file.exists()) {
onSuccess(
Properties().apply {
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[versions]
agp = "8.1.3"
agp = "8.1.4"
androidx-appcompat = "1.6.1"
androidx-constraintlayout = "2.1.4"
androidx-core = "1.12.0"
androidx-test-espresso = "3.5.1"
androidx-test-junit = "1.1.5"
dagger = "2.48.1"
javapoet = "1.13.0"
kotlin = "1.9.20"
ksp = "1.9.20-1.0.14"
kotlin = "1.9.21"
ksp = "1.9.21-1.0.15"
material = "1.10.0"
test-junit = "4.13.2"
timber = "5.0.1"
Expand Down
Loading

0 comments on commit 9c9774b

Please sign in to comment.