Skip to content

Commit

Permalink
Update gradle to 8.0.2 (#4)
Browse files Browse the repository at this point in the history
* Update gradle to 8.0.2

* merge ci yml

* renaming
  • Loading branch information
andresmr authored Jul 25, 2023
1 parent f2a8ffc commit 5f3903f
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 98 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/generate_apk.yml

This file was deleted.

51 changes: 44 additions & 7 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# This is a basic workflow to help you get started with Actions
name: Continuous Integration

name: CI
env:
# The name of the main module repository
main_project_module: android

on:
push:
Expand All @@ -12,10 +14,8 @@ on:
workflow_dispatch:

jobs:
build:

ci_job:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

Expand All @@ -38,5 +38,42 @@ jobs:
run: ./gradlew test

# Run Build Project
# - name: Build gradle project
# run: ./gradlew build
- name: Build gradle project
run: ./gradlew build

testing_job:
runs-on: ubuntu-latest
needs: ci_job
if: github.event_name == 'pull_request' && needs.ci_job.result == 'success'
steps:
- uses: actions/checkout@v3

# Set Current Date As Env Variable
- name: Set current date as env variable
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV

# Set Repository Name As Env Variable
- name: Set repository name as env variable
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV

- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '17'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew

# Create APK Debug
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
run: ./gradlew assembleDebug

# Upload Artifact Build
# Noted For Output [main_project_module]/build/outputs/apk/debug/
- name: Upload APK Debug - ${{ env.repository_name }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) debug generated
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
21 changes: 7 additions & 14 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ plugins {
id("kotlin-kapt")
}

group = "org.hisp.dhis"
version = "1.0-SNAPSHOT"

dependencies {
implementation(project(":common"))
implementation("androidx.activity:activity-compose:1.7.2")
Expand All @@ -17,24 +14,20 @@ dependencies {
}

android {
compileSdk = 33
compileSdk = (findProperty("android.compileSdk") as String).toInt()
namespace = "org.hisp.dhis.android"

defaultConfig {
applicationId = "org.hisp.dhis.android"
minSdk = 24
targetSdk = 33
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
versionCode = 1
versionName = "1.0-SNAPSHOT"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
namespace = "org.hisp.dhis.android"
}

ktlint {
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ allprojects {

plugins {
kotlin("multiplatform") apply false
kotlin("android") apply false
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.compose") apply false
Expand Down
9 changes: 3 additions & 6 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ plugins {
id("org.jlleitschuh.gradle.ktlint")
}

group = "org.hisp.dhis"
version = "1.0-SNAPSHOT"

kotlin {
android()
jvm("desktop") {
Expand Down Expand Up @@ -48,11 +45,11 @@ kotlin {
}

android {
compileSdk = 33
compileSdk = (findProperty("android.compileSdk") as String).toInt()
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 33
minSdk = (findProperty("android.minSdk") as String).toInt()
targetSdk = (findProperty("android.targetSdk") as String).toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
Expand Down
4 changes: 0 additions & 4 deletions desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ plugins {
id("org.jetbrains.compose")
}

group = "org.hisp.dhis"
version = "1.0-SNAPSHOT"


kotlin {
jvm {
jvmToolchain(11)
Expand Down
27 changes: 23 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"

#Kotlin
kotlin.code.style=official

#MPP
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2

#Compose
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none

#Android
android.useAndroidX=true
kotlin.version=1.8.0
agp.version=7.4.1
compose.version=1.4.1
kotlin.mpp.androidSourceSetLayoutVersion=2
android.compileSdk=33
android.targetSdk=33
android.minSdk=24

#Versions
kotlin.version=1.8.20
agp.version=7.4.2
compose.version=1.4.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
27 changes: 18 additions & 9 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
rootProject.name = "mobile-ui"

include(":android")
include(":desktop")
include(":common")

pluginManagement {
repositories {
google()
Expand All @@ -7,14 +13,17 @@ pluginManagement {
}

plugins {
kotlin("multiplatform").version(extra["kotlin.version"] as String)
kotlin("android").version(extra["kotlin.version"] as String)
id("com.android.application").version(extra["agp.version"] as String)
id("com.android.library").version(extra["agp.version"] as String)
id("org.jetbrains.compose").version(extra["compose.version"] as String)
}
}
val kotlinVersion = extra["kotlin.version"] as String
val agpVersion = extra["agp.version"] as String
val composeVersion = extra["compose.version"] as String

rootProject.name = "mobile-ui"
kotlin("jvm").version(kotlinVersion)
kotlin("multiplatform").version(kotlinVersion)
kotlin("android").version(kotlinVersion)

id("com.android.application").version(agpVersion)
id("com.android.library").version(agpVersion)

include(":android", ":desktop", ":common")
id("org.jetbrains.compose").version(composeVersion)
}
}

0 comments on commit 5f3903f

Please sign in to comment.