Skip to content

Commit

Permalink
added publish tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
al-zakharov committed Jul 3, 2022
1 parent 25de894 commit e80d285
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.gradle
build
gradle.properties
80 changes: 80 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.20'
id 'java-library'
id 'maven-publish'
id 'signing'
id "io.codearte.nexus-staging" version "0.30.0"
}

group = 'com.alzakharov'
version = '0.0.1'

repositories {
mavenCentral()
}
Expand All @@ -24,4 +30,78 @@ task ktlint(type: JavaExec, group: "verification") {
main = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "src/**/*.kt"
}

java {
withJavadocJar()
withSourcesJar()
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "kotlin-validators"
from components.java
pom {
name = 'Kotlin validators'
description = "Simple data validation"
url = "https://github.com/al-zakharov/kotlin-validators"
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id = "al-zakharov"
name = "Aleksandr Zakharov"
email = "al-zakharov@gmail.com"
}
}
scm {
connection = "scm:https://github.com/al-zakharov/kotlin-validators.git"
developerConnection = "scm:git@github.com/al-zakharov/kotlin-validators.git"
url = "https://github.com/al-zakharov/kotlin-validators"
}
}
}
}

repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = project.properties["MAVEN_USERNAME"].toString()
password = project.properties["MAVEN_PASSWORD"].toString()
}
}
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/al-zakharov/kotlin-validators"
credentials {
username = project.properties["GITHUB_ACTOR"].toString()
password = project.properties["GITHUB_TOKEN"].toString()
}
}
}
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
username = project.properties["MAVEN_USERNAME"].toString()
password = project.properties["MAVEN_PASSWORD"].toString()
}

signing {
sign publishing.publications.mavenJava
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

0 comments on commit e80d285

Please sign in to comment.