diff --git a/.github/workflows/compilation-check.yml b/.github/workflows/compilation-check.yml index 15b8eae..b067a6e 100644 --- a/.github/workflows/compilation-check.yml +++ b/.github/workflows/compilation-check.yml @@ -20,3 +20,9 @@ jobs: java-version: 1.8 - name: Check build run: ./gradlew build publishToMavenLocal + - name: Install pods + run: cd sample/ios-app && pod install + if: matrix.os == 'macOS-latest' + - name: Check iOS + run: cd sample/ios-app && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO + if: matrix.os == 'macOS-latest' \ No newline at end of file diff --git a/README.md b/README.md index d5a0d58..72af13d 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ ![moko-graphics](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://img.shields.io/maven-central/v/dev.icerock.moko/graphics) ](https://repo1.maven.org/maven2/dev/icerock/moko/graphics/) ![kotlin-version](https://img.shields.io/badge/kotlin-1.4.31-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://img.shields.io/maven-central/v/dev.icerock.moko/graphics) ](https://repo1.maven.org/maven2/dev/icerock/moko/graphics/) ![kotlin-version](https://img.shields.io/badge/kotlin-1.5.10-orange) # Mobile Kotlin graphics This is a Kotlin Multiplatform library that provides graphics primitives to common code. @@ -24,24 +24,6 @@ This is a Kotlin Multiplatform library that provides graphics primitives to comm - Android API 16+ - iOS version 9.0+ -## Versions -### Bintray -- kotlin 1.3.50 - - 0.1.0 -- kotlin 1.3.60 - - 0.2.0 -- kotlin 1.3.70 - - 0.3.0 -- kotlin 1.4.0 - - 0.4.0 -- kotlin 1.4.20 - - 0.5.0 -- kotlin 1.4.21 - - 0.6.0 -### mavenCentral -- kotlin 1.4.31 - - 0.6.1 - ## Installation root build.gradle ```groovy @@ -55,7 +37,7 @@ allprojects { project build.gradle ```groovy dependencies { - commonMainApi("dev.icerock.moko:graphics:0.6.1") + commonMainApi("dev.icerock.moko:graphics:0.7.0") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index 79cc4a5..f48b054 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,26 +1,31 @@ /* * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ +buildscript { + repositories { + mavenCentral() + google() + } + dependencies { + classpath("dev.icerock:mobile-multiplatform:0.9.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10") + classpath("com.android.tools.build:gradle:4.2.1") + } +} allprojects { repositories { mavenCentral() google() - - jcenter { - content { - includeGroup("org.jetbrains.trove4j") - } - } } - plugins.withId(Deps.Plugins.androidLibrary.id) { + plugins.withId("com.android.library") { configure { - compileSdkVersion(Deps.Android.compileSdk) + compileSdkVersion(libs.versions.compileSdk.get().toInt()) defaultConfig { - minSdkVersion(Deps.Android.minSdk) - targetSdkVersion(Deps.Android.targetSdk) + minSdkVersion(libs.versions.minSdk.get().toInt()) + targetSdkVersion(libs.versions.targetSdk.get().toInt()) } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index e856d25..0000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -plugins { - id("org.jetbrains.kotlin.jvm") version("1.4.31") -} - -repositories { - mavenCentral() - google() - - jcenter { - content { - includeGroup("org.jetbrains.trove4j") - } - } -} - -dependencies { - implementation("dev.icerock:mobile-multiplatform:0.9.1") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31") - implementation("com.android.tools.build:gradle:4.1.1") -} diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt deleted file mode 100755 index 1091f39..0000000 --- a/buildSrc/src/main/kotlin/Deps.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -object Deps { - private const val kotlinVersion = "1.4.31" - - private const val androidAppCompatVersion = "1.2.0" - private const val androidAnnotationVersion = "1.1.0" - - const val mokoGraphicsVersion = "0.6.1" - - object Android { - const val compileSdk = 28 - const val targetSdk = 28 - const val minSdk = 16 - } - - object Plugins { - 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 mobileMultiPlatform = GradlePlugin(id = "dev.icerock.mobile.multiplatform") - val appleFramework = GradlePlugin(id = "dev.icerock.mobile.multiplatform.apple-framework") - val mavenPublish = GradlePlugin(id = "maven-publish") - val signing = GradlePlugin(id = "signing") - } - - object Libs { - object Android { - const val appCompat = - "androidx.appcompat:appcompat:$androidAppCompatVersion" - const val annotation = - "androidx.annotation:annotation:$androidAnnotationVersion" - } - - object MultiPlatform { - val mokoGraphics = "dev.icerock.moko:graphics:$mokoGraphicsVersion" - .defaultMPL(android = true, ios = true, macos = true) - } - } -} diff --git a/gradle.properties b/gradle.properties index 0179162..a327f19 100755 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,12 @@ org.gradle.configureondemand=false org.gradle.parallel=true kotlin.code.style=official + +kotlin.mpp.stability.nowarn=true kotlin.mpp.enableGranularSourceSetsMetadata=true kotlin.mpp.enableCompatibilityMetadataVariant=true kotlin.native.enableDependencyPropagation=false android.useAndroidX=true + +mobile.multiplatform.iosTargetWarning=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..1e5f38a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,13 @@ +[versions] +androidAppCompatVersion = "1.2.0" +androidAnnotationVersion = "1.1.0" +mokoGraphicsVersion = "0.7.0" +compileSdk = "28" +targetSdk = "28" +minSdk = "16" + +[libraries] +appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidAppCompatVersion" } +annotation = { module = "androidx.annotation:annotation", version.ref = "androidAppCompatVersion" } +mokoGraphics = { module = "dev.icerock.moko:graphics", version.ref = "mokoGraphicsVersion" } + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d913..0f80bbf 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/graphics/build.gradle.kts b/graphics/build.gradle.kts index 616afd9..547588f 100644 --- a/graphics/build.gradle.kts +++ b/graphics/build.gradle.kts @@ -6,18 +6,18 @@ import java.util.Base64 import kotlin.text.String plugins { - plugin(Deps.Plugins.androidLibrary) - plugin(Deps.Plugins.kotlinMultiPlatform) - plugin(Deps.Plugins.mobileMultiPlatform) - plugin(Deps.Plugins.mavenPublish) - plugin(Deps.Plugins.signing) + id("com.android.library") + id("org.jetbrains.kotlin.multiplatform") + id("dev.icerock.mobile.multiplatform") + id("maven-publish") + id("signing") } group = "dev.icerock.moko" -version = Deps.mokoGraphicsVersion +version = libs.versions.mokoGraphicsVersion.get() dependencies { - androidMainImplementation(Deps.Libs.Android.annotation) + "androidMainImplementation"(libs.annotation) } kotlin { @@ -25,7 +25,7 @@ kotlin { tvos() watchos() jvm() - js { + js(BOTH) { nodejs() browser() } diff --git a/sample/android-app/build.gradle.kts b/sample/android-app/build.gradle.kts index 4b177a1..bfbc268 100644 --- a/sample/android-app/build.gradle.kts +++ b/sample/android-app/build.gradle.kts @@ -3,20 +3,20 @@ */ plugins { - plugin(Deps.Plugins.androidApplication) - plugin(Deps.Plugins.kotlinAndroid) + id("com.android.application") + id("kotlin-android") } android { - compileSdkVersion(Deps.Android.compileSdk) + compileSdkVersion(libs.versions.compileSdk.get().toInt()) dexOptions { javaMaxHeapSize = "2g" } defaultConfig { - minSdkVersion(Deps.Android.minSdk) - targetSdkVersion(Deps.Android.targetSdk) + minSdkVersion(libs.versions.minSdk.get().toInt()) + targetSdkVersion(libs.versions.targetSdk.get().toInt()) applicationId = "dev.icerock.moko.samples.graphics" @@ -43,7 +43,7 @@ android { } dependencies { - implementation(Deps.Libs.Android.appCompat) + implementation(libs.appCompat) - implementation(project(":sample:mpp-library")) + implementation(projects.sample.mppLibrary) } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts deleted file mode 100644 index 08089c6..0000000 --- a/sample/build.gradle.kts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. - */ - -subprojects { - configurations.all { - resolutionStrategy.dependencySubstitution { - listOfNotNull( - Deps.Libs.MultiPlatform.mokoGraphics.common, - Deps.Libs.MultiPlatform.mokoGraphics.iosX64, - Deps.Libs.MultiPlatform.mokoGraphics.iosArm64, - Deps.Libs.MultiPlatform.mokoGraphics.macosX64 - ).forEach { - substitute(module(it)).with(project(":graphics")) - } - } - } -} diff --git a/sample/ios-app/Podfile b/sample/ios-app/Podfile index a57cc39..2ba190c 100644 --- a/sample/ios-app/Podfile +++ b/sample/ios-app/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +source 'https://cdn.cocoapods.org/' # ignore all warnings from all pods inhibit_all_warnings! diff --git a/sample/mpp-library/build.gradle.kts b/sample/mpp-library/build.gradle.kts index fdd24b8..744ad8b 100644 --- a/sample/mpp-library/build.gradle.kts +++ b/sample/mpp-library/build.gradle.kts @@ -3,20 +3,22 @@ */ plugins { - plugin(Deps.Plugins.androidLibrary) - plugin(Deps.Plugins.kotlinMultiPlatform) - plugin(Deps.Plugins.mobileMultiPlatform) - plugin(Deps.Plugins.appleFramework) + id("com.android.library") + id("org.jetbrains.kotlin.multiplatform") + id("dev.icerock.mobile.multiplatform") + id("dev.icerock.mobile.multiplatform.apple-framework") } kotlin { macosX64() + targets.withType(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget::class.java).all { + binaries.withType(org.jetbrains.kotlin.gradle.plugin.mpp.Framework::class.java).all { + export(projects.graphics) + } + } } dependencies { - commonMainApi(Deps.Libs.MultiPlatform.mokoGraphics.common) + commonMainApi(projects.graphics) } -framework { - export(Deps.Libs.MultiPlatform.mokoGraphics) -} diff --git a/settings.gradle.kts b/settings.gradle.kts index 09472ac..aa356e1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -2,6 +2,9 @@ * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ +enableFeaturePreview("VERSION_CATALOGS") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + include(":graphics") include(":sample:android-app") include(":sample:mpp-library")