Skip to content

Commit

Permalink
Merge pull request #109 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.13.0
  • Loading branch information
Alex009 authored Sep 6, 2020
2 parents ae7fa6f + 3ec7963 commit e2750b5
Show file tree
Hide file tree
Showing 83 changed files with 349 additions and 402 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Check plugin build
run: ./gradlew -PlibraryPublish detekt :gradle-plugin:publishPluginPublicationToMavenLocal
- name: Check library build
run: ./gradlew -PlibraryPublish detekt :resources:publishToMavenLocal
- name: Check demo library
run: ./gradlew detekt :sample:mpp-conditional:build :sample:mpp-hierarhical:build :sample:mpp-library:build :sample:mpp-mixed:build
- name: Check tests
run: ./gradlew :sample:mpp-hierarhical:check
- name: Plugin check
run: ./gradlew -p plugins detekt build publishToMavenLocal
- name: Library check
run: ./gradlew detekt build publishToMavenLocal check
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
with:
java-version: 1.8
- name: Publish plugin
run: ./gradlew -PlibraryPublish :gradle-plugin:publishPluginPublicationToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew -p plugins publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
- name: Publish library
run: ./gradlew -PlibraryPublish :resources:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
4 changes: 0 additions & 4 deletions .github/workflows/ui-tests-android-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build plugin
run: ./gradlew -PlibraryPublish :gradle-plugin:publishPluginPublicationToMavenLocal
- name: Build library
run: ./gradlew -PlibraryPublish :resources:publishToMavenLocal
- name: Run android tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![moko-resources](img/logo.png)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://api.bintray.com/packages/icerockdev/moko/moko-resources/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-resources/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.3.72-orange)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://api.bintray.com/packages/icerockdev/moko/moko-resources/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-resources/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.0-orange)

# Mobile Kotlin resources
This is a Kotlin MultiPlatform library that provides access to the resources on iOS & Android with the support of the default system localization.
Expand All @@ -21,7 +21,7 @@ This is a Kotlin MultiPlatform library that provides access to the resources on
- **FatFrameworkWithResourcesTask** Gradle task.

## Requirements
- Gradle version 5.6.4+
- Gradle version 6.0+
- Android API 16+
- iOS version 9.0+

Expand Down Expand Up @@ -49,6 +49,8 @@ This is a Kotlin MultiPlatform library that provides access to the resources on
- 0.11.0
- 0.11.1
- 0.12.0
- kotlin 1.4.0
- 0.13.0

