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

Add libs.versions.toml version library #81

Merged
merged 27 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2950cc2
disable sign/publish & version up actions
TheronRogers Jul 27, 2023
4dbdb8d
jetbrains compose verion to beta
TheronRogers Jul 28, 2023
d51bbcc
update Android Gradle Plugin
TheronRogers Jul 28, 2023
b812ef1
remove deprecated android.disableAutomaticComponentCreation=true
TheronRogers Jul 28, 2023
9000fc9
use new way to set extras
TheronRogers Jul 28, 2023
deefaa9
centralize and update dependency versions
TheronRogers Jul 28, 2023
1cd80cd
update buildSrc dependencies
TheronRogers Jul 28, 2023
2f41ffb
get jvm 17 on ci
TheronRogers Jul 28, 2023
e0810d1
OptIn for ExperimentalForeignApi
TheronRogers Jul 28, 2023
bbff976
use androidTarget in kotlin block
TheronRogers Jul 28, 2023
dcdb798
add version library
TheronRogers Jul 28, 2023
d7a9865
add missing annotations for experimental and beta api
TheronRogers Jul 28, 2023
33e48db
fix js targets
TheronRogers Jul 28, 2023
115a190
reference version library
TheronRogers Jul 28, 2023
b2c03d8
spotlessApply
TheronRogers Jul 28, 2023
5d0255e
add BetaInteropApi annotations
TheronRogers Jul 29, 2023
966cb15
make assemble succeed
TheronRogers Jul 29, 2023
d9daa6b
remove window resize code broken by compose update
TheronRogers Jul 29, 2023
16a313e
speed up GitHub action CI
TheronRogers Jul 29, 2023
2a78ee6
add missing jsTest sources in molecule and viewmodel modules
TheronRogers Jul 31, 2023
e5e89e8
try building with zulu jdk which is the same as setup-java@v1 default
TheronRogers Aug 1, 2023
23422bc
GitHub actions improvements
TheronRogers Aug 1, 2023
f9300bb
update jetbrains compose version badge in readme
TheronRogers Aug 1, 2023
5e140fd
fix reference workflow to reuse
TheronRogers Aug 1, 2023
44ab981
fix upload artifact and require passing validate before build etc
TheronRogers Aug 1, 2023
1038a2c
Merge branch 'master' into update/build-action
TheronRogers Aug 1, 2023
62b2e7b
add missing java distribution in ci
TheronRogers Aug 1, 2023
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
36 changes: 21 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: CI
name: CI Assemble, Test, and Publish

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_call:

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Apply Signing
Expand All @@ -31,14 +27,24 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: ./.github/apply_signing.sh

- name: Build with Gradle
run: ./gradlew spotlessCheck lint assemble --stacktrace --no-daemon --no-parallel
- name: Assemble
run: ./gradlew assembleRelease --stacktrace

- name: Testing
run: ./gradlew test --no-daemon --no-parallel
run: ./gradlew testRelease --stacktrace

- name: Publishing
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew publish --no-daemon --no-parallel
- name: Upload Precompose Test Reports
uses: actions/upload-artifact@v3
with:
name: precompose-reports
path: "precompose/build/reports/tests"

- name: Upload Precompose ViewModel Test Reports
uses: actions/upload-artifact@v3
with:
name: precompose-viewmodel-reports
path: "precompose-viewmodel/build/reports/tests"

- name: Publishing
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew publish
51 changes: 51 additions & 0 deletions .github/workflows/static-validations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI Static Validations

on:
push:
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

jobs:
validate:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17

- name: Spotless Check
run: ./gradlew spotlessCheck --stacktrace

- name: Lint
run: ./gradlew lint --stacktrace

- name: Upload Precompose Lint Report
uses: actions/upload-artifact@v3
with:
name: precompose-lint-report
path: precompose/build/reports

- name: Upload Precompose Molecule Lint Report
uses: actions/upload-artifact@v3
with:
name: precompose-molecule-lint-report
path: precompose-molecule/build/reports

- name: Upload Precompose ViewModel Lint Report
uses: actions/upload-artifact@v3
with:
name: precompose-viewmodel-lint-report
path: precompose-viewmodel/build/reports

