Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better release #382

Merged
merged 15 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/version_information/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Generate version information"
description: "Generate version information and expose using outputs"

outputs:
mobile-version-code:
description: "Version code of application"
value: ${{ steps.mobile_version_code.outputs.mobile_version_code }}

mobile-version-name:
description: "Version name of application"
value: ${{ steps.mobile_version_name.outputs.mobile_version_name }}

runs:
using: "composite"
steps:
- name: "Generate versions"
id: version_code
run: ./scripts/generate_versions.sh
shell: bash

- name: "Get mobile version code"
id: mobile_version_code
run: echo "mobile_version_code=$(grep 'V_VERSION_CODE=' versions.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
shell: bash

- name: "Get mobile version name"
id: mobile_version_name
run: echo "mobile_version_name=$(grep 'V_VERSION=' versions.properties | cut -d'=' -f2)" >> $GITHUB_OUTPUT
shell: bash
6 changes: 5 additions & 1 deletion .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -28,6 +28,10 @@ jobs:
echo "${{ secrets.SERVICE_ACCOUNT }}" > service_account.json.asc
gpg -d --passphrase "${{ secrets.GPG_ENCRYPTION_KEY }}" --batch service_account.json.asc > service_account.json

- name: "Calculate build number"
id: version_information
uses: ./.github/actions/version_information

- name: Check out java
uses: actions/setup-java@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/core-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flow-noop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flow-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prefs-noop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prefs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -30,8 +30,23 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Checks
run: ./gradlew check :toggles-core:check :toggles-flow:check :toggles-flow-noop:check :toggles-prefs:check :toggles-prefs-noop:check
- name: Run app Checks
run: ./gradlew check

- name: Run core Checks
run: ./gradlew :toggles-core:check

- name: Run flow Checks
run: ./gradlew :toggles-flow:check --no-configuration-cache

- name: Run flow noop Checks
run: ./gradlew :toggles-flow-noop:check

- name: Run prefs Checks
run: ./gradlew :toggles-prefs:check --no-configuration-cache

- name: Run prefs noop Checks
run: ./gradlew :toggles-prefs-noop:check

