Skip to content

Commit

Permalink
Migrate to the new publishing plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
juliabeliaeva committed Nov 18, 2022
1 parent 761d0bb commit 5ac7e66
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
27 changes: 19 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.7.10' apply false
id 'com.android.application' apply false
id 'maven-publish'
id 'io.codearte.nexus-staging' version '0.22.0'
id 'org.jetbrains.dokka' version '1.5.30'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id "com.gradle.plugin-publish" version "1.0.0" apply false
id 'org.jetbrains.dokka' version '1.5.30'
}

apply from: project.rootProject.file('gradle/dokka.gradle')

def kotlinDLVersion = "$majorVersion.$minorVersion"

allprojects {
Expand All @@ -21,17 +19,30 @@ allprojects {
version = kotlinDLVersion
}

def unpublishedSubprojects = ["examples", "gradlePlugin"]
apply from: project.rootProject.file('gradle/fatJar.gradle')
apply from: project.rootProject.file('gradle/dokka.gradle')

def unpublishedSubprojects = ["examples", "gradlePlugin"]
subprojects {
if (name in unpublishedSubprojects) return
apply from: project.rootProject.file('gradle/publish.gradle')
}

def sonatypeUser = System.getenv('SONATYPE_USER')
def sonatypePassword = System.getenv('SONATYPE_PASSWORD')
nexusPublishing {
packageGroup = project.group.toString()
repositories {
sonatype {
username = sonatypeUser
password = sonatypePassword
repositoryDescription = "kotlinx.kotlindl staging repository, version: $version"
}
}
}

task setTeamcityVersion {
doLast {
println("##teamcity[buildNumber '$version']")
}
}

apply from: project.rootProject.file('gradle/fatJar.gradle')
}
23 changes: 1 addition & 22 deletions gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,12 @@
apply plugin: 'maven-publish'
apply from: project.rootProject.file('gradle/maven-metadata.gradle')

def isMultiplatform = project.name in ["impl", "onnx", "visualization", "dataset"]

task javadocJar(type: Jar) {
classifier 'javadoc'
}

def sonatypeUser = System.getenv('SONATYPE_USER')
def sonatypePassword = System.getenv('SONATYPE_PASSWORD')

def moduleName = "kotlin-deeplearning-" + project.name

nexusStaging {
username sonatypeUser
password sonatypePassword
packageGroup project.group.toString()
repositoryDescription "kotlinx.kotlindl staging repository, version: $version"
delayBetweenRetriesInMillis 5000
}
def isMultiplatform = project.name in ["impl", "onnx", "visualization", "dataset"]

afterEvaluate {
publishing {
Expand Down Expand Up @@ -69,15 +57,6 @@ afterEvaluate {
}
}
}
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = sonatypeUser
password = sonatypePassword
}
}
}
}
}

Expand Down

0 comments on commit 5ac7e66

Please sign in to comment.