## Installation
root build.gradle
Expand All @@ -59,7 +61,7 @@ buildscript {
}
dependencies {
classpath "dev.icerock.moko:resources-generator:0.12.0"
classpath "dev.icerock.moko:resources-generator:0.13.0"
}
}
Expand All @@ -76,7 +78,7 @@ project build.gradle
apply plugin: "dev.icerock.mobile.multiplatform-resources"
dependencies {
commonMainApi("dev.icerock.moko:resources:0.12.0")
commonMainApi("dev.icerock.moko:resources:0.13.0")
}
multiplatformResources {
Expand Down
30 changes: 12 additions & 18 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ plugins {

buildscript {
repositories {
mavenLocal()

jcenter()
google()

Expand All @@ -19,26 +17,12 @@ buildscript {
maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
}
dependencies {
val libraryPublish: Boolean = properties.containsKey("libraryPublish")

with(Deps.Plugins) {
listOfNotNull(
androidApplication,
androidLibrary,
kotlinMultiplatform,
kotlinKapt,
kotlinAndroid,
kotlinSerialization,
if (!libraryPublish) mokoResources else null
)
}.let { plugins(it) }
plugin(Deps.Plugins.mokoResources)
}
}

allprojects {
repositories {
mavenLocal()

google()
jcenter()

Expand All @@ -50,13 +34,23 @@ allprojects {
apply(plugin = Deps.Plugins.detekt.id)

configure<io.gitlab.arturbosch.detekt.extensions.DetektExtension> {
toolVersion = Versions.detekt
input.setFrom("src/commonMain/kotlin", "src/androidMain/kotlin", "src/iosMain/kotlin")
}

dependencies {
"detektPlugins"(Deps.Libs.Jvm.detektFormatting)
}

plugins.withId(Deps.Plugins.androidLibrary.id) {
configure<com.android.build.gradle.LibraryExtension> {
compileSdkVersion(Deps.Android.compileSdk)

defaultConfig {
minSdkVersion(Deps.Android.minSdk)
targetSdkVersion(Deps.Android.targetSdk)
}
}
}
}

tasks.register("clean", Delete::class).configure {
Expand Down
18 changes: 10 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
`kotlin-dsl`
id("org.jetbrains.kotlin.jvm") version("1.4.0")
}

repositories {
mavenLocal()

jcenter()
google()

maven { url = uri("https://dl.bintray.com/icerockdev/plugins") }
}

dependencies {
implementation("dev.icerock:mobile-multiplatform:0.6.1")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72")
implementation("com.android.tools.build:gradle:3.6.3")
}

kotlinDslPluginOptions {
experimentalWarning.set(false)
implementation("dev.icerock:mobile-multiplatform:0.7.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
implementation("com.android.tools.build:gradle:4.0.1")
}
142 changes: 84 additions & 58 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,111 @@
*/

object Deps {
object Plugins {
val androidApplication = PluginDesc(id = "com.android.application")
val androidLibrary = PluginDesc(
id = "com.android.library",
module = "com.android.tools.build:gradle:${Versions.Plugins.android}"
)
private const val kotlinVersion = "1.4.0"
private const val androidGradleVersion = "4.0.1"

val kotlinMultiplatform = PluginDesc(
id = "org.jetbrains.kotlin.multiplatform",
module = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Plugins.kotlin}"
)
val kotlinKapt = PluginDesc(id = "kotlin-kapt")
val kotlinAndroid = PluginDesc(id = "kotlin-android")
val kotlinAndroidExtensions = PluginDesc(id = "kotlin-android-extensions")
val kotlinSerialization = PluginDesc(id = "kotlin-serialization")
private const val androidAppCompatVersion = "1.1.0"
private const val espressoCoreVersion = "3.2.0"
private const val testRunnerVersion = "1.2.0"
private const val testExtJunitVersion = "1.1.1"

private const val apacheCommonsTextVersion = "1.3"
private const val kotlinPoetVersion = "1.6.0"
private const val kotlinxSerializationVersion = "0.20.0"

private const val detektVersion = "1.7.4"

val mobileMultiplatform = PluginDesc(id = "dev.icerock.mobile.multiplatform")
private const val mokoGraphicsVersion = "0.4.0"
private const val mokoParcelizeVersion = "0.4.0"
const val mokoResourcesVersion = "0.13.0"

object Android {
const val compileSdk = 28
const val targetSdk = 28
const val minSdk = 16
}

object Plugins {
val javaGradle = GradlePlugin(id = "java-gradle-plugin")
val androidApplication = GradlePlugin(id = "com.android.application")
val androidLibrary = GradlePlugin(id = "com.android.library")
val kotlinJvm = GradlePlugin(id = "org.jetbrains.kotlin.jvm")
val kotlinMultiplatform = GradlePlugin(id = "org.jetbrains.kotlin.multiplatform")
val kotlinKapt = GradlePlugin(id = "kotlin-kapt")
val kotlinAndroid = GradlePlugin(id = "kotlin-android")
val kotlinAndroidExtensions = GradlePlugin(id = "kotlin-android-extensions")
val kotlinSerialization = GradlePlugin(id = "kotlin-serialization")
val mavenPublish = GradlePlugin(id = "org.gradle.maven-publish")

val mokoResources = PluginDesc(
val mobileMultiplatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
val iosFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.ios-framework")

val mokoResources = GradlePlugin(
id = "dev.icerock.mobile.multiplatform-resources",
module = "dev.icerock.moko:resources-generator:${Versions.Plugins.mokoResources}"
module = "dev.icerock.moko:resources-generator:$mokoResourcesVersion"
)

val detekt = PluginDesc(id = "io.gitlab.arturbosch.detekt", version = Versions.detekt)
val detekt = GradlePlugin(
id = "io.gitlab.arturbosch.detekt",
version = detektVersion
)
}

object Libs {
object Android {
val kotlinStdLib = AndroidLibrary(
name = "org.jetbrains.kotlin:kotlin-stdlib:${Versions.kotlin}"
)
val appCompat = AndroidLibrary(
name = "androidx.appcompat:appcompat:${Versions.Libs.Android.appCompat}"
)
const val appCompat =
"androidx.appcompat:appcompat:$androidAppCompatVersion"

object AndroidTest {
val espressoCore = AndroidLibrary(
name = "androidx.test.espresso:espresso-core:${Versions.Libs.Android.AndroidTest.espressoCore}"
)
val testRunner = AndroidLibrary(
name = "androidx.test:runner:${Versions.Libs.Android.AndroidTest.testRunner}"
)
val testRules = AndroidLibrary(
name = "androidx.test:rules:${Versions.Libs.Android.AndroidTest.testRunner}"
)
val testExtJunit = AndroidLibrary(
name = "androidx.test.ext:junit:${Versions.Libs.Android.AndroidTest.testExtJunit}"
)
object Tests {
const val espressoCore =
"androidx.test.espresso:espresso-core:$espressoCoreVersion"
const val kotlinTestJUnit =
"org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
const val testCore =
"androidx.test:core:1.3.0"
const val robolectric =
"org.robolectric:robolectric:4.3"
const val testRunner =
"androidx.test:runner:$testRunnerVersion"
const val testRules =
"androidx.test:rules:$testRunnerVersion"
const val testExtJunit =
"androidx.test.ext:junit:$testExtJunitVersion"
}
}

object MultiPlatform {
val kotlinStdLib = MultiPlatformLibrary(
android = Android.kotlinStdLib.name,
common = "org.jetbrains.kotlin:kotlin-stdlib-common:${Versions.kotlin}"
)
val mokoResources = MultiPlatformLibrary(
common = "dev.icerock.moko:resources:${Versions.Libs.MultiPlatform.mokoResources}",
iosX64 = "dev.icerock.moko:resources-iosx64:${Versions.Libs.MultiPlatform.mokoResources}",
iosArm64 = "dev.icerock.moko:resources-iosarm64:${Versions.Libs.MultiPlatform.mokoResources}"
)
val mokoParcelize = MultiPlatformLibrary(
common = "dev.icerock.moko:parcelize:${Versions.Libs.MultiPlatform.mokoParcelize}",
iosX64 = "dev.icerock.moko:parcelize-iosx64:${Versions.Libs.MultiPlatform.mokoParcelize}",
iosArm64 = "dev.icerock.moko:parcelize-iosarm64:${Versions.Libs.MultiPlatform.mokoParcelize}"
)
const val mokoResources = "dev.icerock.moko:resources:$mokoResourcesVersion"
const val mokoParcelize = "dev.icerock.moko:parcelize:$mokoParcelizeVersion"
val mokoGraphics = MultiPlatformLibrary(
common = "dev.icerock.moko:graphics:${Versions.Libs.MultiPlatform.mokoGraphics}",
iosX64 = "dev.icerock.moko:graphics-iosx64:${Versions.Libs.MultiPlatform.mokoGraphics}",
iosArm64 = "dev.icerock.moko:graphics-iosarm64:${Versions.Libs.MultiPlatform.mokoGraphics}"
common = "dev.icerock.moko:graphics:$mokoGraphicsVersion",
iosX64 = "dev.icerock.moko:graphics-iosx64:$mokoGraphicsVersion",
iosArm64 = "dev.icerock.moko:graphics-iosarm64:$mokoGraphicsVersion"
)

object Tests {
const val kotlinTest =
"org.jetbrains.kotlin:kotlin-test-common:$kotlinVersion"
const val kotlinTestAnnotations =
"org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlinVersion"
}
}

object Jvm {
const val kotlinPoet = "com.squareup:kotlinpoet:${Versions.Libs.Jvm.kotlinPoet}"
const val kotlinxSerialization = "org.jetbrains.kotlinx:kotlinx-serialization-runtime:${Versions.Libs.Jvm.kotlinxSerialization}"
const val apacheCommonsText = "org.apache.commons:commons-text:${Versions.Libs.Jvm.apacheCommonsText}"
const val detektFormatting = "io.gitlab.arturbosch.detekt:detekt-formatting:${Versions.detekt}"
const val kotlinPoet =
"com.squareup:kotlinpoet:$kotlinPoetVersion"
const val kotlinxSerialization =
"org.jetbrains.kotlinx:kotlinx-serialization-runtime:$kotlinxSerializationVersion"
const val apacheCommonsText =
"org.apache.commons:commons-text:$apacheCommonsTextVersion"
const val detektFormatting =
"io.gitlab.arturbosch.detekt:detekt-formatting:$detektVersion"
const val kotlinGradlePlugin =
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
const val androidGradlePlugin =
"com.android.tools.build:gradle:$androidGradleVersion"
const val kotlinCompilerEmbeddable =
"org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion"
}
}
}
31 changes: 0 additions & 31 deletions buildSrc/src/main/kotlin/PluginDesc.kt

This file was deleted.

Loading

0 comments on commit e2750b5

Please sign in to comment.