Skip to content

Commit

Permalink
Add first implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCasia committed Jul 27, 2020
1 parent efb444c commit 167031f
Show file tree
Hide file tree
Showing 19 changed files with 971 additions and 0 deletions.
195 changes: 195 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,106 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij,kotlin,macos,linux,windows,gradle
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij,kotlin,macos,linux,windows,gradle

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.idea
*.hprof

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/**/sonarlint/

# SonarQube Plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

### Kotlin ###
# Compiled class file
*.class

Expand All @@ -21,3 +124,95 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Gradle ###
.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

### Gradle Patch ###
**/build/

# End of https://www.toptal.com/developers/gitignore/api/intellij,kotlin,macos,linux,windows,gradle

/local.properties
119 changes: 119 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency

plugins {
kotlin("multiplatform") version "1.3.72"
id("com.android.library")
id("maven-publish")
}

group = "com.pablocasia.kotorra"
version = "1.0.0"

repositories {
gradlePluginPortal()
google()
jcenter()
mavenCentral()
maven {
url = uri("https://dl.bintray.com/kotlin/kotlin-eap")
}
}

kotlin {
android()
ios {
binaries {
framework {
baseName = "kotorra"
}
}
}
js {
browser()
}
jvm()

val commonMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-common"))
}
}
val commonTest by sourceSets.getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val androidMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-jdk7"))
}
}
val androidTest by sourceSets.getting
val iosMain by sourceSets.getting
val iosTest by sourceSets.getting
val jsMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-js"))
}
}
val jsTest by sourceSets.getting {
dependencies {
implementation(kotlin("test-js"))
}
}
val jvmMain by sourceSets.getting {
dependencies {
implementation(kotlin("stdlib-jdk7"))
}
}
val jvmTest by sourceSets.getting
}

android {
compileSdkVersion(29)
defaultConfig {
minSdkVersion(15)
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
}

project.afterEvaluate {
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "com.pablocasia.kotorra"
artifactId = "kotorra-android"
version = "1.0.0"
artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar")

pom {
withXml {
val dependenciesNode = asNode().appendNode("dependencies")

listOf(
Pair("compile", "compile"),
Pair("api", "api"),
Pair("implementation", "runtime")
).forEach { scope ->
configurations.findByName(scope.first)?.dependencies
?.filterIsInstance<DefaultExternalModuleDependency>()
?.forEach { dependency ->
dependenciesNode.appendNode("dependency").apply {
appendNode("groupId", dependency.group)
appendNode("artifactId", dependency.name)
appendNode("version", dependency.version)
appendNode("scope", scope.second)
}
}
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kotlin.code.style=official
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 167031f

Please sign in to comment.