Skip to content

Commit bc68d63

Browse files
committed
:~ one more
1 parent 6591c4e commit bc68d63

File tree

3 files changed

+41
-2
lines changed

3 files changed

+41
-2
lines changed

build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ buildscript {
3131
}
3232
}
3333
dependencies {
34+
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:$artifactory_plugin_version"
3435
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3536
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_native_version"
3637
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ html_version=0.6.8
1111
lincheck_version=1.9
1212
dokka_version=0.9.16-rdev-2-mpp-hacks
1313
bintray_version=1.8.2-SNAPSHOT
14+
artifactory_plugin_version=4.7.3
1415

1516
# JS
1617
gradle_node_version=1.2.0

gradle/publish-bintray.gradle

+39-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
apply plugin: 'maven'
88
apply plugin: 'maven-publish'
99
apply plugin: 'com.jfrog.bintray'
10+
apply plugin: 'com.jfrog.artifactory'
1011

1112
apply from: project.rootProject.file('gradle/maven-central.gradle')
1213

@@ -16,6 +17,8 @@ def coroutines_core = platformLib("kotlinx-coroutines-core", platform)
1617
// ------------- tasks
1718

1819
def isNative = project.name.endsWith("native")
20+
def bUser = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
21+
def bKey = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
1922

2023
task sourcesJar(type: Jar) {
2124
classifier = 'sources'
@@ -46,9 +49,43 @@ publishing {
4649
}
4750
}
4851

52+
artifactory {
53+
contextUrl = 'https://oss.jfrog.org/artifactory'
54+
publish {
55+
repository {
56+
repoKey = 'oss-snapshot-local'
57+
username = bUser
58+
password = bKey
59+
}
60+
61+
publications {
62+
maven(MavenPublication) {
63+
if (!isNative) {
64+
from components.java
65+
artifact javadocJar
66+
artifact sourcesJar
67+
}
68+
pom.withXml(configureMavenCentralMetadata)
69+
}
70+
}
71+
72+
defaults {
73+
publications('maven')
74+
}
75+
}
76+
}
77+
78+
task publishDevelopSnapshot() {
79+
def branch = System.getenv('currentBranch')
80+
println "Current branch: $branch"
81+
if (branch == "develop") {
82+
dependsOn(":artifactoryPublish")
83+
}
84+
}
85+
4986
bintray {
50-
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
51-
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
87+
user = bUser
88+
key = bKey
5289
override = true // for multi-platform Kotlin/Native publishing
5390
publications = ['maven']
5491
pkg {

0 commit comments

Comments
 (0)