Skip to content

Commit

Permalink
Merge pull request #23 from respawn-app/1.5.0
Browse files Browse the repository at this point in the history
1.5.0
  • Loading branch information
Nek-12 authored Jan 5, 2025
2 parents 571210b + f92abf9 commit 1e8b96e
Show file tree
Hide file tree
Showing 35 changed files with 272 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/changelog_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"label_extractor" : [
{
"pattern" : "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"pattern" : "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test|feat!|breaking|api){1}(\\([\\w\\-\\.]+\\))?(!)?: ([\\w ])+([\\s\\S]*)",
"target" : "$1"
}
]
Expand Down
33 changes: 25 additions & 8 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
org.gradle.jvmargs=-Xmx3g -Xms1g -XX:+UseParallelGC -XX:+UseStringDeduplication -Dfile.encoding=UTF-8
kotlin.daemon.jvmargs=-Xmx3g -Xms1g -XX:+UseParallelGC -XX:+UseStringDeduplication -XX:MaxMetaspaceSize=1g
# suppress inspection "UnusedProperty" for whole file
org.gradle.jvmargs=-Xmx6g -Xms1g -XX:+UseParallelGC -XX:+UseStringDeduplication -Dfile.encoding=UTF-8
kotlin.daemon.jvmargs=-Xmx6g -Xms1g -XX:+UseParallelGC -XX:+UseStringDeduplication -XX:MaxMetaspaceSize=2g
android.useAndroidX=true
kotlin.code.style=official
org.gradle.caching=true
Expand All @@ -8,21 +9,37 @@ android.enableR8.fullMode=true
org.gradle.configureondemand=true
android.enableJetifier=false
kotlin.incremental.usePreciseJavaTracking=true
org.gradle.configuration-cache.problems=warn
android.nonTransitiveRClass=true
android.experimental.enableSourceSetPathsMap=true
android.experimental.cacheCompileLibResources=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
org.gradle.unsafe.configuration-cache=true
kotlin.mpp.androidSourceSetLayoutVersion=2
android.disableResourceValidation=false
org.gradle.daemon=true
org.gradle.daemon=false
android.nonFinalResIds=true
kotlin.native.ignoreIncorrectDependencies=true
kotlinx.atomicfu.enableJvmIrTransformation=true
org.jetbrains.compose.experimental.macos.enabled=true
org.gradle.configuration-cache.problems=warn
android.lint.useK2Uast=true
nl.littlerobots.vcu.resolver=true
org.gradle.console=plain
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.wasm.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
# Do not garbage collect on timeout on native when appExtensions are used and app is in bacground
kotlin.native.binary.appStateTracking=enabled
# Lift main thread suspending function invocation restriction
kotlin.native.binary.objcExportSuspendFunctionLaunchThreadRestriction=none
# Native incremental compilation
kotlin.incremental.native=true
android.experimental.additionalArtifactsInModel=true
kotlin.apple.xcodeCompatibility.nowarn=true
# Enable new k/n GC
kotlin.native.binary.gc=cms
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
org.gradle.configuration-cache.parallel=true
release=true
#kotlin.kmp.isolated-projects.support=enable
kotlin.incremental.wasm=true
#org.gradle.unsafe.isolated-projects=true
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
distribution: 'zulu'
check-latest: true
java-version: 22
java-version: 23
cache: 'gradle'

- name: Validate gradle wrapper
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
distribution: 'zulu'
check-latest: true
java-version: 22
java-version: 23
cache: 'gradle'

- name: Validate gradle wrapper
Expand All @@ -39,10 +39,13 @@ jobs:
run: cp ./README.md ./docs/README.md

- name: Generate docs
run: ./gradlew :dokkaHtmlMultiModule --no-configuration-cache
run: ./gradlew dokkaGenerate

- name: Make javadoc dir
run: mkdir -p ./docs/javadocs

- name: Move docs to the parent docs dir
run: cp -r ./build/dokka/htmlMultiModule/ ./docs/javadocs/
run: cp -r ./build/dokka/html/ ./docs/javadocs

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ jobs:
environment: publishing

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: set up JDK
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
check-latest: true
java-version: 22
java-version: 23
cache: 'gradle'

