Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gradle file consistent with java-client to enable artifact publishing. #1

Merged
merged 2 commits into from
Apr 6, 2016
Merged
Changes from all commits
Commits
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
98 changes: 87 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
group 'com.launchdarkly'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: "maven"
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'idea'

repositories {
mavenCentral()
mavenLocal()

// Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots:
maven {
url "https://oss.sonatype.org/content/groups/public/"
}
}

allprojects {
group = 'com.launchdarkly'
Expand All @@ -13,10 +20,27 @@ allprojects {
targetCompatibility = 1.7
}

dependencies {
compile 'com.squareup.okhttp3:okhttp:3.2.0'
testCompile "org.mockito:mockito-core:1.10.19"
testCompile group: 'junit', name: 'junit', version: '4.11'
}

repositories {
mavenCentral()
mavenLocal()
task wrapper(type: Wrapper) {
gradleVersion = '2.0'
}

jar {
baseName = 'okhttp-eventsource'
manifest {
attributes("Implementation-Version": version)
}
}
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
}

// custom tasks for creating source/javadoc jars
Expand All @@ -30,9 +54,61 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}

// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}

dependencies {
compile 'com.squareup.okhttp3:okhttp:3.2.0'
testCompile "org.mockito:mockito-core:1.+"
testCompile group: 'junit', name: 'junit', version: '4.11'
signing {
sign configurations.archives
}

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}

uploadArchives {
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 'okhttp-eventsource'
packaging 'jar'
description 'EventSource Implementation built on OkHttp'
url 'https://github.com/launchdarkly/okhttp-eventsource'

scm {
connection 'scm:git:https://github.com/launchdarkly/okhttp-eventsource'
developerConnection 'scm:git:https://github.com/launchdarkly/okhttp-eventsource'
url 'https://github.com/launchdarkly/okhttp-eventsource'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
name 'LaunchDarkly'
email 'team@launchdarkly.com'
}
}
}
}
}
}