Skip to content

Commit

Permalink
Add maven central and jcenter publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt committed Jul 14, 2018
1 parent 0d77f1e commit a5a6d46
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 6 deletions.
75 changes: 75 additions & 0 deletions deploy.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
repositories {
mavenCentral()
}

apply plugin: 'maven'

def versionTag = version.toString()
def githubUrl = 'https://' + githubRepo
def scmUrl = 'scm:git:git://' + githubRepo + '.git'

bintray {
user = bintrayUser
key = bintrayKey
dryRun = deployDryRun ? true : false // Whether to run this as dry-run, without deploying
publish = true // If version should be auto published after an upload
configurations = ['archives'] // Use the archives Configuration.
pkg {
repo = 'maven'
name = pkgName
userOrg = user
licenses = [pkgLicense]
publicDownloadNumbers = false
vcsUrl = githubUrl + '.git'
desc = pkgDesc
websiteUrl = githubUrl
issueTrackerUrl = githubUrl + '/issues'
version {
name = versionTag
desc = pkgDesc
vcsTag = versionTag
released = new Date()
gpg {
sign = true // Determines whether to GPG sign the files.
}
mavenCentralSync {
sync = true // Optional (true by default). Determines whether to sync the version to Maven Central.
user = mavenUserToken // OSS user token
password = mavenUserPass // OSS user password
close = '1' // Close staging repository and release artifacts to Maven Central. Default = 1 (true). Set to 0 = You will release the version manually.
}
}
}
}

install {
repositories.mavenInstaller {
pom.name = pkgName
pom.version = versionTag
pom.artifactId = pkgName
pom.project {
name pkgName
packaging 'bundle'
description pkgDesc
url githubUrl

scm {
url githubUrl
connection scmUrl
developerConnection scmUrl
}

developers {
developer devInfo
}

licenses {
license {
name pkgLicense
url pkgLicenseUrl
distribution 'repo'
}
}
}
}
}
53 changes: 47 additions & 6 deletions mordant/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
apply from: '../maven.gradle'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven'
apply plugin: 'com.jfrog.bintray'

version = VERSION_NAME
group = GROUP

buildscript {
repositories {
jcenter()
}

dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.2'
}
}

repositories {
mavenCentral()
}

dependencies {
compile 'com.github.ajalt:colormath:1.1.0'
}

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

task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
outputFormat = 'javadoc'
Expand All @@ -15,11 +43,24 @@ artifacts {
archives javadocJar
}

repositories {
mavenCentral()
ext {
pkgName = 'mordant'
pkgDesc = 'Full-featured text styling for Kotlin command-line applications '
githubRepo = 'github.com/ajalt/mordant'
pkgLicense = 'Apache-2.0'
pkgLicenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
devInfo = {
id 'ajalt'
name 'AJ Alt'
url 'https://github.com/ajalt'
}
bintrayUser = System.getenv('BINTRAY_USER')
bintrayKey = System.getenv('BINTRAY_API_KEY')
mavenUserToken = System.getenv('MAVEN_USER_TOKEN')
mavenUserPass = System.getenv('MAVEN_USER_PASS')
deployDryRun = false
}

dependencies {
compile 'com.github.ajalt:colormath:1.1.0'
}
apply from: new File(rootDir, 'deploy.gradle')


0 comments on commit a5a6d46

Please sign in to comment.