- name: Validate gradle wrapper
Expand All @@ -41,6 +42,19 @@ jobs:
with:
xcode-version: latest

- name: Create local properties
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
run: echo "$LOCAL_PROPERTIES" | base64 --decode > local.properties

- name: Cache konan directory
uses: actions/cache@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('*.gradle.kts', 'buildSrc/*') }}
restore-keys: |
${{ runner.os }}-konan-
- name: Publish to sonatype
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
assign_author:
runs-on: macos-latest
steps:
- uses: samspills/assign-pr-to-author@v1
- uses: samspills/assign-pr-to-author@v1.0.2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,5 @@ hs_err_pid*
!gradle/gradle-wrapper.jar
/.idea/appInsightsSettings.xml
/.idea/migrations.xml
.kotlin
kotlin-js-store/yarn.lock
107 changes: 41 additions & 66 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,96 +1,59 @@
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinMultiplatform
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.MavenPublishBasePlugin
import com.vanniktech.maven.publish.SonatypeHost
import nl.littlerobots.vcu.plugin.versionCatalogUpdate
import nl.littlerobots.vcu.plugin.versionSelector
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradleSubplugin
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag.Companion.OptimizeNonSkippingGroups
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.gradleDoctor)
alias(libs.plugins.version.catalog.update)
alias(libs.plugins.dokka)
alias(libs.plugins.dependencyAnalysis)
alias(libs.plugins.atomicfu)
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.compose) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.maven.publish) apply false
// alias(libs.plugins.atomicfu) apply false
dokkaDocumentation
// plugins already on a classpath (conventions)
// alias(libs.plugins.dokka) apply false
// alias(libs.plugins.androidApplication) apply false
// alias(libs.plugins.androidLibrary) apply false
// alias(libs.plugins.kotlinMultiplatform) apply false
}

buildscript {
dependencies {
classpath(libs.android.gradle)
classpath(libs.kotlin.gradle)
classpath(libs.detekt.gradle)
}
}

allprojects {
group = Config.artifactId
version = Config.versionName

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(Config.jvmTarget)
freeCompilerArgs.addAll(Config.jvmCompilerArgs)
optIn.addAll(Config.optIns)
}
}
}

atomicfu {
dependenciesVersion = rootProject.libs.versions.kotlinx.atomicfu.get()
transformJvm = false
jvmVariant = "VH"
transformJs = false
}

