Skip to content

Commit

Permalink
Merge pull request #839 from splendo/feature/838-properties
Browse files Browse the repository at this point in the history
Harmonize gradle.properties with other kaluga projects
  • Loading branch information
thoutbeckers authored Dec 6, 2024
2 parents 28feffc + d9b0cce commit 60e70f3
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 32 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Android tests and example
on: pull_request

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
example:
runs-on:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: iOS tests
on: pull_request

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
build:
uses: ./.github/workflows/setup_macos.yaml
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Publish
on: push

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
SIGNING_SECRET_KEY_RING_FILE: ${{ github.workspace }}/kaluga-library-components/keys/secret-keys.gpg

concurrency: publish-${{ github.ref_name }}
Expand All @@ -22,10 +20,6 @@ jobs:
with:
submodules: recursive


# remove VM settings as defined for using the IDE
- run: sed -i '' -e '/org.gradle.jvmargs/d' gradle.properties; cat gradle.properties

# TODO: use setup_tools_macos

- name : set up JDK 17
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/setup_linux.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Setup macOS workspace reusable workflow'
name: 'Setup linux workspace reusable workflow'

on:
workflow_call:
Expand All @@ -24,7 +24,6 @@ jobs:

outputs:
projects: ${{ steps.envFile.outputs.projects }}
kotlinVersion: ${{ steps.kotlinVersion.outputs.kotlinVersion }}

steps:
- name: checkout
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/setup_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
name: 'Setup macOS workspace reusable workflow'

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

on:
workflow_call:
inputs:
Expand All @@ -19,7 +15,7 @@ on:

outputs:
kotlinVersion:
description: "kaluga.kotlinVersion property from gradle.properties"
description: "kotlin version from libs.versions.toml"
value: ${{ jobs.setup.outputs.kotlinVersion }}
projects:
description: "Gradle projects that do not dependent on another project or have other projects dependent on them"
Expand All @@ -31,27 +27,27 @@ jobs:

outputs:
projects: ${{ steps.envFile.outputs.projects }}
kotlinVersion: ${{ steps.kotlinVersion.outputs.kotlinVersion }}
kotlinVersion: ${{ steps.kotlinVersion.outputs.value}}

steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: remove VM settings as defined in gradle.properties (for using in the IDE)
run: sed -i '' -e '/org.gradle.jvmargs/d' gradle.properties; cat gradle.properties

- name: get Kotlin version
- name: read TOML version file
id: kotlinVersion
run: grep kaluga.kotlinVersion= gradle.properties | sed s/"kaluga."// >> $GITHUB_OUTPUT
uses: SebRollen/[email protected]
with:
file: gradle/libs.versions.toml
field: 'versions.kotlin'

- name: setup tools and enable Gradle cache writing
uses: ./.github/workflows/setup_tools_macos/
with:
gradle-cache-read-only: 'false'
restore-workspace-cache: 'false'
kotlinVersion: ${{ steps.kotlinVersion.outputs.kotlinVersion }}
kotlinVersion: ${{ steps.kotlinVersion.outputs.value }}
arch: ${{ runner.arch == 'X86' && 'x86' || runner.arch == 'X64' && 'x86_64' || runner.arch == 'ARM' && 'arm32' || 'arm64' }}
project: ${{ inputs.project }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/setup_tools_linux/action.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "setup tools and caching for macOS workspace"
description: "setup tools and caching for macOS workspace"
name: "setup tools and caching for linux workspace"
description: "setup tools and caching for linux workspace"
inputs:
gradle-cache-read-only:
default: 'true'
Expand Down
5 changes: 4 additions & 1 deletion example/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ android.useAndroidX=true
android.nonTransitiveRClass=true

# Gradle
org.gradle.jvmargs=-Xmx8G -Dfile.encoding\=UTF-8 -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options\=-Xmx8G,-XX:MaxMetaspaceSize=512m
# make sure this stays harmonized with other kaluga projects for daemon reuse
org.gradle.jvmargs=-Xmx5g -Xms256m -XX:MaxMetaspaceSize=800m -XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.parallel=true
# not possible yet for kaluga
# org.gradle.configuration-cache=true

#MPP
kotlin.mpp.enableCInteropCommonization=true
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ android.useAndroidX=true
android.nonTransitiveRClass=true

# Gradle
org.gradle.jvmargs=-Xmx8G -Dfile.encoding\=UTF-8 -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options\=-Xmx8G,-XX:MaxMetaspaceSize=512m
# make sure this stays harmonized with other kaluga projects for daemon reuse
org.gradle.jvmargs=-Xmx5g -Xms256m -XX:MaxMetaspaceSize=800m -XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.parallel=true
# not possible yet for kaluga
# org.gradle.configuration-cache=true

#MPP
kotlin.mpp.enableCInteropCommonization=true
Expand Down

0 comments on commit 60e70f3

Please sign in to comment.