-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to modern kotlin multiplatform project structure (#38)
- Loading branch information
Showing
90 changed files
with
961 additions
and
1,022 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
buildscript { | ||
repositories { | ||
jcenter() | ||
google() | ||
} | ||
|
||
dependencies { | ||
classpath(Dependencies.Classpath.kotlinGradle) | ||
classpath(Dependencies.Classpath.androidTools) | ||
classpath(Dependencies.Classpath.dokkaPlugin) | ||
} | ||
} | ||
|
||
subprojects { | ||
group = "com.noheltcj" | ||
version = Versions.rxcommon | ||
|
||
repositories { | ||
jcenter() | ||
google() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
jcenter() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
object Dependencies { | ||
object Classpath { | ||
const val kotlinGradle = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}" | ||
const val androidTools = "com.android.tools.build:gradle:${Versions.Android.gradleTools}" | ||
const val dokkaPlugin = "org.jetbrains.dokka:dokka-gradle-plugin:${Versions.dokka}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import org.gradle.api.Project | ||
|
||
object Properties { | ||
val isRelease by lazy { | ||
System.getenv("release") == "true" | ||
} | ||
|
||
fun Project.requiredForReleaseProperty(name: String) = | ||
properties[name] as String? | ||
?: let { | ||
if (isRelease) | ||
throw RuntimeException("Missing property $name") | ||
return "" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
import Properties.requiredForReleaseProperty | ||
import org.gradle.api.Project | ||
import org.gradle.api.publish.PublishingExtension | ||
import org.gradle.api.publish.maven.MavenPublication | ||
import java.net.URI | ||
|
||
object Publishing { | ||
fun PublishingExtension.addRepositories(project: Project) { | ||
repositories { | ||
maven { | ||
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" | ||
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" | ||
|
||
url = URI( | ||
if (Properties.isRelease) { | ||
releasesRepoUrl | ||
} else { | ||
snapshotsRepoUrl | ||
} | ||
) | ||
|
||
authentication { | ||
credentials { | ||
username = project.requiredForReleaseProperty("ossrhUsername") | ||
password = project.requiredForReleaseProperty("ossrhPassword") | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
fun MavenPublication.mutatePublicationPom(projectName: String) { | ||
pom { | ||
name.set(projectName) | ||
inceptionYear.set("2018") | ||
|
||
description.set("A multiplatform ReactiveX implementation.") | ||
url.set("https://github.com/noheltcj/RxCommon") | ||
|
||
scm { | ||
connection.set("scm:git:https://github.com/noheltcj/RxCommon") | ||
developerConnection.set("scm:git:https://github.com/noheltcj/RxCommon") | ||
url.set("https://github.com/noheltcj/RxCommon") | ||
} | ||
|
||
licenses { | ||
license { | ||
name.set("MIT") | ||
url.set("https://github.com/noheltcj/RxCommon/blob/master/LICENSE") | ||
} | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("noheltcj") | ||
name.set("Colton Nohelty") | ||
email.set("noheltycolton@gmail.com") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
object Versions { | ||
const val rxcommon = "0.6.0" | ||
const val kotlin = "1.3.50" | ||
const val dokka = "0.10.0" | ||
|
||
object Android { | ||
const val gradleTools = "3.5.0" | ||
} | ||
} |
Oops, something went wrong.