Skip to content

Commit

Permalink
Publishing JS, JVM, and Common artifacts to Maven Central (#2)
Browse files Browse the repository at this point in the history
* Publishing JS, JVM, and Common to Maven Central

* Maven central synchronization

* Remove some unnecessary code
  • Loading branch information
noheltcj authored Aug 19, 2018
1 parent aeb57ee commit 55ed710
Show file tree
Hide file tree
Showing 10 changed files with 253 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.iml
.gradle
/local.properties
/gradle.properties
/.idea
.DS_Store
/**/build
Expand Down
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
buildscript {
ext {
project_group_id = 'com.noheltcj'
project_version = '0.0.2'
kotlin_version = '1.2.60'
upload_artifacts = System.getenv("uploadArtifacts") == "true"
}

repositories {
jcenter()
}
}

subprojects {
repositories {
jcenter()
}

tasks.withType(Test) {
testLogging {
showStandardStreams = true
Expand Down
80 changes: 77 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,87 @@ plugins {
id 'kotlin-platform-common' version '1.2.60'
}

repositories {
mavenCentral()
}
group = project_group_id
version = project_version
archivesBaseName = 'rx-common'

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-common"

testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common"
testCompile "org.jetbrains.kotlin:kotlin-test-common"
}

apply {
plugin 'signing'
plugin 'maven'
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}

signing {
if (upload_artifacts) {
sign configurations.archives
}
}

artifacts {
archives sourcesJar, javadocJar, jar
}

uploadArchives {
if (upload_artifacts) {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name project.name
packaging 'jar'

description "A multiplatform ReactiveX partial implementation."
url 'https://github.com/noheltcj/RxCommon'

scm {
connection 'scm:git:https://github.com/noheltcj/RxCommon'
developerConnection 'scm:git:https://github.com/noheltcj/RxCommon'
url 'https://github.com/noheltcj/RxCommon'
}

licenses {
license {
name 'MIT'
url 'https://github.com/noheltcj/RxCommon/blob/master/LICENSE'
}
}

developers {
developer {
id 'noheltcj'
name 'Colton Nohelty'
email '[email protected]'
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion common/src/test/kotlin/com/noheltcj/rxcommon/CommonTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ class CommonTest {
@Test
fun randomTest() {
assertEquals(1, 1)
println("ran")
}
}
1 change: 0 additions & 1 deletion gradle.properties

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
13 changes: 2 additions & 11 deletions ios/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,16 @@ buildscript {
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:${project.property('konan.plugin.version')}"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.8"
}
}

apply plugin: 'konan'

konanArtifacts {
framework('RxCommon', targets: ['iphone_sim', 'iphone']) {
extraOpts '-module_name', ''
library('RxCommon', targets: ['iphone', 'iphone_sim', 'macbook', 'wasm32', 'linux', 'android_arm64', 'android_arm32']) {
enableMultiplatform true
}

program('test') {
srcDir 'src/main/kotlin'
commonSourceSets 'main', 'test'

enableMultiplatform true
extraOpts '-tr'
}
}

dependencies {
Expand Down
83 changes: 79 additions & 4 deletions js/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,89 @@ plugins {
id 'kotlin-platform-js' version '1.2.60'
}

repositories {
mavenCentral()
}

dependencies {
expectedBy project(":common")

compile "org.jetbrains.kotlin:kotlin-stdlib-js"

testCompile "org.jetbrains.kotlin:kotlin-test-js"
}


group = project_group_id
version = project_version
archivesBaseName = 'rx-common-js'

apply {
plugin 'signing'
plugin 'maven'
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}

signing {
if (upload_artifacts) {
sign configurations.archives
}
}

artifacts {
archives sourcesJar, javadocJar, jar
}

uploadArchives {
if (upload_artifacts) {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name project.name
packaging 'jar'

description "A multiplatform ReactiveX partial implementation."
url 'https://github.com/noheltcj/RxCommon'

scm {
connection 'scm:git:https://github.com/noheltcj/RxCommon'
developerConnection 'scm:git:https://github.com/noheltcj/RxCommon'
url 'https://github.com/noheltcj/RxCommon'
}

licenses {
license {
name 'MIT'
url 'https://github.com/noheltcj/RxCommon/blob/master/LICENSE'
}
}

developers {
developer {
id 'noheltcj'
name 'Colton Nohelty'
email '[email protected]'
}
}
}
}
}
}
}
84 changes: 79 additions & 5 deletions jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ plugins {
id 'kotlin-platform-jvm' version '1.2.60'
}

repositories {
mavenCentral()
}

dependencies {
expectedBy project(":common")

Expand All @@ -24,4 +20,82 @@ compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}

sourceCompatibility = "1.8"
sourceCompatibility = "1.8"

group = project_group_id
version = project_version
archivesBaseName = "rx-common-jvm"

apply {
plugin 'signing'
plugin 'maven'
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}

signing {
if (upload_artifacts) {
sign configurations.archives
}
}

artifacts {
archives sourcesJar, javadocJar, jar
}

uploadArchives {
if (upload_artifacts) {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name project.name
packaging 'jar'

description "A multiplatform ReactiveX partial implementation."
url 'https://github.com/noheltcj/RxCommon'

scm {
connection 'scm:git:https://github.com/noheltcj/RxCommon'
developerConnection 'scm:git:https://github.com/noheltcj/RxCommon'
url 'https://github.com/noheltcj/RxCommon'
}

licenses {
license {
name 'MIT'
url 'https://github.com/noheltcj/RxCommon/blob/master/LICENSE'
}
}

developers {
developer {
id 'noheltcj'
name 'Colton Nohelty'
email '[email protected]'
}
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ pluginManagement {
}
}
}

enableFeaturePreview('GRADLE_METADATA')

rootProject.name = 'RxCommon'

include 'common', 'jvm', 'js', 'ios'
Expand Down

0 comments on commit 55ed710

Please sign in to comment.