- name: Upload reports
uses: actions/upload-artifact@v3
Expand Down
3 changes: 2 additions & 1 deletion build-logic/conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ java {

dependencies {
// implementation("gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.2")
implementation("se.premex:ownership-gradle-plugin:0.0.7")
implementation("se.premex:ownership-gradle-plugin:0.0.11")
implementation(libs.io.gitlab.arturbosch.detekt.detekt.gradle.plugin)
implementation(libs.com.android.tools.build.gradle)
implementation(libs.org.jetbrains.kotlin.kotlin.gradle.plugin)
implementation("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.9.10-1.0.13")

// https://github.com/gradle/gradle/issues/15383
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.kotlin.dsl.kotlin

Expand All @@ -6,19 +7,10 @@ val libs = the<LibrariesForLibs>()
plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
id("kotlin-android")
id("toggles.detekt-conventions")
}

kapt {
javacOptions {
// Increase the max count of errors from annotation processors.
// Default is 100.
option("-Xmaxerrs", 500)
}
}

android {
compileSdk = 34

Expand All @@ -37,6 +29,7 @@ android {
kotlinCompilerExtensionVersion = libs.versions.androidx.compose.compiler.get()
}

@Suppress("UnstableApiUsage")
testOptions {
unitTests.isIncludeAndroidResources = true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
}
}

java {
toolchain {
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(JavaVersion.VERSION_17.toString()))
vendor.set(JvmVendorSpec.AZUL)
}
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ plugins {
// https://github.com/Kotlin/KEEP/blob/master/proposals/explicit-api-mode.md
alias(libs.plugins.com.github.triplet.play) apply (false)
id("toggles.ownership-conventions")
alias(libs.plugins.com.google.devtools.ksp) apply false
alias(libs.plugins.com.autonomousapps.dependency.analysis)
}

fun isNonStable(version: String): Boolean {
Expand Down
1 change: 1 addition & 0 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
naming:
FunctionNaming:
ignoreAnnotated: ['Composable']

5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ android.enableJetifier=false

#kotlin.caching.enabled=true # default false
#kotlin.incremental.usePreciseJavaTracking=true #default false
#kapt.use.worker.api=true
#kapt.include.compile.classpath=false
#kapt.incremental.apt=true
#kotlin.parallel.tasks.in.project=true

org.gradle.caching=true
org.gradle.configuration-cache=false
org.gradle.configuration-cache=true
org.gradle.configuration-cache.max-problems=5
70 changes: 31 additions & 39 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ androidx-activity = "1.7.2"
androidx-appcompat = "1.6.1"
androidx-arch-core = "2.2.0"
androidx-collection = "1.1.0"
androidx-compose-bom = "2023.08.00"
androidx-compose-compiler = "1.5.1"
androidx-compose-bom = "2023.10.01"
androidx-compose-compiler = "1.5.5"
androidx-core = "1.9.0"
androidx-hilt = "1.0.0"
androidx-legacy = "1.0.0"
Expand All @@ -13,12 +13,18 @@ androidx-room = "2.6.0-alpha03"
androidx-savedstate = "1.2.1"
androidx-test = "1.5.0"
androidx-vectordrawable = "1.1.0"
com-google-dagger = "2.47"
com-google-dagger = "2.48"
com-squareup-leakcanary = "2.8.1"
com-squareup-moshi = "1.15.0"
dokka = "1.8.20"
kotlin = "1.9.0"
org-jetbrains-kotlinx = "1.7.1"
dokka = "1.9.0"
kotlin = "1.9.20"
org-jetbrains-kotlinx = "1.7.3"
agp = "8.1.2"
org-jetbrains-kotlin-android = "1.9.20"
junit = "4.13.2"
androidx-test-ext-junit = "1.1.5"
espresso-core = "3.5.1"
material = "1.9.20"

[libraries]
androidx-activity = { module = "androidx.activity:activity", version.ref = "androidx-activity" }
Expand Down Expand Up @@ -53,6 +59,7 @@ androidx-compose-ui-ui-tooling-data = { module = "androidx.compose.ui:ui-tooling
androidx-compose-ui-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
androidx-compose-ui-ui-unit = { module = "androidx.compose.ui:ui-unit" }
androidx-compose-ui-ui-util = { module = "androidx.compose.ui:ui-util" }
androidx-compose-ui-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4" }
androidx-concurrent-concurrent-futures = "androidx.concurrent:concurrent-futures:1.1.0"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4"
androidx-core = { module = "androidx.core:core", version.ref = "androidx-core" }
Expand Down Expand Up @@ -111,7 +118,7 @@ androidx-vectordrawable-vectordrawable-animated = { module = "androidx.vectordra
androidx-versionedparcelable = "androidx.versionedparcelable:versionedparcelable:1.1.1"
androidx-viewpager = "androidx.viewpager:viewpager:1.0.0"
app-cash-licensee-licensee-gradle-plugin = "app.cash.licensee:licensee-gradle-plugin:1.7.0"
com-android-tools-build-gradle = "com.android.tools.build:gradle:8.1.0"
com-android-tools-build-gradle = "com.android.tools.build:gradle:8.2.0"
com-google-android-datatransport-transport-api = "com.google.android.datatransport:transport-api:3.0.0"
com-google-android-gms-play-services-ads-identifier = "com.google.android.gms:play-services-ads-identifier:18.0.0"
com-google-android-gms-play-services-basement = "com.google.android.gms:play-services-basement:18.1.0"
Expand All @@ -131,62 +138,47 @@ com-google-firebase-firebase-bom = "com.google.firebase:firebase-bom:32.2.2"
com-google-firebase-firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }
com-google-firebase-firebase-crashlytics-gradle = "com.google.firebase:firebase-crashlytics-gradle:2.9.8"
com-google-firebase-firebase-crashlytics-ktx = { module = "com.google.firebase:firebase-crashlytics-ktx" }
com-google-firebase-firebase-encoders = "com.google.firebase:firebase-encoders:17.0.0"
com-google-firebase-firebase-encoders-json = "com.google.firebase:firebase-encoders-json:18.0.0"
com-google-firebase-firebase-encoders-proto = "com.google.firebase:firebase-encoders-proto:16.0.0"
com-google-firebase-firebase-measurement-connector = "com.google.firebase:firebase-measurement-connector:19.0.0"
com-google-gms-google-services = "com.google.gms:google-services:4.3.15"
com-slack-lint-compose-compose-lint-checks = "com.slack.lint.compose:compose-lint-checks:1.2.0"
com-squareup-curtains = "com.squareup.curtains:curtains:1.2.3"
com-squareup-leakcanary-leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-android-core = { module = "com.squareup.leakcanary:leakcanary-android-core", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-android-utils = { module = "com.squareup.leakcanary:leakcanary-android-utils", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-object-watcher = { module = "com.squareup.leakcanary:leakcanary-object-watcher", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-object-watcher-android = { module = "com.squareup.leakcanary:leakcanary-object-watcher-android", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-object-watcher-android-androidx = { module = "com.squareup.leakcanary:leakcanary-object-watcher-android-androidx", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-object-watcher-android-core = { module = "com.squareup.leakcanary:leakcanary-object-watcher-android-core", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-leakcanary-object-watcher-android-support-fragments = { module = "com.squareup.leakcanary:leakcanary-object-watcher-android-support-fragments", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-plumber-android = { module = "com.squareup.leakcanary:plumber-android", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-plumber-android-core = { module = "com.squareup.leakcanary:plumber-android-core", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-shark = { module = "com.squareup.leakcanary:shark", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-shark-android = { module = "com.squareup.leakcanary:shark-android", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-shark-graph = { module = "com.squareup.leakcanary:shark-graph", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-shark-hprof = { module = "com.squareup.leakcanary:shark-hprof", version.ref = "com-squareup-leakcanary" }
com-squareup-leakcanary-shark-log = { module = "com.squareup.leakcanary:shark-log", version.ref = "com-squareup-leakcanary" }
com-squareup-moshi = { module = "com.squareup.moshi:moshi", version.ref = "com-squareup-moshi" }
com-squareup-moshi-moshi-kotlin-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "com-squareup-moshi" }
com-squareup-okio = "com.squareup.okio:okio:3.5.0"
io-gitlab-arturbosch-detekt-detekt-gradle-plugin = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.1"
io-gitlab-arturbosch-detekt-detekt-formatting = "io.gitlab.arturbosch.detekt:detekt-formatting:1.23.1"
io-gitlab-arturbosch-detekt-detekt-rules-libraries = "io.gitlab.arturbosch.detekt:detekt-rules-libraries:1.23.1"
javax-inject-javax-inject = "javax.inject:javax.inject:1"
junit = "junit:junit:4.13.2"
org-apache-logging-log4j-log4j-core = "org.apache.logging.log4j:log4j-core:2.17.1"
org-jetbrains-annotations = "org.jetbrains:annotations:23.0.0"
junit = { module = "junit:junit", version.ref = "junit" }
org-jetbrains-dokka-dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
org-jetbrains-kotlin-kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
org-jetbrains-kotlin-kotlin-parcelize-runtime = { module = "org.jetbrains.kotlin:kotlin-parcelize-runtime", version.ref = "kotlin" }
org-jetbrains-kotlin-kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
org-jetbrains-kotlin-kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
org-jetbrains-kotlinx-kotlinx-collections-immutable = "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5"
org-jetbrains-kotlinx-kotlinx-coroutines-android = "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
org-jetbrains-kotlinx-kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android" }
org-jetbrains-kotlinx-kotlinx-coroutines-bom = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-bom", version.ref = "org-jetbrains-kotlinx" }
org-jetbrains-kotlinx-kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "org-jetbrains-kotlinx" }
org-jetbrains-kotlinx-kotlinx-coroutines-core-jvm = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm", version.ref = "org-jetbrains-kotlinx" }
org-jetbrains-kotlinx-kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test" }
org-robolectric = "org.robolectric:robolectric:4.10.3"
se-eelde-toggles-toggles-core = "se.eelde.toggles:toggles-core:0.0.2"
se-eelde-toggles-toggles-flow = "se.eelde.toggles:toggles-flow:0.0.1"
se-eelde-toggles-toggles-prefs = "se.eelde.toggles:toggles-prefs:0.0.1"
se-eelde-toggles-toggles-core = { module = "se.eelde.toggles:toggles-core" }
se-eelde-toggles-toggles-flow = { module = "se.eelde.toggles:toggles-flow" }
se-eelde-toggles-toggles-prefs = { module = "se.eelde.toggles:toggles-prefs" }
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
#se-eelde-toggles-toggles-core = "se.eelde.toggles:toggles-core:0.0.2"
#se-eelde-toggles-toggles-flow = "se.eelde.toggles:toggles-flow:0.0.1"
#se-eelde-toggles-toggles-prefs = "se.eelde.toggles:toggles-prefs:0.0.1"

[plugins]
com-autonomousapps-dependency-analysis = { id = "com.autonomousapps.dependency-analysis", version = "1.26.0" }
com-github-ben-manes-versions = "com.github.ben-manes.versions:0.47.0"
com-github-triplet-play = "com.github.triplet.play:3.8.4"
com-gladed-androidgitversion = "com.gladed.androidgitversion:0.4.14"
com-google-dagger-hilt-android = "com.google.dagger.hilt.android:2.47"
com-google-devtools-ksp = { id = "com.google.devtools.ksp", version = "1.9.20-1.0.14" }
com-google-dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "com-google-dagger" }
com-google-firebase-crashlytics = "com.google.firebase.crashlytics:2.9.8"
com-google-gms-google-services = "com.google.gms.google-services:4.3.15"
com-vanniktech-maven-publish = "com.vanniktech.maven.publish:0.25.3"
dagger-hilt-android-plugin = "dagger.hilt.android.plugin:2.47"
dagger-hilt-android-plugin = { id = "dagger.hilt.android.plugin:2.48", version.ref = "com-google-dagger" }
nl-littlerobots-version-catalog-update = "nl.littlerobots.version-catalog-update:0.8.1"
org-jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
org-jetbrains-kotlinx-binary-compatibility-validator = "org.jetbrains.kotlinx.binary-compatibility-validator:0.13.2"
com-android-library = { id = "com.android.library", version.ref = "agp" }
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "org-jetbrains-kotlin-android" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading