Skip to content

Commit

Permalink
Publish Scarlet to maven central
Browse files Browse the repository at this point in the history
For 0.1.X, starting with 0.1.8, Scarlet will be avaliable in maven central.
Will put up a seperate PR for 0.2.X releases.
  • Loading branch information
Aaron He committed Jun 20, 2019
1 parent d01ed28 commit 8da7192
Show file tree
Hide file tree
Showing 35 changed files with 98 additions and 923 deletions.
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Scarlet
===
[![CircleCI](https://circleci.com/gh/Tinder/Scarlet.svg?style=svg)](https://circleci.com/gh/Tinder/Scarlet)
[![Release](https://jitpack.io/v/tinder/scarlet.svg)](https://jitpack.io/#tinder/scarlet)

A Retrofit inspired WebSocket client for Kotlin, Java, and Android.

Expand Down Expand Up @@ -76,29 +75,22 @@ TODO

Download
--------
While we are working on Bintray support, Scarlet is available via [JitPack][jitpack].
Scarlet is available via Maven Central.

Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].

##### Maven:
```xml
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<dependency>
<groupId>com.github.tinder.scarlet</groupId>
<artifactId>scarlet</artifactId>
<version>0.1.7</version>
<version>0.1.8</version>
</dependency>
```

##### Gradle:
```groovy
repositories {
// ...
maven { url "https://jitpack.io" }
}
implementation 'com.github.tinder.scarlet:scarlet:$0.1.7'
implementation 'com.tinder.scarlet:scarlet:0.1.8'
```

### Plug-in Roadmap
Expand Down Expand Up @@ -162,4 +154,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[slides]: https://speakerdeck.com/zhxnlai/taming-websocket-with-scarlet
[kotliners]: https://www.conferenceforkotliners.com/
[state-machine]: https://github.com/Tinder/StateMachine
[jitpack]: https://jitpack.io/#tinder/scarlet
[snap]: https://oss.sonatype.org/content/repositories/snapshots/
15 changes: 6 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ buildscript {
ext.kotlin_version = '1.3.0'
ext.dokka_version = '0.9.16'
repositories {
mavenCentral()
google()
jcenter()
}
dependencies {
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.8.0'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.5.4"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:${dokka_version}"
classpath 'org.kordamp.gradle:stats-gradle-plugin:0.2.2'
}
}

Expand All @@ -26,14 +24,13 @@ ktlint {
}

subprojects {
apply plugin: 'org.kordamp.gradle.stats'
apply plugin: "com.jfrog.artifactory"
// group = 'com.tinder.scarlet' TODO use Bintray
group = 'com.github.tinder'
group = GROUP
version = VERSION_NAME

repositories {
maven { url "https://jitpack.io" }
mavenCentral()
google()
maven { url "https://jitpack.io" }
jcenter()
}
}
Expand Down
15 changes: 14 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
android.enableJetifier=true
android.useAndroidX=true
version=0.1.7

GROUP=com.tinder.scarlet
VERSION_NAME=0.1.8

POM_DESCRIPTION=A Retrofit inspired WebSocket client for Kotlin, Java, and Android.
POM_URL=https://github.com/Tinder/Scarlet
POM_SCM_URL=https://github.com/Tinder/Scarlet
POM_SCM_CONNECTION=scm:git:git://github.com/Tinder/Scarlet.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://[email protected]/Tinder/Scarlet.git
POM_LICENCE_NAME=BSD 3-Clause "New" or "Revised" License
POM_LICENCE_URL=https://opensource.org/licenses/BSD-3-Clause
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=Tinder
POM_DEVELOPER_NAME=Tinder Open Source
42 changes: 2 additions & 40 deletions scarlet-core-internal/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'maven-publish'

dependencies {
api project(':scarlet-core')
Expand All @@ -13,42 +13,4 @@ dependencies {
testImplementation rootProject.ext.mockito
testImplementation rootProject.ext.kotlinReflect
testImplementation rootProject.ext.assertJ
}

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

artifacts {
archives sourcesJar
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.tinder'
version version
artifactId project.getName()
artifact sourcesJar
from components.java
}
}
}

artifactory {
contextUrl = 'https://tinder.jfrog.io/tinder'
publish {
repository {
repoKey = 'libs-release-local'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}
}
3 changes: 3 additions & 0 deletions scarlet-core-internal/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=scarlet-core-internal
POM_NAME=Scarlet Core Internal
POM_PACKAGING=jar
57 changes: 1 addition & 56 deletions scarlet-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven-publish'

dependencies {
api rootProject.ext.reactiveStreams
Expand All @@ -10,57 +9,3 @@ dependencies {
testImplementation rootProject.ext.junit
testImplementation rootProject.ext.assertJ
}

dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}

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

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar, javadocJar
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.tinder'
version version
artifactId project.getName()
artifact sourcesJar
artifact javadocJar
from components.java
}
}
}

artifactory {
contextUrl = 'https://tinder.jfrog.io/tinder'
publish {
repository {
repoKey = 'libs-release-local'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}
3 changes: 3 additions & 0 deletions scarlet-core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=scarlet-core
POM_NAME=Scarlet(Core)
POM_PACKAGING=jar
90 changes: 1 addition & 89 deletions scarlet-lifecycle-android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'org.jetbrains.dokka-android'
apply plugin: 'maven-publish'

android {
compileSdkVersion rootProject.ext.compileSdkVersion
Expand Down Expand Up @@ -33,90 +31,4 @@ dependencies {
testImplementation rootProject.ext.junit
}

dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}

task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
outputDirectory = javadoc.destinationDir
}

task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "sources"
}

publishing {
publications {
aar(MavenPublication) {
groupId 'com.tinder'
version version
artifactId project.getName()

artifact(sourcesJar)
artifact(javadocJar)
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

// List all compile dependencies and write to POM
configurations.implementation.getAllDependencies().each { Dependency dep ->
if (dep.group == null || dep.version == null || dep.name == null || dep.name == "unspecified")
return // ignore invalid dependencies

def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dep.group)
dependencyNode.appendNode('artifactId', dep.name)
dependencyNode.appendNode('version', dep.version)

if (!dep.transitive) {
// If this dependency is transitive, we should force exclude all its dependencies them from the POM
def exclusionNode = dependencyNode.appendNode('exclusions').appendNode('exclusion')
exclusionNode.appendNode('groupId', '*')
exclusionNode.appendNode('artifactId', '*')
} else if (!dep.properties.excludeRules.empty) {
// Otherwise add specified exclude rules
def exclusionsNode = dependencyNode.appendNode('exclusions')
dep.properties.excludeRules.each { ExcludeRule rule ->
def exclusionNode = exclusionsNode.appendNode('exclusion')
exclusionNode.appendNode('groupId', rule.group ?: '*')
exclusionNode.appendNode('artifactId', rule.module ?: '*')
}
}
}
}
}
}
}

artifactory {
contextUrl = 'https://tinder.jfrog.io/tinder'
publish {
repository {
repoKey = 'libs-release-local'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
defaults {
publications('aar')
publishArtifacts = true
publishPom = true
}
}
}
apply plugin: 'com.vanniktech.maven.publish'
3 changes: 3 additions & 0 deletions scarlet-lifecycle-android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=lifecycle-android
POM_NAME=Lifecyle: Android
POM_PACKAGING=aar
40 changes: 1 addition & 39 deletions scarlet-message-adapter-builtin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apply plugin: 'com.vanniktech.maven.publish'
apply plugin: 'kotlin'
apply plugin: 'java-library'
apply plugin: 'maven-publish'

dependencies {
implementation project(':scarlet-core')
Expand All @@ -12,41 +12,3 @@ dependencies {
testImplementation rootProject.ext.kotlinReflect
testImplementation rootProject.ext.assertJ
}

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

artifacts {
archives sourcesJar
}

publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.tinder'
version version
artifactId project.getName()
artifact sourcesJar
from components.java
}
}
}

artifactory {
contextUrl = 'https://tinder.jfrog.io/tinder'
publish {
repository {
repoKey = 'libs-release-local'
username = System.getenv("ARTIFACTORY_USER")
password = System.getenv("ARTIFACTORY_PASSWORD")
maven = true
}
defaults {
publications('mavenJava')
publishArtifacts = true
publishPom = true
}
}
}
3 changes: 3 additions & 0 deletions scarlet-message-adapter-builtin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_ARTIFACT_ID=message-adapter-built-in
POM_NAME=Message Adapter: Built-in
POM_PACKAGING=jar
Loading

0 comments on commit 8da7192

Please sign in to comment.