1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-25 10:07:14 +00:00

Merge pull request #3 from InsanusMokrassar/develop

Add publishing
This commit is contained in:
InsanusMokrassar 2018-12-28 10:48:01 +08:00 committed by GitHub
commit 5935de526c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 102 additions and 7 deletions

View File

@ -1,7 +1,5 @@
apply plugin: 'java'
apply plugin: "application"
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
project.version = "0.8"
project.group = "com.github.insanusmokrassar"
buildscript {
repositories {
@ -13,9 +11,16 @@ buildscript {
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version"
}
}
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'kotlinx-serialization'
apply from: "publish.gradle"
repositories {
mavenLocal()
jcenter()
@ -35,6 +40,3 @@ dependencies {
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
mainClassName = "com.github.insanusmokrassar.TelegramBotAPI.IndexKt"

View File

@ -4,3 +4,5 @@ kotlin_coroutines_version=1.1.0
kotlin_serialisation_runtime_version=0.9.1
joda_time_version=2.10.1
ktor_version=1.0.1
gradle_bintray_plugin_version=1.8.4

58
maven.publish.gradle Normal file
View File

@ -0,0 +1,58 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
def pomConfig = {
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution "repo"
}
}
developers {
developer {
name "Ovsiannikov Aleksei"
email "ovsyannikov.alexey95@gmail.com"
}
}
scm {
url "https://github.com/InsanusMokrassar/${project.name}"
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
classifier = 'javadoc'
}
publishing {
publications {
maven(MavenPublication) {
from components.java
groupId "${project.group}"
artifactId "${project.name}"
version "${project.version}"
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', 'It is one more project which wish to be useful and full Telegram Bots API bridge for Kotlin')
root.appendNode('name', 'Telegram Bot API')
root.children().last() + pomConfig
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.maven
}

33
publish.gradle Normal file
View File

@ -0,0 +1,33 @@
apply plugin: 'com.jfrog.bintray'
ext {
projectBintrayDir = "${project.group}/".replace(".", "/") + "${project.name}/${project.version}"
}
bintray {
user = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')
key = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
publications = ["maven"]
filesSpec {
into "$projectBintrayDir"
from("build/libs") {
include "**/*.asc"
}
from("build/publications/maven") {
rename 'pom-default.xml(.*)', "${project.name}-${project.version}.pom\$1"
}
}
pkg {
repo = 'StandardRepository'
name = "${project.name}"
vcsUrl = "https://github.com/InsanusMokrassar/${project.name}"
licenses = ['Apache-2.0']
version {
name = "${project.version}"
released = new Date()
vcsTag = name
}
}
}
apply from: "maven.publish.gradle"