Skip to content

Commit

Permalink
Modernize build
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker committed Mar 6, 2024
1 parent 041b8b3 commit 1c7dcf2
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 161 deletions.
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: "🪲 Bug Fixes"
labels:
- bug
- title: "✨ New Features"
labels:
- enhancement
- title: "📄 Other Changes"
labels:
- "*"
85 changes: 73 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,97 @@
name: CI

on: push

jobs:
build:
gradle-build:
name: 🏗️ Gradle build
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v4
- name: 🧰 Install JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle
- name: 🏗️ Build with Gradle
run: ./gradlew build
gradle-lint:
name: 🧪 Gradle LINT
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v4
- name: 🧰 Install JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle
- name: 🧪 Lint with Gradle
run: ./gradlew lint
gradle-test:
name: 🧪 Gradle test
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v4
- name: 🧰 Install JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle
- name: 🧪 Test with Gradle
run: ./gradlew test
gradle-integration-test:
name: 🧪 Gradle integration test
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v4
- name: 🧰 Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: 🧰 Install JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: gradle
- name: 🧰 Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: 🧰 Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.6
with:
acceptLicense: yes
- name: 🏗 Build
run: ./gradlew assembleDebug
- name: 🧪 Android LINT
run: ./gradlew lint
- name: 🧪 Unit test
run: ./gradlew test
- name: 🧪 Integration test
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.6
with:
cmd: ./gradlew connectedAndroidTest
api: 25
tag: google_apis
abi: x86
github-release:
name: 🚀 Create GitHub release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- gradle-build
- gradle-lint
- gradle-test
- gradle-integration-test
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v3
- name: 🚀 Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ github.ref_name }}
fail_on_unmatched_files: true
draft: false
prerelease: false
generate_release_notes: true
43 changes: 0 additions & 43 deletions .github/workflows/release.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
Binary file removed app/app-release.apk
Binary file not shown.
46 changes: 0 additions & 46 deletions app/build.gradle

This file was deleted.

46 changes: 46 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
plugins {
id("com.android.application")
id("com.google.gms.google-services")
id("com.palantir.git-version")
}

android {
namespace = "com.heinrichreimersoftware.materialintro.demo"

compileSdk = 29

defaultConfig {
applicationId = "com.heinrichreimersoftware.materialintro.demo"
minSdk = 15
targetSdk = 29
versionCode = 20000
versionName = gitVersion()
}

lintOptions {
abortOnError = false
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
}

dataBinding {
enabled = true
}
}

dependencies {
implementation(project(":library"))
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("com.google.android.material:material:1.0.0")
implementation("com.google.firebase:firebase-core:16.0.6")
implementation("com.google.firebase:firebase-crash:16.2.1")
}
26 changes: 0 additions & 26 deletions build.gradle

This file was deleted.

6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
plugins {
id("com.android.application") version "8.3.0" apply false
id("com.android.library") version "8.3.0" apply false
id("com.google.gms.google-services") version "4.4.1" apply false
id("com.palantir.git-version") version "3.0.0" apply false
}
33 changes: 0 additions & 33 deletions library/build.gradle

This file was deleted.

36 changes: 36 additions & 0 deletions library/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id("com.android.library")
id("com.palantir.git-version")
}

android {
namespace = "com.heinrichreimersoftware.materialintro"

compileSdk = 29

defaultConfig {
minSdk = 15
targetSdk = 29
versionCode = 20000
versionName = gitVersion()
}

lintOptions {
abortOnError = false
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
"proguard-rules.pro"
)
}
}
}

dependencies {
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
}
1 change: 0 additions & 1 deletion settings.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}


rootProject.name = "material-intro"

include(":app")
include(":library")

0 comments on commit 1c7dcf2

Please sign in to comment.