subprojects {
apply(plugin = rootProject.libs.plugins.dokka.id)

dependencies {
dokkaPlugin(rootProject.libs.dokka.android)
}

tasks {
withType<Test>().configureEach {
useJUnitPlatform()
filter { isFailOnNoMatchingTests = true }
}
register<org.gradle.jvm.tasks.Jar>("dokkaJavadocJar") {
dependsOn(dokkaJavadoc)
from(dokkaJavadoc.flatMap { it.outputDirectory })
archiveClassifier.set("javadoc")
}

register<org.gradle.jvm.tasks.Jar>("emptyJavadocJar") {
archiveClassifier.set("javadoc")
}
}
plugins.withType<ComposeCompilerGradleSubplugin>().configureEach {
the<ComposeCompilerGradlePluginExtension>().apply {
featureFlags.addAll(OptimizeNonSkippingGroups)
stabilityConfigurationFile = rootProject.layout.projectDirectory.file("stability_definitions.txt")
featureFlags.addAll(ComposeFeatureFlag.OptimizeNonSkippingGroups)
stabilityConfigurationFiles.add(rootProject.layout.projectDirectory.file("stability_definitions.txt"))
if (properties["enableComposeCompilerReports"] == "true") {
val metricsDir = layout.buildDirectory.dir("compose_metrics")
metricsDestination = metricsDir
reportsDestination = metricsDir
}
}
}
afterEvaluate {
extensions.findByType<MavenPublishBaseExtension>()?.run {
plugins.withType<MavenPublishBasePlugin> {
the<MavenPublishBaseExtension>().apply {
val isReleaseBuild = properties["release"]?.toString().toBoolean()
configure(
KotlinMultiplatform(
javadocJar = JavadocJar.Empty(),
sourcesJar = true,
androidVariantsToPublish = listOf("release"),
)
)
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, false)
if (isReleaseBuild) signAllPublications()
coordinates(Config.artifactId, name, Config.version(isReleaseBuild))
Expand Down Expand Up @@ -120,6 +83,12 @@ subprojects {
}
}
}
tasks {
withType<Test>().configureEach {
useJUnitPlatform()
filter { isFailOnNoMatchingTests = true }
}
}
}

doctor {
Expand All @@ -128,12 +97,6 @@ doctor {
}
}

dependencyAnalysis {
structure {
ignoreKtx(true)
}
}

dependencies {
detektPlugins(rootProject.libs.detekt.formatting)
detektPlugins(rootProject.libs.detekt.compose)
Expand All @@ -152,11 +115,12 @@ versionCatalogUpdate {
}
}

// atomicfu {
// dependenciesVersion = libs.versions.atomicfu.get()
// jvmVariant = "VH"
// }

tasks {
dokkaHtmlMultiModule.configure {
moduleName.set(rootProject.name)
}
// needed to generate compose compiler reports. See /scripts
withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
buildUponDefaultConfig = true
parallel = true
Expand Down Expand Up @@ -197,3 +161,14 @@ rootProject.plugins.withType<YarnPlugin>().configureEach {
yarnLockAutoReplace = true
}
}

dependencies {
detektPlugins(rootProject.libs.detekt.formatting)
detektPlugins(rootProject.libs.detekt.compose)
detektPlugins(rootProject.libs.detekt.libraries)
projects.run {
listOf(
common, compose, coroutines, datetime, inputforms
).forEach { dokka(it) }
}
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ plugins {
dependencies {
implementation(libs.android.gradle)
implementation(libs.kotlin.gradle)
implementation(libs.dokka.gradle)
}
35 changes: 22 additions & 13 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ object Config {
const val artifactId = "$group.$artifact"

const val majorRelease = 1
const val minorRelease = 4
const val patch = 4
const val minorRelease = 5
const val patch = 0
const val postfix = ""
const val versionName = "$majorRelease.$minorRelease.$patch$postfix"

Expand All @@ -34,31 +34,40 @@ object Config {
const val name = "KMPUtils"
// kotlin

val jvmTarget = JvmTarget.JVM_11
val javaVersion = JavaVersion.VERSION_11
const val compileSdk = 35
const val targetSdk = compileSdk
const val minSdk = 21
const val appMinSdk = 26
const val publishingVariant = "release"

val optIns = listOf(
"kotlinx.coroutines.ExperimentalCoroutinesApi",
"kotlinx.coroutines.FlowPreview",
"kotlin.RequiresOptIn",
"kotlin.experimental.ExperimentalTypeInference",
"kotlin.contracts.ExperimentalContracts"
"kotlin.uuid.ExperimentalUuidApi",
"kotlin.contracts.ExperimentalContracts",
)
val compilerArgs = listOf(
"-Xbackend-threads=0", // parallel IR compilation
"-Xexpect-actual-classes",
"-Xwasm-use-new-exception-proposal",
"-Xconsistent-data-class-copy-visibility",
"-Xsuppress-warning=NOTHING_TO_INLINE",
"-Xsuppress-warning=UNUSED_ANONYMOUS_PARAMETER",
"-Xwasm-debugger-custom-formatters"
)
val jvmCompilerArgs = buildList {
addAll(compilerArgs)
add("-Xjvm-default=all") // enable all jvm optimizations
add("-Xcontext-receivers")
add("-Xstring-concat=inline")
add("-Xbackend-threads=0") // parallel IR compilation
addAll(optIns.map { "-opt-in=$it" })
add("-Xlambdas=indy")
add("-Xjdk-release=${jvmTarget.target}")
}

val jvmTarget = JvmTarget.JVM_11
val javaVersion = JavaVersion.VERSION_11
const val compileSdk = 35
const val targetSdk = compileSdk
const val minSdk = 21
const val appMinSdk = 26
const val publishingVariant = "release"

// android
const val namespace = artifactId
const val testRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Loading

0 comments on commit 1e8b96e

Please sign in to comment.