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

#762 added support custom build configuration for apple target #765

Merged
merged 10 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/compilation-check-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:

.upload_reports: &upload_reports
name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -146,7 +146,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -193,7 +193,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -328,7 +328,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -369,7 +369,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -410,7 +410,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -457,7 +457,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down Expand Up @@ -551,7 +551,7 @@ jobs:
report_paths: "**/build/test-results/**/TEST-*.xml"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive reports
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: code-coverage-report-${{ github.job }}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ buildscript {
}

dependencies {
classpath "dev.icerock.moko:resources-generator:0.24.2"
classpath "dev.icerock.moko:resources-generator:0.24.3"
}
}

Expand All @@ -82,10 +82,10 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-resources"

dependencies {
commonMainApi("dev.icerock.moko:resources:0.24.2")
commonMainApi("dev.icerock.moko:resources-compose:0.24.2") // for compose multiplatform
commonMainApi("dev.icerock.moko:resources:0.24.3")
commonMainApi("dev.icerock.moko:resources-compose:0.24.3") // for compose multiplatform

commonTestImplementation("dev.icerock.moko:resources-test:0.24.2")
commonTestImplementation("dev.icerock.moko:resources-test:0.24.3")
}

multiplatformResources {
Expand Down Expand Up @@ -132,7 +132,7 @@ should [add `export` declarations](https://kotlinlang.org/docs/multiplatform-bui

```
framework {
export("dev.icerock.moko:resources:0.24.2")
export("dev.icerock.moko:resources:0.24.3")
export("dev.icerock.moko:graphics:0.9.0") // toUIColor here
}
```
Expand Down
2 changes: 1 addition & 1 deletion gradle/moko.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
resourcesVersion = "0.24.2"
resourcesVersion = "0.24.3"

[libraries]
resources = { module = "dev.icerock.moko:resources", version.ref = "resourcesVersion" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,6 @@ internal fun registerCopyFrameworkResourcesToAppTask(
if (platform == null || archs == null || configuration == null) return

val kotlinMultiplatformExtension = project.extensions.getByType<KotlinMultiplatformExtension>()
val configMap: Map<String, NativeBuildType> = (kotlinMultiplatformExtension as? ExtensionAware)
?.extensions
?.findByType<CocoapodsExtension>()
?.xcodeConfigurationToNativeBuildType
?: emptyMap()

val configName: String = (configMap[configuration]?.name ?: configuration).lowercase()
val requiredKonanTargets: List<String> =
AppleSdk.defineNativeTargets(platform, archs).map { it.name }
val frameworkNames: DomainObjectSet<String> =
project.objects.domainObjectSet(String::class.java)

Expand All @@ -176,6 +167,17 @@ internal fun registerCopyFrameworkResourcesToAppTask(
)

xcodeTask.configure {
val configMap: Map<String, NativeBuildType> =
(kotlinMultiplatformExtension as? ExtensionAware)
?.extensions
?.findByType<CocoapodsExtension>()
?.xcodeConfigurationToNativeBuildType
?: emptyMap()

val configName: String = (configMap[configuration]?.name ?: configuration).lowercase()
val requiredKonanTargets: List<String> =
AppleSdk.defineNativeTargets(platform, archs).map { it.name }

it.dependsOn(
project.tasks.withType<CopyFrameworkResourcesToAppTask>().matching { copyTask ->
val isCorrectConfiguration: Boolean =
Expand Down
Loading