call-build:
needs: validate
uses: ./.github/workflows/build.yml
secrets: inherit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PreCompose
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/moe.tlaster/precompose/badge.svg)](https://maven-badges.herokuapp.com/maven-central/moe.tlaster/precompose)
[![compose-jb-version](https://img.shields.io/badge/compose--jb-1.4.0-blue)](https://github.com/JetBrains/compose-jb)
[![compose-jb-version](https://img.shields.io/badge/compose--jb-1.5.0--beta01-blue)](https://github.com/JetBrains/compose-jb)
![license](https://img.shields.io/github/license/Tlaster/PreCompose)

![badge-Android](https://img.shields.io/badge/Platform-Android-brightgreen)
Expand Down
32 changes: 25 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
plugins {
id("com.android.application").apply(false)
id("com.android.library").apply(false)
kotlin("android").apply(false)
id("com.diffplug.spotless").version(Versions.spotless)
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.spotless)
}

allprojects {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = Versions.Java.jvmTarget
jvmTarget = rootProject.extra.get("jvmTarget") as String
allWarningsAsErrors = true
freeCompilerArgs = listOf(
"-opt-in=kotlin.RequiresOptIn",
Expand All @@ -20,15 +20,33 @@ allprojects {
kotlin {
target("**/*.kt")
targetExclude("$buildDir/**/*.kt", "bin/**/*.kt", "buildSrc/**/*.kt")
ktlint(Versions.ktlint)
ktlint(rootProject.extra.get("ktlintVersion") as String)
}
kotlinGradle {
target("*.gradle.kts")
ktlint(Versions.ktlint)
ktlint(rootProject.extra.get("ktlintVersion") as String)
}
java {
target("**/*.java")
targetExclude("$buildDir/**/*.java", "bin/**/*.java")
}
}
}

extra.apply {
set("precomposeVersion", "1.4.4")

set("jvmTarget", "17")

// Android configurations
set("android-compile", 33)
set("android-build-tools", "34.0.0")
set("androidMinSdk", 21)
set("androidTargetSdk", 33)

// Js & Node
set("webpackCliVersion", "5.1.4")
set("nodeVersion", "16.13.0")

set("ktlintVersion", "0.42.1")
}
1 change: 0 additions & 1 deletion buildSrc/.gitignore

This file was deleted.

13 changes: 0 additions & 13 deletions buildSrc/build.gradle.kts

This file was deleted.

31 changes: 0 additions & 31 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ kotlin.native.cacheKind=none
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
android.disableAutomaticComponentCreation=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.androidSourceSetLayoutVersion=2
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
45 changes: 45 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[versions] # also check project root build.gradle.kts for versions
androidx-animation = "1.5.0-beta03"
androidx-foundation = "1.5.0-beta03"
androidx-appcompat = "1.6.1"
androidx-coreKtx = "1.10.1"
androidxActivityVer = "1.7.2"
androidGradlePlugin = "8.1.0"
junit = "4.13.2"
junitJupiterEngine = "5.8.2"
junitJupiterApi = "5.8.2"
kotlin = "1.9.0"
kotlinxCoroutinesCore = "1.7.3"
lifecycleRuntimeKtx = "2.6.1"
material = "1.5.0-beta03"
moleculeRuntime = "0.9.0"
savedstateKtx = "1.2.1"
spotless = "6.7.0"
jetbrainsComposePlugin = "1.5.0-beta01"
skiko = "0.7.72"

[libraries]
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "androidxActivityVer" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appcompat" }
androidx-coreKtx = { module = "androidx.core:core-ktx", version.ref = "androidx-coreKtx" }
androidx-lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-material = { module = "androidx.compose.material:material", version.ref = "material" }
androidx-savedstate-ktx = { module = "androidx.savedstate:savedstate-ktx", version.ref = "savedstateKtx" }
animation = { module = "androidx.compose.animation:animation", version.ref = "androidx-animation" }
foundation = { module = "androidx.compose.foundation:foundation", version.ref = "androidx-foundation" }
junit = { module = "junit:junit", version.ref = "junit" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junitJupiterEngine" }
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junitJupiterApi" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" }
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "kotlinxCoroutinesCore" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutinesCore" }
molecule-runtime = { module = "app.cash.molecule:molecule-runtime", version.ref = "moleculeRuntime" }
skiko = { module = "org.jetbrains.skiko:skiko", version.ref = "skiko" }
skiko-js = { module = "org.jetbrains.skiko:skiko-js-wasm-runtime", version.ref = "skiko" }

[plugins]
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrainsComposePlugin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
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.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading