Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
50e9220
#58 temp commit
anton6tak Jul 2, 2021
a4b2356
#58 remove unused and fixes
anton6tak Jul 5, 2021
279b129
Merge pull request #59 from anton6tak/#58-update-to-kotlin-1.5.20-and…
Alex009 Jul 5, 2021
72d138f
#58 fix error in CI, didn't finish with error when it was
anton6tak Jul 6, 2021
691ffe7
#58 removed non used
anton6tak Jul 7, 2021
03a7b4d
Merge pull request #61 from anton6tak/#58-update-to-kotlin-1.5.20-and…
Alex009 Jul 7, 2021
b27aae2
#58 setup new mapbox repo
Alex009 Jul 7, 2021
f2554d5
#58 control tokens for android by gradle properties
Alex009 Jul 7, 2021
4f106fc
#58 setup guide
Alex009 Jul 7, 2021
9d3dcc3
#58 updated pods for mapbox and google Maps, changed readme for how t…
anton6tak Jul 8, 2021
5f2a112
#58 updated CI pod-install action and removed useless
anton6tak Jul 12, 2021
d5c825d
#58 CI pod-install action fixes
anton6tak Jul 12, 2021
599a872
#58 CI fixes
anton6tak Jul 12, 2021
f9eda39
#58 added env variable to compitation-check
anton6tak Jul 12, 2021
6aa2859
#58 added phase to ci for configure netrc file
anton6tak Jul 12, 2021
7764e5f
#58 fixes
anton6tak Jul 12, 2021
87a4566
#58 fixed netrc setup on ci
anton6tak Jul 12, 2021
e275d9a
#58 fixed netrc setup on ci
anton6tak Jul 12, 2021
9f16c79
#58 test
anton6tak Jul 12, 2021
ec8f90f
#58 fixes get mapbox token
anton6tak Jul 12, 2021
55f3cc1
#58 use repository secrets to install mapbox
anton6tak Jul 13, 2021
4955e00
#58 add GOOGLE_MAPS_API_KEY to buildConfig
anton6tak Jul 14, 2021
0d5d546
#58 way to get mapbox_public_token and google_api_key from repo secrets
anton6tak Jul 14, 2021
10fc9e0
#58 added keys to CI check file
anton6tak Jul 14, 2021
13ca1e9
Merge pull request #63 from icerockdev/#58-mapbox-update
anton6tak Jul 14, 2021
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
19 changes: 13 additions & 6 deletions .github/workflows/compilation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,27 @@ on:
jobs:
build:
runs-on: macOS-latest

env:
MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
MAPBOX_PUBLIC_TOKEN: ${{ secrets.MAPBOX_PUBLIC_TOKEN }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Set up netrc
uses: extractions/netrc@v1
with:
machine: api.mapbox.com
username: mapbox
password: ${{ secrets.MAPBOX_SECRET_TOKEN }}
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Build K/N cache
run: ./gradlew :maps:runCommonizer
- name: Check library
run: ./gradlew build publishToMavenLocal syncMultiPlatformLibraryDebugFrameworkIosX64
- name: Install pods with kotlin
run: cd sample/ios-app && pod install
- name: build ios sample
run: cd sample/ios-app && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
run: cd sample/ios-app && set -o pipefail && xcodebuild -scheme TestProj -workspace TestProj.xcworkspace -configuration Debug -sdk iphonesimulator -arch x86_64 build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO | xcpretty
18 changes: 12 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@ jobs:
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.GPG_KEY_CONTENTS }}

MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }}
MAPBOX_PUBLIC_TOKEN: ${{ secrets.MAPBOX_PUBLIC_TOKEN }}
GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Set up netrc
uses: extractions/netrc@v1
with:
machine: api.mapbox.com
username: mapbox
password: ${{ secrets.MAPBOX_SECRET_TOKEN }}
- name: Cocoapods install
run: (cd sample/ios-app && pod install)
- name: Build K/N cache
run: ./gradlew :maps:runCommonizer
- name: Publish library
run: ./gradlew publish
release:
Expand All @@ -44,6 +50,6 @@ jobs:
with:
commitish: ${{ github.ref }}
tag_name: release/${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
release_name: ${{ github.event.inputs.version }}
body: "Will be filled later"
draft: true
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
![moko-maps](https://user-images.githubusercontent.com/5010169/71351401-27c14d80-25a6-11ea-9183-17821f6d4212.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/maps) ](https://repo1.maven.org/maven2/dev/icerock/moko/maps) ![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/maps) ](https://repo1.maven.org/maven2/dev/icerock/moko/maps) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko&name=maps)

# Mobile Kotlin maps module
This is a Kotlin Multiplatform library that provides controls of maps to common code.

## Table of Contents
- [Features](#features)
- [Requirements](#requirements)
- [Versions](#versions)
- [Installation](#installation)
- [Usage](#usage)
- [Samples](#samples)
Expand All @@ -25,26 +24,6 @@ This is a Kotlin Multiplatform library that provides controls of maps to common
- Android API 16+
- iOS version 9.0+

## Versions
### Bintray
- kotlin 1.3.61
- 0.1.0
- 0.1.1
- 0.2.0
- 0.2.1
- 0.3.0
- 0.4.0-dev-1
- kotlin 1.3.70
- 0.4.0-dev-2
- 0.4.0-dev-3
- 0.4.0-dev-4
- kotlin 1.4.10
- 0.5.0
- 0.5.1
### mavenCentral
- kotlin 1.4.31
- 0.5.2

## Installation
root build.gradle
```groovy
Expand All @@ -59,9 +38,9 @@ allprojects {
project build.gradle
```groovy
dependencies {
commonMainApi("dev.icerock.moko:maps:0.5.2")
commonMainApi("dev.icerock.moko:maps-google:0.5.2")
commonMainApi("dev.icerock.moko:maps-mapbox:0.5.2")
commonMainApi("dev.icerock.moko:maps:0.6.0")
commonMainApi("dev.icerock.moko:maps-google:0.6.0")
commonMainApi("dev.icerock.moko:maps-mapbox:0.6.0")
}

kotlin.targets
Expand Down Expand Up @@ -191,7 +170,29 @@ class MarkerViewModel(
## Samples
Please see more examples in the [sample directory](sample).

## Set Up Locally
## Set Up Locally
Before open project need to setup `gradle.properties` with tokens:
```
# mapbox tokens by guide https://docs.mapbox.com/android/maps/guides/install/
mapbox.secretToken=YOUR_SECRET_MAPBOX_KEY
mapbox.publicToken=YOUR_PUBLIC_MAPBOX_KEY

# google maps api key by guide https://developers.google.com/maps/documentation/android-sdk/get-api-key
googleMaps.apiKey=YOUR_API_KEY
```

# ios info.plist setup with tokens:
```
MGLMapboxAccessToken=YOUR_PUBLIC_MAPBOX_KEY
GoogleAPIkey=YOUR_API_KEY
```
add the following entry to your `.netrc` file:
```
machine api.mapbox.com
login mapbox
password YOUR_SECRET_MAPBOX_KEY
```

- The [maps directory](maps) contains the base classes for all maps providers;
- The [maps-google directory](maps-google) contains the Google Maps implementation;
- The [maps-mapbox directory](maps-mapbox) contains the mapbox implementation;
Expand Down
140 changes: 15 additions & 125 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,144 +1,34 @@
/*
* Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license.
*/

import java.util.Base64

plugins {
plugin(Deps.Plugins.detekt) apply false
}
import org.gradle.api.internal.artifacts.DefaultModuleVersionSelector

buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()

jcenter {
content {
includeGroup("org.jetbrains.trove4j")
}
}
}
dependencies {
plugin(Deps.Plugins.mokoResources)
plugin(Deps.Plugins.kotlinSerialization)
classpath(":maps-build-logic")
classpath("dev.icerock.moko:resources-generator:0.16.1")
classpath("org.jetbrains.kotlin:kotlin-serialization:1.5.20")
}
}

allprojects {
repositories {
mavenCentral()
google()

maven { url = uri("https://mapbox.bintray.com/mapbox") }

jcenter {
content {
includeGroup("org.jetbrains.trove4j")
includeGroup("org.jetbrains.kotlinx")
}
}
}

apply(plugin = Deps.Plugins.detekt.id)

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

dependencies {
"detektPlugins"(Deps.Libs.Detekt.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)
}
}
}

plugins.withId(Deps.Plugins.mavenPublish.id) {
plugins.withId("org.gradle.maven-publish") {
group = "dev.icerock.moko"
version = Deps.mokoMapsVersion

val javadocJar by tasks.registering(Jar::class) {
archiveClassifier.set("javadoc")
}

configure<PublishingExtension> {
repositories.maven("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
name = "OSSRH"

credentials {
username = System.getenv("OSSRH_USER")
password = System.getenv("OSSRH_KEY")
}
}

publications.withType<MavenPublication> {
// Stub javadoc.jar artifact
artifact(javadocJar.get())

// Provide artifacts information requited by Maven Central
pom {
name.set("MOKO maps")
description.set("Control your map from common code for mobile (android & ios) Kotlin Multiplatform development")
url.set("https://github.com/icerockdev/moko-maps")
licenses {
license {
url.set("https://github.com/icerockdev/moko-maps/blob/master/LICENSE.md")
}
}

developers {
developer {
id.set("Alex009")
name.set("Aleksey Mikhailov")
email.set("aleksey.mikhailov@icerockdev.com")
}
developer {
id.set("prokopishin")
name.set("Nikita Prokopishin")
email.set("nprokopishin@icerockdev.com")
}
developer {
id.set("Dorofeev")
name.set("Andrey Dorofeev")
email.set("adorofeev@icerockdev.com")
}
}

scm {
connection.set("scm:git:ssh://github.com/icerockdev/moko-maps.git")
developerConnection.set("scm:git:ssh://github.com/icerockdev/moko-maps.git")
url.set("https://github.com/icerockdev/moko-maps")
}
}
}

apply(plugin = Deps.Plugins.signing.id)

configure<SigningExtension> {
val signingKeyId: String? = System.getenv("SIGNING_KEY_ID")
val signingPassword: String? = System.getenv("SIGNING_PASSWORD")
val signingKey: String? = System.getenv("SIGNING_KEY")?.let { base64Key ->
String(Base64.getDecoder().decode(base64Key))
}
if (signingKeyId != null) {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign(publications)
}
}
version = libs.versions.mokoMapsVersion.get()
}
configurations.configureEach {
resolutionStrategy {
val coroutines: MinimalExternalModuleDependency = rootProject.libs.coroutines.get()
val forcedCoroutines: ModuleVersionSelector = DefaultModuleVersionSelector.newSelector(
coroutines.module,
coroutines.versionConstraint.requiredVersion
)
force(forcedCoroutines)
}
}
}
Expand Down
24 changes: 0 additions & 24 deletions buildSrc/build.gradle.kts

This file was deleted.

Loading