Skip to content

Commit

Permalink
Merge pull request #84 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.10.1
  • Loading branch information
Alex009 authored Jun 2, 2020
2 parents 74b4dc3 + fde20ad commit 2c00586
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 17 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This is a Kotlin MultiPlatform library that provides access to the resources on
- 0.9.1
- kotlin 1.3.72
- 0.10.0
- 0.10.1

## Installation
root build.gradle
Expand All @@ -54,7 +55,7 @@ buildscript {
}
dependencies {
classpath "dev.icerock.moko:resources-generator:0.10.0"
classpath "dev.icerock.moko:resources-generator:0.10.1"
}
}
Expand All @@ -71,7 +72,7 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-resources"
dependencies {
commonMainApi("dev.icerock.moko:resources:0.10.0")
commonMainApi("dev.icerock.moko:resources:0.10.1")
}
multiplatformResources {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object Versions {
const val kotlin = "1.3.72"
const val detekt = "1.7.4"

private const val mokoResources = "0.10.0"
private const val mokoResources = "0.10.1"

object Plugins {
const val android = "3.6.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.konan.target.Family
import org.jetbrains.kotlin.konan.target.HostManager
import java.io.File
import javax.xml.parsers.DocumentBuilderFactory

Expand Down Expand Up @@ -93,7 +94,18 @@ class MultiplatformResourcesPlugin : Plugin<Project> {

setupCommonGenerator(commonSourceSet, generatedDir, mrClassPackage, features, target)
setupAndroidGenerator(targets, androidMainSourceSet, generatedDir, mrClassPackage, features, target)
setupIosGenerator(targets, generatedDir, mrClassPackage, features, target, iosLocalizationRegion)
if(HostManager.hostIsMac) {
setupIosGenerator(
targets,
generatedDir,
mrClassPackage,
features,
target,
iosLocalizationRegion
)
} else {
target.logger.warn("MR file generation for iOS is not supported on your system!")
}

val generationTasks = target.tasks.filterIsInstance<GenerateMultiplatformResourcesTask>()
val commonGenerationTask = generationTasks.first { it.name == "generateMRcommonMain" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

package dev.icerock.gradle.generator

import org.gradle.api.tasks.TaskAction
import org.jetbrains.kotlin.gradle.tasks.FatFrameworkTask

open class FatFrameworkWithResourcesTask : FatFrameworkTask() {

@TaskAction
protected fun copyBundle() {
super.createFatFramework()

frameworks.first().outputFile.listFiles()
?.asSequence()
?.filter { it.name.contains(".bundle") }
?.forEach { bundleFile ->
project.copy {
from(bundleFile) {
into(bundleFile.name)
}
into(fatFrameworkDir)
}
}
}
}
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ kotlin.code.style=official
android.useAndroidX=true
android.enableJetifier=true

kotlin.native.enableParallelExecutionCheck=false
kotlin.native.enableParallelExecutionCheck=false

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/11412
systemProp.org.gradle.internal.publish.checksums.insecure=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package dev.icerock.moko.resources.desc

import android.content.Context

actual class CompositionStringDesc actual constructor(
actual data class CompositionStringDesc actual constructor(
val args: List<StringDesc>,
val separator: String?
) : StringDesc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package dev.icerock.moko.resources.desc
import android.content.Context
import dev.icerock.moko.resources.PluralsResource

actual class PluralFormattedStringDesc actual constructor(
actual data class PluralFormattedStringDesc actual constructor(
val pluralsRes: PluralsResource,
val number: Int,
val args: List<Any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import dev.icerock.moko.parcelize.Parcelize
import dev.icerock.moko.resources.PluralsResource

@Parcelize
actual class PluralStringDesc actual constructor(
actual data class PluralStringDesc actual constructor(
val pluralsRes: PluralsResource,
val number: Int
) : StringDesc, Parcelable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import dev.icerock.moko.parcelize.Parcelable
import dev.icerock.moko.parcelize.Parcelize

@Parcelize
actual class RawStringDesc actual constructor(
actual data class RawStringDesc actual constructor(
val string: String
) : StringDesc, Parcelable {
override fun toString(context: Context): String = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package dev.icerock.moko.resources.desc
import android.content.Context
import dev.icerock.moko.resources.StringResource

actual class ResourceFormattedStringDesc actual constructor(
actual data class ResourceFormattedStringDesc actual constructor(
val stringRes: StringResource,
val args: List<Any>
) : StringDesc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import dev.icerock.moko.parcelize.Parcelize
import dev.icerock.moko.resources.StringResource

@Parcelize
actual class ResourceStringDesc actual constructor(
actual data class ResourceStringDesc actual constructor(
val stringRes: StringResource
) : StringDesc, Parcelable {
override fun toString(context: Context): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package dev.icerock.moko.resources.desc

actual class CompositionStringDesc actual constructor(
actual data class CompositionStringDesc actual constructor(
val args: List<StringDesc>,
val separator: String?
) : StringDesc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package dev.icerock.moko.resources.desc
import dev.icerock.moko.resources.PluralsResource
import dev.icerock.moko.resources.objc.pluralizedString

actual class PluralFormattedStringDesc actual constructor(
actual data class PluralFormattedStringDesc actual constructor(
val pluralsRes: PluralsResource,
val number: Int,
val args: List<Any>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dev.icerock.moko.parcelize.Parcelable
import dev.icerock.moko.resources.PluralsResource
import dev.icerock.moko.resources.objc.pluralizedString

actual class PluralStringDesc actual constructor(
actual data class PluralStringDesc actual constructor(
val pluralsRes: PluralsResource,
val number: Int
) : StringDesc, Parcelable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import dev.icerock.moko.parcelize.Parcelable
import dev.icerock.moko.parcelize.Parcelize

@Parcelize
actual class RawStringDesc actual constructor(
actual data class RawStringDesc actual constructor(
val string: String
) : StringDesc, Parcelable {
override fun localized(): String = string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package dev.icerock.moko.resources.desc

import dev.icerock.moko.resources.StringResource

actual class ResourceFormattedStringDesc actual constructor(
actual data class ResourceFormattedStringDesc actual constructor(
val stringRes: StringResource,
val args: List<Any>
) : StringDesc {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package dev.icerock.moko.resources.desc
import dev.icerock.moko.parcelize.Parcelable
import dev.icerock.moko.resources.StringResource

actual class ResourceStringDesc actual constructor(
actual data class ResourceStringDesc actual constructor(
private val stringRes: StringResource
) : StringDesc, Parcelable {
override fun localized(): String {
Expand Down

0 comments on commit 2c00586

Please sign in to comment.