Skip to content

Commit

Permalink
Merge pull request #5 from icerockdev/develop
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
Alex009 authored Sep 6, 2020
2 parents 1169c60 + ad524c4 commit 4bb5dd7
Show file tree
Hide file tree
Showing 20 changed files with 133 additions and 191 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: KMP library compilation check
on:
pull_request:
branches:
- master
- develop
- master
- develop

jobs:
build:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Check build
run: ./gradlew -PlibraryPublish :parcelize:publishToMavenLocal
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Check build
run: ./gradlew build publishToMavenLocal
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
java-version: 1.8
- name: Publish
run: ./gradlew -PlibraryPublish :parcelize:publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
run: ./gradlew publishAllPublicationsToBintrayRepository -DBINTRAY_USER=${{ secrets.BINTRAY_USER }} -DBINTRAY_KEY=${{ secrets.BINTRAY_KEY }}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
![moko-parcelize](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-parcelize/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-parcelize/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.3.70-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-parcelize/images/download.svg) ](https://bintray.com/icerockdev/moko/moko-parcelize/_latestVersion) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.0-orange)

# Mobile Kotlin parcelize
This is a Kotlin Multiplatform library that supports Parcelize in common code.
Expand All @@ -19,7 +19,7 @@ This is a Kotlin Multiplatform library that supports Parcelize in common code.
- **Parcelize** in common code (specially for Android target).

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

Expand All @@ -30,6 +30,8 @@ This is a Kotlin Multiplatform library that supports Parcelize in common code.
- 0.2.0
- kotlin 1.3.70
- 0.3.0
- kotlin 1.4.0
- 0.4.0

## Installation
root build.gradle
Expand All @@ -44,7 +46,7 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:parcelize:0.3.0")
commonMainApi("dev.icerock.moko:parcelize:0.4.0")
}
```

Expand Down
23 changes: 21 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

buildscript {
repositories {
jcenter()
google()
}

dependencies {
plugin(Deps.Plugins.androidExtensions)
}
}

allprojects {
repositories {
mavenLocal()
Expand All @@ -14,8 +25,16 @@ allprojects {
maven { url = uri("https://dl.bintray.com/icerockdev/moko") }
}

// workaround for https://youtrack.jetbrains.com/issue/KT-27170
configurations.create("compileClasspath")
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
14 changes: 4 additions & 10 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
*/

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.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.70")
implementation("com.android.tools.build:gradle:3.6.1")
}

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")
}
49 changes: 27 additions & 22 deletions buildSrc/src/main/kotlin/Deps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,40 @@
*/

object Deps {
private const val kotlinVersion = "1.4.0"
private const val androidAppCompatVersion = "1.1.0"
const val mokoParcelizeVersion = "0.4.0"

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

object Plugins {
const val androidExtensions =
"org.jetbrains.kotlin:kotlin-android-extensions:${Versions.Plugins.androidExtensions}"
val androidExtensions = GradlePlugin(
id = "kotlin-android-extensions",
module = "org.jetbrains.kotlin:kotlin-android-extensions:$kotlinVersion"
)
val androidLibrary = GradlePlugin(id = "com.android.library")
val androidApplication = GradlePlugin(id = "com.android.application")
val kotlinMultiPlatform = GradlePlugin(id = "org.jetbrains.kotlin.multiplatform")
val kotlinAndroid = GradlePlugin(id = "kotlin-android")
val kotlinKapt = GradlePlugin(id = "kotlin-kapt")
val mobileMultiPlatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform")
val iosFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.ios-framework")
val mavenPublish = GradlePlugin(id = "maven-publish")
}

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 MultiPlatform {
val kotlinStdLib = MultiPlatformLibrary(
android = Android.kotlinStdLib.name,
common = "org.jetbrains.kotlin:kotlin-stdlib-common:${Versions.kotlin}"
)
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 mokoParcelize =
"dev.icerock.moko:parcelize:$mokoParcelizeVersion"
}
}

val plugins: Map<String, String> = mapOf(
"kotlin-android-extensions" to Plugins.androidExtensions
)
}
}
28 changes: 0 additions & 28 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

9 changes: 8 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ org.gradle.configureondemand=false
org.gradle.parallel=true

kotlin.code.style=official
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
kotlin.native.enableDependencyPropagation=false

android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true

# Workaround for Bintray treating .sha512 files as artifacts
# https://github.com/gradle/gradle/issues/11412
systemProp.org.gradle.internal.publish.checksums.insecure=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
35 changes: 16 additions & 19 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar


# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
Expand Down Expand Up @@ -125,10 +126,11 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand All @@ -154,19 +156,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

Expand All @@ -175,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
25 changes: 7 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

Expand All @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -61,28 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar


@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
Loading

0 comments on commit 4bb5dd7

Please sign in to comment.